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

Commit

Permalink
Change push_transaction in param to variant to allow json
Browse files Browse the repository at this point in the history
  • Loading branch information
heifner committed Aug 29, 2017
1 parent 71441fe commit 7e4125d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions plugins/chain_plugin/chain_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -263,9 +263,10 @@ read_write::push_block_results read_write::push_block(const read_write::push_blo
}

read_write::push_transaction_results read_write::push_transaction(const read_write::push_transaction_params& params) {
auto ptrx = db.push_transaction(params, skip_flags);
auto pretty_input = db.transaction_from_variant( params );
auto ptrx = db.push_transaction(pretty_input, skip_flags);
auto pretty_trx = db.transaction_to_variant( ptrx );
return read_write::push_transaction_results{ params.id(), pretty_trx };
return read_write::push_transaction_results{ pretty_input.id(), pretty_trx };
}

read_only::get_account_results read_only::get_account( const get_account_params& params )const {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,8 @@ class read_write {
using push_block_results = empty;
push_block_results push_block(const push_block_params& params);

using push_transaction_params = chain::SignedTransaction;
// fc::variant_object instead of chain::SignedTransaction so that SignedTransaction.messages.data can be json
using push_transaction_params = fc::variant_object;
struct push_transaction_results {
chain::transaction_id_type transaction_id;
fc::variant processed;
Expand Down

0 comments on commit 7e4125d

Please sign in to comment.