Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Commit

Permalink
Revert "Merge pull request #249 from EOSIO/memo-248"
Browse files Browse the repository at this point in the history
This reverts commit 438bd69, reversing
changes made to 5ce0054.
  • Loading branch information
heifner committed Aug 29, 2017
1 parent 7e4125d commit 6ff219e
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 18 deletions.
10 changes: 1 addition & 9 deletions libraries/chain/chain_controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<types::AccountName> 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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ std::vector<chain::Message> native_contract_chain_initializer::prepare_database(
message = chain::Message(config::EosContractName,
vector<types::AccountPermission>{{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));
}
}
Expand Down
2 changes: 0 additions & 2 deletions libraries/types/types.eos
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/common/macro_support.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ inline std::vector<Name> sort_names( std::vector<Name>&& names ) {
trx.scope = sort_names({#sender,#recipient}); \
transaction_emplace_message(trx, config::EosContractName, \
vector<types::AccountPermission>{ {#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); \
Expand Down
8 changes: 4 additions & 4 deletions tests/slow_tests/slow_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ void TransferCurrency( testing_blockchain& chain, AccountName from, AccountName
trx.scope = sort_names({from,to});
transaction_emplace_message(trx, "currency",
vector<types::AccountPermission>{ {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());
Expand All @@ -324,7 +324,7 @@ void WithdrawCurrency( testing_blockchain& chain, AccountName from, AccountName
trx.scope = sort_names({from,to});
transaction_emplace_message(trx, "currency",
vector<types::AccountPermission>{ {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);
Expand Down Expand Up @@ -367,7 +367,7 @@ BOOST_FIXTURE_TEST_CASE(create_script, testing_fixture)
trx.scope = sort_names({"currency","inita"});
transaction_emplace_message(trx, "currency",
vector<types::AccountPermission>{ {"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));
Expand Down Expand Up @@ -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<types::AccountPermission>{ {"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
Expand Down
2 changes: 1 addition & 1 deletion tests/tests/native_contract_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 6ff219e

Please sign in to comment.