DAWN-108 ⁃ All C API in wasm interface should use lowercase names with _ between words
Changing the API will require fixing all examples.
ATC:
- Visually inspect the code for CamelCase.
➤ Thomas B. Cox commented:
Is this file related? https://github.com/EOSIO/eos/blob/master/CONTRACT_DEVELOPER_API.md
➤ 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)
➤ 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.
➤ 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.
➤ 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.
➤ 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.
➤ 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
➤ Corey Lederer commented:
We created a Confluence page: https://blockone.atlassian.net/wiki/spaces/ID/pages/10518529/Coding+Standards
➤ 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.
➤ 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?
➤ 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.
➤ 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:
- C API
- 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
➤ Kevin Heifner commented:
This issue has become an epic: STAT-121.
➤ Kevin Heifner commented:
Moving out of the sprint. When the associated epic is complete, this issue can be closed.
➤ 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.
Setting to In Progress to match JIRA
Closing to match Jira state