From 6ff219e3f23d85b464d96236d1cbd2ecd0079428 Mon Sep 17 00:00:00 2001 From: Kevin Heifner Date: Tue, 29 Aug 2017 12:47:10 -0500 Subject: [PATCH] Revert "Merge pull request #249 from EOSIO/memo-248" This reverts commit 438bd69449fd29c2bae142a815c73befda1d5139, reversing changes made to 5ce0054e0042ded4e6c5174e4a76d1048f061ad2. --- libraries/chain/chain_controller.cpp | 10 +--------- .../native_contract_chain_initializer.cpp | 2 +- libraries/types/types.eos | 2 -- tests/common/macro_support.hpp | 2 +- tests/slow_tests/slow_tests.cpp | 8 ++++---- tests/tests/native_contract_tests.cpp | 2 +- 6 files changed, 8 insertions(+), 18 deletions(-) diff --git a/libraries/chain/chain_controller.cpp b/libraries/chain/chain_controller.cpp index 4a0e2754167..3bdc5439422 100644 --- a/libraries/chain/chain_controller.cpp +++ b/libraries/chain/chain_controller.cpp @@ -742,17 +742,9 @@ void chain_controller::check_transaction_authorization(const SignedTransaction& } void chain_controller::validate_scope( const Transaction& trx )const { - EOS_ASSERT(trx.scope.size() + trx.readscope.size() > 0, transaction_exception, "No scope specified by transaction" ); + EOS_ASSERT(trx.scope.size() > 0, transaction_exception, "No scope specified by transaction" ); for( uint32_t i = 1; i < trx.scope.size(); ++i ) EOS_ASSERT( trx.scope[i-1] < trx.scope[i], transaction_exception, "Scopes must be sorted and unique" ); - for( uint32_t i = 1; i < trx.readscope.size(); ++i ) - EOS_ASSERT( trx.readscope[i-1] < trx.readscope[i], transaction_exception, "Scopes must be sorted and unique" ); - - vector intersection; - std::set_intersection( trx.scope.begin(), trx.scope.end(), - trx.readscope.begin(), trx.readscope.end(), - std::back_inserter(intersection) ); - FC_ASSERT( intersection.size() == 0, "a transaction may not redeclare scope in readscope" ); } const permission_object& chain_controller::lookup_minimum_permission(types::AccountName authorizer_account, diff --git a/libraries/native_contract/native_contract_chain_initializer.cpp b/libraries/native_contract/native_contract_chain_initializer.cpp index b563c60138d..81621e9ba0c 100644 --- a/libraries/native_contract/native_contract_chain_initializer.cpp +++ b/libraries/native_contract/native_contract_chain_initializer.cpp @@ -102,7 +102,7 @@ std::vector native_contract_chain_initializer::prepare_database( message = chain::Message(config::EosContractName, vector{{config::EosContractName, "active"}}, "transfer", types::transfer(config::EosContractName, acct.name, - acct.liquid_balance.amount, "Genesis Allocation")); + acct.liquid_balance.amount/*, "Genesis Allocation"*/)); messages_to_process.emplace_back(std::move(message)); } } diff --git a/libraries/types/types.eos b/libraries/types/types.eos index 7434a0fd4ef..e9ab6d370c0 100644 --- a/libraries/types/types.eos +++ b/libraries/types/types.eos @@ -25,7 +25,6 @@ struct Transaction refBlockPrefix UInt32 expiration Time scope AccountName[] # the data may be accessed while processing this transaction - readscope AccountName[] messages Message[] struct SignedTransaction inherits Transaction @@ -72,7 +71,6 @@ struct transfer from AccountName # may not be the message.sender if message.sender has delegated authority by from to AccountName amount UInt64 - memo String struct lock from AccountName diff --git a/tests/common/macro_support.hpp b/tests/common/macro_support.hpp index 88d229f0797..39488e7b1ba 100644 --- a/tests/common/macro_support.hpp +++ b/tests/common/macro_support.hpp @@ -135,7 +135,7 @@ inline std::vector sort_names( std::vector&& names ) { trx.scope = sort_names({#sender,#recipient}); \ transaction_emplace_message(trx, config::EosContractName, \ vector{ {#sender,"active"} }, \ - "transfer", types::transfer{#sender, #recipient, Amount.amount, memo}); \ + "transfer", types::transfer{#sender, #recipient, Amount.amount}); \ trx.expiration = chain.head_block_time() + 100; \ transaction_set_reference_block(trx, chain.head_block_id()); \ chain.push_transaction(trx); \ diff --git a/tests/slow_tests/slow_tests.cpp b/tests/slow_tests/slow_tests.cpp index 16a305f8c9e..0f6162d1620 100644 --- a/tests/slow_tests/slow_tests.cpp +++ b/tests/slow_tests/slow_tests.cpp @@ -311,7 +311,7 @@ void TransferCurrency( testing_blockchain& chain, AccountName from, AccountName trx.scope = sort_names({from,to}); transaction_emplace_message(trx, "currency", vector{ {from,"active"} }, - "transfer", types::transfer{from, to, amount,""}); + "transfer", types::transfer{from, to, amount}); trx.expiration = chain.head_block_time() + 100; transaction_set_reference_block(trx, chain.head_block_id()); @@ -324,7 +324,7 @@ void WithdrawCurrency( testing_blockchain& chain, AccountName from, AccountName trx.scope = sort_names({from,to}); transaction_emplace_message(trx, "currency", vector{ {from,"active"},{to,"active"} }, - "transfer", types::transfer{from, to, amount,""}); + "transfer", types::transfer{from, to, amount}); trx.expiration = chain.head_block_time() + 100; transaction_set_reference_block(trx, chain.head_block_id()); chain.push_transaction(trx); @@ -367,7 +367,7 @@ BOOST_FIXTURE_TEST_CASE(create_script, testing_fixture) trx.scope = sort_names({"currency","inita"}); transaction_emplace_message(trx, "currency", vector{ {"currency","active"} }, - "transfer", types::transfer{"currency", "inita", 1+i,""}); + "transfer", types::transfer{"currency", "inita", 1+i}); trx.expiration = chain.head_block_time() + 100; transaction_set_reference_block(trx, chain.head_block_id()); //idump((trx)); @@ -1167,7 +1167,7 @@ BOOST_FIXTURE_TEST_CASE(create_script_w_loop, testing_fixture) trx.scope = sort_names({"currency","inita"}); transaction_emplace_message(trx, "currency", vector{ {"currency","active"} }, - "transfer", types::transfer{"currency", "inita", 1,""}); + "transfer", types::transfer{"currency", "inita", 1}); trx.expiration = chain.head_block_time() + 100; transaction_set_reference_block(trx, chain.head_block_id()); try diff --git a/tests/tests/native_contract_tests.cpp b/tests/tests/native_contract_tests.cpp index 35069c77623..4c29b0fb278 100644 --- a/tests/tests/native_contract_tests.cpp +++ b/tests/tests/native_contract_tests.cpp @@ -96,7 +96,7 @@ BOOST_FIXTURE_TEST_CASE(transfer, testing_fixture) trx.expiration = chain.head_block_time() + 100; trx.scope = sort_names( {"inita", "initb"} ); - types::transfer trans = { "inita", "initb", (100), "" }; + types::transfer trans = { "inita", "initb", (100) }; UInt64 value(5); auto packed = fc::raw::pack(value);