Skip to content

Commit

Permalink
change msig execute to inline action
Browse files Browse the repository at this point in the history
  • Loading branch information
quyvo committed Jun 1, 2020
1 parent 28ec1f3 commit 87c80d6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"files.associations": {
"chrono": "cpp"
"chrono": "cpp",
"tuple": "cpp"
}
}
11 changes: 6 additions & 5 deletions contracts/eosio.msig/src/eosio.msig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,10 @@ void multisig::exec( name proposer, name proposal_name, name executer ) {

proposals proptable( get_self(), proposer.value );
auto& prop = proptable.get( proposal_name.value, "proposal not found" );
transaction_header trx_header;
transaction trx;
datastream<const char*> ds( prop.packed_transaction.data(), prop.packed_transaction.size() );
ds >> trx_header;
check( trx_header.expiration >= eosio::time_point_sec(current_time_point()), "transaction expired" );
ds >> trx;
check( trx.expiration >= eosio::time_point_sec(current_time_point()), "transaction expired" );

approvals apptable( get_self(), proposer.value );
auto apps_it = apptable.find( proposal_name.value );
Expand Down Expand Up @@ -180,8 +180,9 @@ void multisig::exec( name proposer, name proposal_name, name executer ) {
);
check( res > 0, "transaction authorization failed" );

send_deferred( (uint128_t(proposer.value) << 64) | proposal_name.value, executer,
prop.packed_transaction.data(), prop.packed_transaction.size() );
for ( auto action: trx.actions ) {
action.send();
}

proptable.erase(prop);
}
Expand Down

0 comments on commit 87c80d6

Please sign in to comment.