EOSIO / eos

An open source smart contract platform
https://developers.eos.io/manuals/eos
MIT License
11.28k stars 3.6k forks source link

DAWN-123 ⁃ Structs, Classes, Methods, and Types Standards Update #624

Closed blockone-syncclient closed 6 years ago

blockone-syncclient commented 6 years ago

Update all structs, classes, methods, types should be lower case with _ between words including constants.

https://blockone.atlassian.net/wiki/spaces/ID/pages/7864359/Testing+Process+Overview

ALSO: https://blockone.atlassian.net/wiki/spaces/ID/pages/10518529/Coding+Standards

blockone-syncclient commented 6 years ago

➤ Brian Johnson commented:

[~dan.larimer] [~admin] [~thomas.cox] Since types are changing from being defined as AccountName to now being account_name, the AbiSerializer mapping for this will go from:

built_in_types.emplace("AccountName", packUnpack());

to :

built_in_types.emplace("account_name", packUnpack());

So that a contracts ABI will match the type names defined in the contract. And similarly for other type names that are changing.

blockone-syncclient commented 6 years ago

➤ Kevin Heifner commented:

[~dan.larimer] FYI, This is leaking into almost every file in EOS. Transaction => transaction Abi => abi AccountName => account_name etc.

blockone-syncclient commented 6 years ago

➤ Joshua Lavin commented:

[~andrianto.lie] [~pravin.bezwada] [~dhanesh.balakrishnan] [~christian.dunst] Please note the changes in this ticket.

blockone-syncclient commented 6 years ago

➤ Kevin Heifner commented:

These are the ones that caused me the most trouble. They impact contracts and json interfaces.

eosjs project still needs to be updated with the new type names. Web ui project still needs to be update with the new type names. All contracts not in eos github will need to be update with the new type names.

renamed:    ../../libraries/chain/BlockchainConfiguration.cpp -> ../../libraries/chain/blockchain_configuration.cpp
deleted:    ../../libraries/chain/include/eos/chain/BlockchainConfiguration.hpp
new file:   ../../libraries/chain/include/eos/chain/blockchain_configuration.hpp
renamed:    ../../libraries/types/AbiSerializer.cpp -> ../../libraries/types/abi_serializer.cpp
renamed:    ../../libraries/types/Asset.cpp -> ../../libraries/types/asset.cpp
deleted:    ../../libraries/types/include/eos/types/AbiSerializer.hpp
new file:   ../../libraries/types/include/eos/types/abi_serializer.hpp
renamed:    ../../libraries/types/include/eos/types/Asset.hpp -> ../../libraries/types/include/eos/types/asset.hpp
renamed:    ../../libraries/types/include/eos/types/PublicKey.hpp -> ../../libraries/types/include/eos/types/public_key.hpp
renamed:    ../../libraries/types/PublicKey.cpp -> ../../libraries/types/public_key.cpp

modified:   ../../CONTRACT_DEVELOPER_API.md
modified:   ../../Docker/config.ini
modified:   ../../contracts/currency/currency.abi
modified:   ../../contracts/eoslib/eosc.dox
modified:   ../../contracts/eoslib/rpc.dox
modified:   ../../contracts/eoslib/tutorial.md
modified:   ../../contracts/exchange/exchange.abi
modified:   ../../contracts/proxy/proxy.abi
modified:   ../../contracts/simpledb/simpledb.abi
modified:   ../../contracts/skeleton/skeleton.abi
modified:   ../../contracts/storage/storage.abi
modified:   ../../contracts/tic_tac_toe/tic_tac_toe.abi
modified:   ../../docs/exchange_8hpp.html
modified:   ../../docs/exchange_8hpp_source.html
modified:   ../../docs/namespaceexchange.html
modified:   ../../docs/namespacemembers.html
modified:   ../../docs/namespacemembers_type.html
modified:   ../../libraries/chain/CMakeLists.txt
modified:   ../../libraries/chain/block_schedule.cpp
modified:   ../../libraries/chain/blockchain_configuration.cpp
modified:   ../../libraries/chain/chain_controller.cpp
modified:   ../../libraries/chain/include/eos/chain/account_object.hpp
modified:   ../../libraries/chain/include/eos/chain/action_objects.hpp
modified:   ../../libraries/chain/include/eos/chain/authority.hpp
modified:   ../../libraries/chain/include/eos/chain/authority_checker.hpp
modified:   ../../libraries/chain/include/eos/chain/block.hpp
modified:   ../../libraries/chain/include/eos/chain/block_schedule.hpp
modified:   ../../libraries/chain/include/eos/chain/blockchain_configuration.hpp
modified:   ../../libraries/chain/include/eos/chain/chain_administration_interface.hpp
modified:   ../../libraries/chain/include/eos/chain/chain_controller.hpp
modified:   ../../libraries/chain/include/eos/chain/chain_initializer_interface.hpp
modified:   ../../libraries/chain/include/eos/chain/config.hpp
modified:   ../../libraries/chain/include/eos/chain/global_property_object.hpp
modified:   ../../libraries/chain/include/eos/chain/key_value_object.hpp
modified:   ../../libraries/chain/include/eos/chain/message.hpp
modified:   ../../libraries/chain/include/eos/chain/message_handling_contexts.hpp
modified:   ../../libraries/chain/include/eos/chain/permission_link_object.hpp
modified:   ../../libraries/chain/include/eos/chain/permission_object.hpp
modified:   ../../libraries/chain/include/eos/chain/producer_object.hpp
modified:   ../../libraries/chain/include/eos/chain/rate_limiting_object.hpp
modified:   ../../libraries/chain/include/eos/chain/record_functions.hpp
modified:   ../../libraries/chain/include/eos/chain/transaction.hpp
modified:   ../../libraries/chain/include/eos/chain/transaction_object.hpp
modified:   ../../libraries/chain/include/eos/chain/types.hpp
modified:   ../../libraries/chain/include/eos/chain/wasm_interface.hpp
modified:   ../../libraries/chain/message_handling_contexts.cpp
modified:   ../../libraries/chain/transaction.cpp
modified:   ../../libraries/chain/types.cpp
modified:   ../../libraries/chain/wasm_interface.cpp
modified:   ../../libraries/native_contract/eos_contract.cpp
modified:   ../../libraries/native_contract/include/eos/native_contract/balance_object.hpp
modified:   ../../libraries/native_contract/include/eos/native_contract/genesis_state.hpp
modified:   ../../libraries/native_contract/include/eos/native_contract/native_contract_chain_administrator.hpp
modified:   ../../libraries/native_contract/include/eos/native_contract/native_contract_chain_initializer.hpp
modified:   ../../libraries/native_contract/include/eos/native_contract/producer_objects.hpp
modified:   ../../libraries/native_contract/include/eos/native_contract/staked_balance_objects.hpp
modified:   ../../libraries/native_contract/native_contract_chain_administrator.cpp
modified:   ../../libraries/native_contract/native_contract_chain_initializer.cpp
modified:   ../../libraries/native_contract/producer_objects.cpp
modified:   ../../libraries/native_contract/staked_balance_objects.cpp
modified:   ../../libraries/types/CMakeLists.txt
modified:   ../../libraries/types/TypeParser.cpp
modified:   ../../libraries/types/abi_serializer.cpp
modified:   ../../libraries/types/asset.cpp
modified:   ../../libraries/types/include/eos/types/TypeParser.hpp
modified:   ../../libraries/types/include/eos/types/WrenInt.hpp
modified:   ../../libraries/types/include/eos/types/abi_serializer.hpp
modified:   ../../libraries/types/include/eos/types/asset.hpp
modified:   ../../libraries/types/include/eos/types/native.hpp
modified:   ../../libraries/types/include/eos/types/public_key.hpp
modified:   ../../libraries/types/include/eos/types/types.hpp
modified:   ../../libraries/types/native.cpp
modified:   ../../libraries/types/public_key.cpp
modified:   ../../libraries/types/type_generator.cpp
modified:   ../../libraries/types/types.eos
modified:   ../../plugins/account_history_plugin/account_history_plugin.cpp
modified:   ../../plugins/account_history_plugin/include/eos/account_history_plugin/account_control_history_object.hpp
modified:   ../../plugins/account_history_plugin/include/eos/account_history_plugin/account_history_plugin.hpp
modified:   ../../plugins/account_history_plugin/include/eos/account_history_plugin/account_transaction_history_object.hpp
modified:   ../../plugins/account_history_plugin/include/eos/account_history_plugin/public_key_history_object.hpp
modified:   ../../plugins/chain_plugin/chain_plugin.cpp
modified:   ../../plugins/chain_plugin/include/eos/chain_plugin/chain_plugin.hpp
modified:   ../../plugins/db_plugin/db_plugin.cpp
modified:   ../../plugins/net_plugin/include/eos/net_plugin/protocol.hpp
modified:   ../../plugins/net_plugin/net_plugin.cpp
modified:   ../../plugins/producer_plugin/producer_plugin.cpp
modified:   ../../plugins/wallet_api_plugin/wallet_api_plugin.cpp
modified:   ../../plugins/wallet_plugin/include/eos/wallet_plugin/wallet_manager.hpp
modified:   ../../plugins/wallet_plugin/wallet_manager.cpp
modified:   ../codegen/main.cpp
modified:   ../eosc/eosc.pot
modified:   ../eosc/help_text.cpp
modified:   ../eosc/main.cpp
modified:   ../../tests/api_tests/api_tests.cpp
modified:   ../../tests/api_tests/table_abi_test/table_abi_test.abi
modified:   ../../tests/common/database_fixture.cpp
modified:   ../../tests/common/database_fixture.hpp
modified:   ../../tests/common/macro_support.hpp
modified:   ../../tests/common/testing_macros.hpp
modified:   ../../tests/eosd_run_mongodb_test.sh
modified:   ../../tests/slow_tests/deferred_tests.cpp
modified:   ../../tests/slow_tests/slow_tests.cpp
modified:   ../../tests/tests/abi_tests.cpp
modified:   ../../tests/tests/block_schedule_tests.cpp
modified:   ../../tests/tests/block_tests.cpp
modified:   ../../tests/tests/chain_tests.cpp
modified:   ../../tests/tests/misc_tests.cpp
modified:   ../../tests/tests/native_contract_tests.cpp
modified:   ../../tests/tests/special_accounts_tests.cpp
modified:   ../../tests/tests/types_tests.cpp
modified:   ../../tests/tests/wallet_tests.cpp
modified:   ../../tests/tests/wasm_tests/wasm_tests.cpp
blockone-syncclient commented 6 years ago

➤ Kevin Heifner commented:

[~admin] The http api currently is /v1 . Since we have breaking changes to json with this issue, should we change to /v2 ? Or do you wish to stay with /v1 for June release?

blockone-syncclient commented 6 years ago

➤ David Moss commented:

[~kevin.heifner] Do you mean for December release?

blockone-syncclient commented 6 years ago

➤ Kevin Heifner commented:

For Dawn 1.0 we had /v1 for our http api. For example: /v1/chain/get_info

Renaming the abi types/attributes changes all the json. So since this is a breaking change do we want to also change the http api to be /v2. For example: /v2/chain/get_info

Or are you wanting to go live into production in June with /v3 or /v4. And use /v2 for Dec 4th, Dawn 2.0?

Since everything is still beta or alpha releases I could see staying with /v1.

blockone-syncclient commented 6 years ago

➤ David Moss commented:

[~kevin.heifner] Understood about API version changes.

For the 12/4 release, I'm in favor of making the change to /v1.1, as it is a breaking change and very few people have implemented it to date.

My concern for future releases after 12/4 is that we will have much wider adoption, so deprecating the API will have greater implications.

My overall preference for anything pre-production is to have versions like /v.01 or similar, so that when we hit production we start with /v1

Let's discuss in Scrum and add our decision in a comment here.