Skip to content

Commit

Permalink
Merge branch 'dev_master' into testnet
Browse files Browse the repository at this point in the history
  • Loading branch information
zuuluuz committed Nov 30, 2018
2 parents 545ecc2 + b9304b3 commit 5068f14
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
8 changes: 8 additions & 0 deletions libraries/app/database_api_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1283,6 +1283,12 @@ vector< fc::variant > database_api_impl::get_required_fees( const vector<operati
return result;
}


transaction trx;
for( operation& op : _ops )
trx.operations.push_back(op);
_db.set_cur_trx(&trx);

for( operation& op : _ops )
{
if (op.which() == operation::tag<contract_call_operation>::value) {
Expand Down Expand Up @@ -1327,6 +1333,8 @@ vector< fc::variant > database_api_impl::get_required_fees( const vector<operati
result.push_back(helper.set_op_fees(op));
}
}

_db.set_cur_trx(nullptr);
return result;
}

Expand Down
3 changes: 2 additions & 1 deletion libraries/chain/wasm_interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1083,7 +1083,7 @@ class context_free_transaction_api : public context_aware_api {
int read_transaction(array_ptr<char> data, size_t buffer_size)
{
const transaction* cur_trx = context.db().get_cur_trx();
FC_ASSERT(nullptr != cur_trx, "cur_trx is null");
FC_ASSERT(nullptr != cur_trx, "current transaction not set");
bytes trx = fc::raw::pack(*cur_trx);

auto s = trx.size();
Expand All @@ -1097,6 +1097,7 @@ class context_free_transaction_api : public context_aware_api {

int transaction_size() {
const transaction* trx = context.db().get_cur_trx();
FC_ASSERT(nullptr != trx, "current transaction not set");
return fc::raw::pack(*trx).size();
}

Expand Down

0 comments on commit 5068f14

Please sign in to comment.