Skip to content

Commit

Permalink
Encapsulate use of action_digests_t better.
Browse files Browse the repository at this point in the history
  • Loading branch information
greg7mdp committed Mar 22, 2024
1 parent 493b7e1 commit 26f72bd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
5 changes: 1 addition & 4 deletions libraries/chain/apply_context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -186,10 +186,7 @@ void apply_context::exec_one()

finalize_trace( trace, start );

if (trx_context.executed_action_receipts.digests_l)
trx_context.executed_action_receipts.digests_l->emplace_back( trace.digest_legacy() );
if (trx_context.executed_action_receipts.digests_s)
trx_context.executed_action_receipts.digests_s->emplace_back( trace.digest_savanna() );
trx_context.executed_action_receipts.compute_and_append_digests_from(trace);

if ( control.contracts_console() ) {
print_debug(receiver, trace);
Expand Down
7 changes: 7 additions & 0 deletions libraries/chain/include/eosio/chain/transaction_context.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,13 @@ namespace eosio { namespace chain {
fc::move_append(*digests_s, std::move(*o.digests_s));
}

void compute_and_append_digests_from(action_trace& trace) {
if (digests_l)
digests_l->emplace_back(trace.digest_legacy());
if (digests_s)
digests_s->emplace_back(trace.digest_savanna());
}

store_which_t store_which() const {
if (digests_l && digests_s)
return store_which_t::both;
Expand Down

0 comments on commit 26f72bd

Please sign in to comment.