From f6779e5e5e7fb28e802a70332ffa39e98eae429a Mon Sep 17 00:00:00 2001 From: enumivo Date: Mon, 14 May 2018 18:14:14 +0800 Subject: [PATCH 1/3] move eosio msig --- contracts/{eosio.msig => enumivo.msig}/CMakeLists.txt | 0 contracts/{eosio.msig => enumivo.msig}/README.md | 0 contracts/{eosio.msig => enumivo.msig}/eosio.msig.abi | 0 contracts/{eosio.msig => enumivo.msig}/eosio.msig.cpp | 0 contracts/{eosio.msig => enumivo.msig}/eosio.msig.hpp | 0 5 files changed, 0 insertions(+), 0 deletions(-) rename contracts/{eosio.msig => enumivo.msig}/CMakeLists.txt (100%) rename contracts/{eosio.msig => enumivo.msig}/README.md (100%) rename contracts/{eosio.msig => enumivo.msig}/eosio.msig.abi (100%) rename contracts/{eosio.msig => enumivo.msig}/eosio.msig.cpp (100%) rename contracts/{eosio.msig => enumivo.msig}/eosio.msig.hpp (100%) diff --git a/contracts/eosio.msig/CMakeLists.txt b/contracts/enumivo.msig/CMakeLists.txt similarity index 100% rename from contracts/eosio.msig/CMakeLists.txt rename to contracts/enumivo.msig/CMakeLists.txt diff --git a/contracts/eosio.msig/README.md b/contracts/enumivo.msig/README.md similarity index 100% rename from contracts/eosio.msig/README.md rename to contracts/enumivo.msig/README.md diff --git a/contracts/eosio.msig/eosio.msig.abi b/contracts/enumivo.msig/eosio.msig.abi similarity index 100% rename from contracts/eosio.msig/eosio.msig.abi rename to contracts/enumivo.msig/eosio.msig.abi diff --git a/contracts/eosio.msig/eosio.msig.cpp b/contracts/enumivo.msig/eosio.msig.cpp similarity index 100% rename from contracts/eosio.msig/eosio.msig.cpp rename to contracts/enumivo.msig/eosio.msig.cpp diff --git a/contracts/eosio.msig/eosio.msig.hpp b/contracts/enumivo.msig/eosio.msig.hpp similarity index 100% rename from contracts/eosio.msig/eosio.msig.hpp rename to contracts/enumivo.msig/eosio.msig.hpp From 9b8164149e8372617a1747e937f252dd817e48dd Mon Sep 17 00:00:00 2001 From: enumivo Date: Mon, 14 May 2018 18:15:27 +0800 Subject: [PATCH 2/3] rename files eosio msig --- contracts/enumivo.msig/{eosio.msig.abi => enumivo.msig.abi} | 0 contracts/enumivo.msig/{eosio.msig.cpp => enumivo.msig.cpp} | 0 contracts/enumivo.msig/{eosio.msig.hpp => enumivo.msig.hpp} | 0 3 files changed, 0 insertions(+), 0 deletions(-) rename contracts/enumivo.msig/{eosio.msig.abi => enumivo.msig.abi} (100%) rename contracts/enumivo.msig/{eosio.msig.cpp => enumivo.msig.cpp} (100%) rename contracts/enumivo.msig/{eosio.msig.hpp => enumivo.msig.hpp} (100%) diff --git a/contracts/enumivo.msig/eosio.msig.abi b/contracts/enumivo.msig/enumivo.msig.abi similarity index 100% rename from contracts/enumivo.msig/eosio.msig.abi rename to contracts/enumivo.msig/enumivo.msig.abi diff --git a/contracts/enumivo.msig/eosio.msig.cpp b/contracts/enumivo.msig/enumivo.msig.cpp similarity index 100% rename from contracts/enumivo.msig/eosio.msig.cpp rename to contracts/enumivo.msig/enumivo.msig.cpp diff --git a/contracts/enumivo.msig/eosio.msig.hpp b/contracts/enumivo.msig/enumivo.msig.hpp similarity index 100% rename from contracts/enumivo.msig/eosio.msig.hpp rename to contracts/enumivo.msig/enumivo.msig.hpp From 88d45d5caf6168583e4211544dc35e88c01afe73 Mon Sep 17 00:00:00 2001 From: enumivo Date: Mon, 14 May 2018 18:17:35 +0800 Subject: [PATCH 3/3] rename instances of eosio msig --- contracts/CMakeLists.txt | 2 +- contracts/enumivo.msig/CMakeLists.txt | 2 +- contracts/enumivo.msig/README.md | 20 +++++++------- contracts/enumivo.msig/enumivo.msig.cpp | 2 +- programs/cleos/main.cpp | 18 ++++++------- tests/CMakeLists.txt | 2 +- unittests/CMakeLists.txt | 2 +- unittests/bootseq_tests.cpp | 18 ++++++------- unittests/multisig_tests.cpp | 36 ++++++++++++------------- 9 files changed, 51 insertions(+), 51 deletions(-) diff --git a/contracts/CMakeLists.txt b/contracts/CMakeLists.txt index b8afc3bc284..070f9966cb0 100644 --- a/contracts/CMakeLists.txt +++ b/contracts/CMakeLists.txt @@ -9,7 +9,7 @@ add_subdirectory(musl) add_subdirectory(libc++) add_subdirectory(simple.token) add_subdirectory(eosio.token) -add_subdirectory(eosio.msig) +add_subdirectory(enumivo.msig) add_subdirectory(multi_index_test) add_subdirectory(eosio.system) add_subdirectory(identity) diff --git a/contracts/enumivo.msig/CMakeLists.txt b/contracts/enumivo.msig/CMakeLists.txt index c7c8a7ddf70..3ed176228cd 100644 --- a/contracts/enumivo.msig/CMakeLists.txt +++ b/contracts/enumivo.msig/CMakeLists.txt @@ -2,7 +2,7 @@ file(GLOB ABI_FILES "*.abi") configure_file("${ABI_FILES}" "${CMAKE_CURRENT_BINARY_DIR}" COPYONLY) -add_wast_executable(TARGET eosio.msig +add_wast_executable(TARGET enumivo.msig INCLUDE_FOLDERS "${STANDARD_INCLUDE_FOLDERS}" LIBRARIES libc++ libc enumivolib DESTINATION_FOLDER ${CMAKE_CURRENT_BINARY_DIR} diff --git a/contracts/enumivo.msig/README.md b/contracts/enumivo.msig/README.md index a1b839d553b..a88b5e7e6dc 100644 --- a/contracts/enumivo.msig/README.md +++ b/contracts/enumivo.msig/README.md @@ -1,11 +1,11 @@ -eosio.msig +enumivo.msig -------- Actions: The naming convention is codeaccount::actionname followed by a list of paramters. Create a proposal -## eosio.msig::propose proposer proposal_name requested trx +## enumivo.msig::propose proposer proposal_name requested trx - **proposer** account proposing a transaction - **proposal_name** name of the proposal (should be unique for proposer) - **requested** permission levels expected to approve the proposal @@ -14,7 +14,7 @@ Create a proposal Storage changes are billed to 'proposer' Aprrove a proposal -## eosio.msig::approve proposer proposal_name level +## enumivo.msig::approve proposer proposal_name level - **proposer** account proposing a transaction - **proposal_name** name of the proposal - **level** permission level approving the transaction @@ -22,7 +22,7 @@ Aprrove a proposal Storage changes are billed to 'proposer' Revoke an approval of transaction -## eosio.msig::unapprove proposer proposal_name level +## enumivo.msig::unapprove proposer proposal_name level - **proposer** account proposing a transaction - **proposal_name** name of the proposal - **level** permission level revoking approval from the transaction @@ -30,13 +30,13 @@ Revoke an approval of transaction Storage changes are billed to 'proposer' Cancel a proposal -## eosio.msig::cancel proposer proposal_name canceler +## enumivo.msig::cancel proposer proposal_name canceler - **proposer** account proposing a transaction - **proposal_name** name of the proposal - **canceler** account canceling the transaction (only proposer can cancel not expired transaction) Execute a proposal -## eosio.msig::exec proposer proposal_name executer +## enumivo.msig::exec proposer proposal_name executer - **proposer** account proposing a transaction - **proposal_name** name of the proposal - **executer** account executing the transaction @@ -45,7 +45,7 @@ Execute a proposal Cleos usage example. Prerequisites: - - eosio.token contract installed to eosio.token accountm, eosio.msig contract installed on eosio.msig account which is a priviliged account. + - eosio.token contract installed to eosio.token accountm, enumivo.msig contract installed on enumivo.msig account which is a priviliged account. - account 'treasury' is the issuer of EOS token. - account 'tester' exists. - keys to accounts 'treasury' and 'tester' imported into local wallet, the wallet is unlocked. @@ -54,7 +54,7 @@ One user creates a proposal: ```` $ cleos multisig propose test '[{"actor": "treasury", "permission": "active"}]' '[{"actor": "treasury", "permission": "active"}]' eosio.token issue '{"to": "tester", "quantity": "1000.0000 EOS", "memo": ""}' -p tester executed transaction: e26f3a3a7cba524a7b15a0b6c77c7daa73d3ba9bf84e83f9c2cdf27fcb183d61 336 bytes 107520 cycles -# eosio.msig <= eosio.msig::propose {"proposer":"tester","proposal_name":"test","requested":[{"actor":"treasury","permission":"active"}]... +# enumivo.msig <= enumivo.msig::propose {"proposer":"tester","proposal_name":"test","requested":[{"actor":"treasury","permission":"active"}]... ```` Another user reviews the transaction: @@ -102,12 +102,12 @@ And then approves it: ```` $ cleos multisig approve tester test '{"actor": "treasury", "permission": "active"}' -p treasury executed transaction: 475970a4b0016368d0503d1ce01577376f91f5a5ba63dd4353683bd95101b88d 256 bytes 108544 cycles -# eosio.msig <= eosio.msig::approve {"proposer":"tester","proposal_name":"test","level":{"actor":"treasury","permission":"active"}} +# enumivo.msig <= enumivo.msig::approve {"proposer":"tester","proposal_name":"test","level":{"actor":"treasury","permission":"active"}} ```` First user initiates execution: ```` $ cleos multisig exec tester test -p tester executed transaction: 64e5eaceb77362694055f572ae35876111e87b637a55250de315b1b55e56d6c2 248 bytes 109568 cycles -# eosio.msig <= eosio.msig::exec {"proposer":"tester","proposal_name":"test","executer":"tester"} +# enumivo.msig <= enumivo.msig::exec {"proposer":"tester","proposal_name":"test","executer":"tester"} ```` diff --git a/contracts/enumivo.msig/enumivo.msig.cpp b/contracts/enumivo.msig/enumivo.msig.cpp index 298b24e374d..59d71c5fd63 100644 --- a/contracts/enumivo.msig/enumivo.msig.cpp +++ b/contracts/enumivo.msig/enumivo.msig.cpp @@ -1,4 +1,4 @@ -#include +#include #include #include diff --git a/programs/cleos/main.cpp b/programs/cleos/main.cpp index 9e00a3c81d6..b2a8ac11545 100644 --- a/programs/cleos/main.cpp +++ b/programs/cleos/main.cpp @@ -2134,7 +2134,7 @@ int main( int argc, char** argv ) { fc::to_variant(trx, trx_var); arg = fc::mutable_variant_object() - ("code", "eosio.msig") + ("code", "enumivo.msig") ("action", "propose") ("args", fc::mutable_variant_object() ("proposer", proposer ) @@ -2143,7 +2143,7 @@ int main( int argc, char** argv ) { ("trx", trx_var) ); result = call(json_to_bin_func, arg); - send_actions({chain::action{accountPermissions, "eosio.msig", "propose", result.get_object()["binargs"].as()}}); + send_actions({chain::action{accountPermissions, "enumivo.msig", "propose", result.get_object()["binargs"].as()}}); }); //resolver for ABI serializer to decode actions in proposed transaction in multisig contract @@ -2166,7 +2166,7 @@ int main( int argc, char** argv ) { review->set_callback([&] { auto result = call(get_table_func, fc::mutable_variant_object("json", true) - ("code", "eosio.msig") + ("code", "enumivo.msig") ("scope", proposer) ("table", "proposal") ("table_key", "") @@ -2206,7 +2206,7 @@ int main( int argc, char** argv ) { perm_var = json_from_file_or_string(perm); } EOS_RETHROW_EXCEPTIONS(transaction_type_exception, "Fail to parse permissions JSON '${data}'", ("data",perm)) auto arg = fc::mutable_variant_object() - ("code", "eosio.msig") + ("code", "enumivo.msig") ("action", action) ("args", fc::mutable_variant_object() ("proposer", proposer) @@ -2215,7 +2215,7 @@ int main( int argc, char** argv ) { ); auto result = call(json_to_bin_func, arg); auto accountPermissions = tx_permission.empty() ? vector{{sender,config::active_name}} : get_account_permissions(tx_permission); - send_actions({chain::action{accountPermissions, "eosio.msig", action, result.get_object()["binargs"].as()}}); + send_actions({chain::action{accountPermissions, "enumivo.msig", action, result.get_object()["binargs"].as()}}); }; // multisig approve @@ -2254,7 +2254,7 @@ int main( int argc, char** argv ) { canceler = name(accountPermissions.at(0).actor).to_string(); } auto arg = fc::mutable_variant_object() - ("code", "eosio.msig") + ("code", "enumivo.msig") ("action", "cancel") ("args", fc::mutable_variant_object() ("proposer", proposer) @@ -2262,7 +2262,7 @@ int main( int argc, char** argv ) { ("canceler", canceler) ); auto result = call(json_to_bin_func, arg); - send_actions({chain::action{accountPermissions, "eosio.msig", "cancel", result.get_object()["binargs"].as()}}); + send_actions({chain::action{accountPermissions, "enumivo.msig", "cancel", result.get_object()["binargs"].as()}}); } ); @@ -2287,7 +2287,7 @@ int main( int argc, char** argv ) { } auto arg = fc::mutable_variant_object() - ("code", "eosio.msig") + ("code", "enumivo.msig") ("action", "exec") ("args", fc::mutable_variant_object() ("proposer", proposer ) @@ -2296,7 +2296,7 @@ int main( int argc, char** argv ) { ); auto result = call(json_to_bin_func, arg); //std::cout << "Result: " << result << std::endl; - send_actions({chain::action{accountPermissions, "eosio.msig", "exec", result.get_object()["binargs"].as()}}); + send_actions({chain::action{accountPermissions, "enumivo.msig", "exec", result.get_object()["binargs"].as()}}); } ); diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 08ca71b5f5a..3f81ff69ba0 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -21,7 +21,7 @@ add_executable( plugin_test ${UNIT_TESTS} ${WASM_UNIT_TESTS} main.cpp) target_link_libraries( plugin_test eosio_testing eosio_chain chainbase eos_utilities chain_plugin wallet_plugin abi_generator fc ${PLATFORM_SPECIFIC_LIBS} ) target_include_directories( plugin_test PUBLIC ${CMAKE_SOURCE_DIR}/plugins/net_plugin/include ) -add_dependencies(plugin_test asserter test_api test_api_mem test_api_db test_api_multi_index exchange proxy identity identity_test stltest infinite eosio.system eosio.token enumivo.bios test.inline multi_index_test noop dice eosio.msig) +add_dependencies(plugin_test asserter test_api test_api_mem test_api_db test_api_multi_index exchange proxy identity identity_test stltest infinite eosio.system eosio.token enumivo.bios test.inline multi_index_test noop dice enumivo.msig) # configure_file(${CMAKE_CURRENT_SOURCE_DIR}/p2p_tests/sync/test.sh ${CMAKE_CURRENT_BINARY_DIR}/p2p_tests/sync/test.sh COPYONLY) diff --git a/unittests/CMakeLists.txt b/unittests/CMakeLists.txt index 1d1a1494d1d..2ea563ea40a 100644 --- a/unittests/CMakeLists.txt +++ b/unittests/CMakeLists.txt @@ -27,7 +27,7 @@ target_link_libraries( unit_test eosio_chain chainbase eosio_testing eos_utiliti target_include_directories( unit_test PUBLIC ${CMAKE_BINARY_DIR}/contracts ${CMAKE_CURRENT_BINARY_DIR}/tests/contracts ) target_include_directories( unit_test PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/wasm_tests ) target_include_directories( unit_test PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include ) -add_dependencies(unit_test asserter test_api test_api_mem test_api_db test_api_multi_index exchange eosio.token proxy identity identity_test stltest infinite eosio.system eosio.token enumivo.bios test.inline multi_index_test noop dice eosio.msig payloadless tic_tac_toe) +add_dependencies(unit_test asserter test_api test_api_mem test_api_db test_api_multi_index exchange eosio.token proxy identity identity_test stltest infinite eosio.system eosio.token enumivo.bios test.inline multi_index_test noop dice enumivo.msig payloadless tic_tac_toe) #Manually run unit_test for all supported runtimes #To run unit_test with all log from blockchain displayed, put --verbose after --, i.e. unit_test -- --verbose diff --git a/unittests/bootseq_tests.cpp b/unittests/bootseq_tests.cpp index c452caeda04..2e2b15f6758 100644 --- a/unittests/bootseq_tests.cpp +++ b/unittests/bootseq_tests.cpp @@ -9,8 +9,8 @@ #include #include #include -#include -#include +#include +#include #include @@ -171,9 +171,9 @@ BOOST_FIXTURE_TEST_CASE( bootseq_test, bootseq_tester ) { //set_code_abi(config::system_account_name, enumivo_bios_wast, enumivo_bios_abi); // Create the following accounts: - // eosio.msig + // enumivo.msig // eosio.token - create_accounts({N(eosio.msig), N(eosio.token)}); + create_accounts({N(enumivo.msig), N(eosio.token)}); /* auto eosio_active = authority( 1, {}, {{{N(eosio),N(active)},1}} ); auto eosio_active_pk = get_private_key( N(eosio), "active" ); @@ -181,7 +181,7 @@ BOOST_FIXTURE_TEST_CASE( bootseq_test, bootseq_tester ) { base_tester::push_action( N(eosio), N(newaccount), vector{{N(eosio),config::active_name}}, fc::variant(newaccount{ .creator = N(eosio), - .name = N(eosio.msig), + .name = N(enumivo.msig), .owner = eosio_active, .active = eosio_active, .recovery = eosio_active @@ -199,16 +199,16 @@ BOOST_FIXTURE_TEST_CASE( bootseq_test, bootseq_tester ) { // Set code for the following accounts: // eosio.system (code: enumivo.bios) - // eosio.msig (code: eosio.msig) + // enumivo.msig (code: enumivo.msig) // eosio.token (code: eosio.token) - set_code_abi(N(eosio.msig), eosio_msig_wast, eosio_msig_abi);//, &eosio_active_pk); + set_code_abi(N(enumivo.msig), enumivo_msig_wast, enumivo_msig_abi);//, &eosio_active_pk); set_code_abi(N(eosio.token), eosio_token_wast, eosio_token_abi); //, &eosio_active_pk); ilog("."); - // Set privileges for eosio.msig + // Set privileges for enumivo.msig auto trace = base_tester::push_action(config::system_account_name, N(setpriv), config::system_account_name, mutable_variant_object() - ("account", "eosio.msig") + ("account", "enumivo.msig") ("is_priv", 1) ); diff --git a/unittests/multisig_tests.cpp b/unittests/multisig_tests.cpp index 4f483b61eaa..b62f5d84df7 100644 --- a/unittests/multisig_tests.cpp +++ b/unittests/multisig_tests.cpp @@ -3,8 +3,8 @@ #include #include -#include -#include +#include +#include #include #include @@ -21,24 +21,24 @@ using namespace fc; using mvo = fc::mutable_variant_object; -class eosio_msig_tester : public tester { +class enumivo_msig_tester : public tester { public: - eosio_msig_tester() { - create_accounts( { N(eosio.msig), N(alice), N(bob), N(carol) } ); + enumivo_msig_tester() { + create_accounts( { N(enumivo.msig), N(alice), N(bob), N(carol) } ); produce_block(); auto trace = base_tester::push_action(config::system_account_name, N(setpriv), config::system_account_name, mutable_variant_object() - ("account", "eosio.msig") + ("account", "enumivo.msig") ("is_priv", 1) ); - set_code( N(eosio.msig), eosio_msig_wast ); - set_abi( N(eosio.msig), eosio_msig_abi ); + set_code( N(enumivo.msig), enumivo_msig_wast ); + set_abi( N(enumivo.msig), enumivo_msig_abi ); produce_blocks(); - const auto& accnt = control->db().get( N(eosio.msig) ); + const auto& accnt = control->db().get( N(enumivo.msig) ); abi_def abi; BOOST_REQUIRE_EQUAL(abi_serializer::to_abi(accnt.abi, abi), true); abi_ser.set_abi(abi); @@ -48,7 +48,7 @@ class eosio_msig_tester : public tester { vector accounts; if( auth ) accounts.push_back( signer ); - auto trace = base_tester::push_action( N(eosio.msig), name, accounts, data ); + auto trace = base_tester::push_action( N(enumivo.msig), name, accounts, data ); produce_block(); BOOST_REQUIRE_EQUAL( true, chain_has_transaction(trace->id) ); return trace; @@ -57,7 +57,7 @@ class eosio_msig_tester : public tester { string action_type_name = abi_ser.get_action_type(name); action act; - act.account = N(eosio.msig); + act.account = N(enumivo.msig); act.name = name; act.data = abi_ser.variant_to_binary( action_type_name, data ); //std::cout << "test:\n" << fc::to_hex(act.data.data(), act.data.size()) << " size = " << act.data.size() << std::endl; @@ -71,7 +71,7 @@ class eosio_msig_tester : public tester { abi_serializer abi_ser; }; -transaction eosio_msig_tester::reqauth( account_name from, const vector& auths ) { +transaction enumivo_msig_tester::reqauth( account_name from, const vector& auths ) { fc::variants v; for ( auto& level : auths ) { v.push_back(fc::mutable_variant_object() @@ -99,9 +99,9 @@ transaction eosio_msig_tester::reqauth( account_name from, const vector{ { N(alice), config::active_name }, { N(bob), config::active_name } } ); push_action( N(alice), N(propose), mvo() ("proposer", "alice") @@ -224,7 +224,7 @@ BOOST_FIXTURE_TEST_CASE( propose_approve_by_two, eosio_msig_tester ) try { } FC_LOG_AND_RETHROW() -BOOST_FIXTURE_TEST_CASE( propose_with_wrong_requested_auth, eosio_msig_tester ) try { +BOOST_FIXTURE_TEST_CASE( propose_with_wrong_requested_auth, enumivo_msig_tester ) try { auto trx = reqauth("alice", vector{ { N(alice), config::active_name }, { N(bob), config::active_name } } ); //try with not enough requested auth BOOST_REQUIRE_EXCEPTION( push_action( N(alice), N(propose), mvo() @@ -240,7 +240,7 @@ BOOST_FIXTURE_TEST_CASE( propose_with_wrong_requested_auth, eosio_msig_tester ) } FC_LOG_AND_RETHROW() -BOOST_FIXTURE_TEST_CASE( big_transaction, eosio_msig_tester ) try { +BOOST_FIXTURE_TEST_CASE( big_transaction, enumivo_msig_tester ) try { vector perm = { { N(alice), config::active_name }, { N(bob), config::active_name } }; auto wasm = wast_to_wasm( exchange_wast );