eos icon indicating copy to clipboard operation
eos copied to clipboard

DAWN-108 ⁃ All C API in wasm interface should use lowercase names with _ between words

Open bytemaster opened this issue 9 years ago • 17 comments

Changing the API will require fixing all examples.

ATC:

  • Visually inspect the code for CamelCase.

bytemaster avatar Oct 30 '17 16:10 bytemaster

➤ Thomas B. Cox commented:

Is this file related? https://github.com/EOSIO/eos/blob/master/CONTRACT_DEVELOPER_API.md

blockone-syncclient avatar Oct 30 '17 20:10 blockone-syncclient

➤ Brian Johnson commented:

[~thomas.cox] Yes, and it was already out of date for EOS Dawn 1.0, since onApply_Transfer_simplecoin would have been the old design that Dan originally had for WASM, but was redesigned before the release. The onPrecondition_*** and onValidate_*** are no longer part of the API (not sure if the whole idea is gone, or if just the support is gone for now). API functions like readMessage would become read_message with this change. (Did not read the whole document to find all errors, just some)

blockone-syncclient avatar Oct 31 '17 13:10 blockone-syncclient

➤ Thomas B. Cox commented:

[~brian.johnson] where does one go to find the affected API as it currently exists? Sorry if that's a dumb question.

blockone-syncclient avatar Oct 31 '17 13:10 blockone-syncclient

➤ Brian Johnson commented:

[~thomas.cox] The easiest way to know what the API is, is to look at all header files (*.h) in contracts/eoslib. Those files provide the external declaration that ultimately is provided by wasm_interface in eosd at runtime.

blockone-syncclient avatar Oct 31 '17 14:10 blockone-syncclient

➤ Brian Johnson commented:

[~thomas.cox] [~admin] [~dan.larimer] The names of classes and types don't meet the coding standards either (Table and AccountName). Issue with types like AccountName (Name/PermissionName) is that they are all throughout the code. Whatever we decide, we need to determine what the Contract/WASM API coding standard is (can be different from EOS internal development coding standard) and set it in stone, because I don't think contract writers will be ok with having to make those changes for later refactoring and it will be frustrating to them if we are not consistently naming classes or types.

blockone-syncclient avatar Nov 01 '17 18:11 blockone-syncclient

➤ David Moss commented:

[~brian.johnson] Thanks for surfacing this. We need an impact analysis of this to determine how we get the coding standard in place and conform current code to it.

blockone-syncclient avatar Nov 01 '17 19:11 blockone-syncclient

➤ Kevin Heifner commented:

11/1/2017 Meeting with Dan.

  • All structs, classes, methods, types should be lower case with _ between words including constants.
  • All Template arguments should be CamelCase
  • All MACROS should be all UPPERCASE

blockone-syncclient avatar Nov 01 '17 21:11 blockone-syncclient

➤ Corey Lederer commented:

We created a Confluence page: https://blockone.atlassian.net/wiki/spaces/ID/pages/10518529/Coding+Standards

blockone-syncclient avatar Nov 02 '17 14:11 blockone-syncclient

➤ Kevin Heifner commented:

[~admin] I hope it was obvious from yesterday's meeting that this is much larger scope than we first imagined. As such, there is no way it can make it in the current sprint.

blockone-syncclient avatar Nov 02 '17 14:11 blockone-syncclient

➤ David Moss commented:

[~kevin.heifner] [~brian.johnson] As per [~dan.larimer], we can focus on the C API in the WASM interface first. Is that possible for Sprint 2? Or will all changes be postponed until later Sprints?

blockone-syncclient avatar Nov 02 '17 14:11 blockone-syncclient

➤ Kevin Heifner commented:

[~admin] Since the end of Sprint 2 is today. I don't see how we can get the changes in for C API today.

blockone-syncclient avatar Nov 02 '17 14:11 blockone-syncclient

➤ David Moss commented:

[~kevin.heifner] Okay, please make "Standards" an Epic with each of the different areas as a story, with C API in Sprint 3:

  1. C API
  2. All structs, classes, methods, types should be lower case with _ between words including constants.
  3. All Template arguments should be CamelCase
  4. All MACROS should be all UPPERCASE

blockone-syncclient avatar Nov 02 '17 14:11 blockone-syncclient

➤ Kevin Heifner commented:

This issue has become an epic: STAT-121.

blockone-syncclient avatar Nov 02 '17 18:11 blockone-syncclient

➤ Kevin Heifner commented:

Moving out of the sprint. When the associated epic is complete, this issue can be closed.

blockone-syncclient avatar Nov 02 '17 18:11 blockone-syncclient

➤ Brian Johnson commented:

It was decided in telegram, with [~dan.larimer], that requireScope, defined in wasm_interface.cpp to provide the intrinsic function for Contract API, should be removed.

blockone-syncclient avatar Nov 02 '17 18:11 blockone-syncclient

Setting to In Progress to match JIRA

coreylederer avatar Nov 08 '17 17:11 coreylederer

Closing to match Jira state

brianjohnson5972 avatar Nov 20 '17 21:11 brianjohnson5972