From 29900df721a9955391398a71a7a65431ab9d54f7 Mon Sep 17 00:00:00 2001 From: Michael Vandeberg Date: Wed, 27 Dec 2017 17:35:26 -0800 Subject: [PATCH] Explictly use signature canonization and accept BIP-0062 canonization after HF20 #1944 --- libraries/chain/database.cpp | 12 +- libraries/fc | 2 +- libraries/net/node.cpp | 8 +- .../plugins/block_api/block_api_objects.hpp | 2 +- .../apis/database_api/database_api.cpp | 11 +- .../database_api/database_api_objects.hpp | 2 +- libraries/protocol/block.cpp | 12 +- libraries/protocol/hardfork.d/0_20.hf | 1 + .../include/steem/protocol/block_header.hpp | 6 +- .../include/steem/protocol/transaction.hpp | 20 +- libraries/protocol/steem_operations.cpp | 12 +- libraries/protocol/transaction.cpp | 29 +- libraries/wallet/wallet.cpp | 5 +- tests/db_fixture/database_fixture.cpp | 10 +- tests/db_fixture/database_fixture.hpp | 1 + tests/plugin_tests/market_history.cpp | 10 +- tests/tests/block_tests.cpp | 32 +- tests/tests/operation_tests.cpp | 772 +++++++++--------- tests/tests/operation_time_tests.cpp | 168 ++-- tests/tests/smt_tests.cpp | 16 +- 20 files changed, 575 insertions(+), 556 deletions(-) diff --git a/libraries/chain/database.cpp b/libraries/chain/database.cpp index dd14b7feb2..7cd029f4a9 100644 --- a/libraries/chain/database.cpp +++ b/libraries/chain/database.cpp @@ -2924,7 +2924,8 @@ void database::_apply_transaction(const signed_transaction& trx) try { - trx.verify_authority( chain_id, get_active, get_owner, get_posting, STEEM_MAX_SIG_CHECK_DEPTH ); + trx.verify_authority( chain_id, get_active, get_owner, get_posting, STEEM_MAX_SIG_CHECK_DEPTH, + has_hardfork( STEEM_HARDFORK_0_20__1944 ) ? fc::ecc::bip_0062 : fc::ecc::fc_canonical ); } catch( protocol::tx_missing_active_auth& e ) { @@ -2994,7 +2995,8 @@ const witness_object& database::validate_block_header( uint32_t skip, const sign const witness_object& witness = get_witness( next_block.witness ); if( !(skip&skip_witness_signature) ) - FC_ASSERT( next_block.validate_signee( witness.signing_key ) ); + FC_ASSERT( next_block.validate_signee( witness.signing_key, + has_hardfork( STEEM_HARDFORK_0_20__1944 ) ? fc::ecc::canonical_signature_type::bip_0062 : fc::ecc::canonical_signature_type::fc_canonical ) ); if( !(skip&skip_witness_schedule_check) ) { @@ -4339,15 +4341,15 @@ void database::validate_smt_invariants()const const auto& rewards_balance_idx = get_index< account_rewards_balance_index, by_id >(); add_from_balance_index( rewards_balance_idx, theMap ); - // - Total vesting + // - Total vesting #pragma message( "TODO: Add SMT vesting support here once it is implemented." ) - + // - Market orders #pragma message( "TODO: Add limit_order_object iteration here once they support SMTs." ) // - Reward funds #pragma message( "TODO: Add reward_fund_object iteration here once they support SMTs." ) - + // - Escrow & savings - no support of SMT is expected. // Do the verification of total balances. diff --git a/libraries/fc b/libraries/fc index fb80505f6f..f142ad79e8 160000 --- a/libraries/fc +++ b/libraries/fc @@ -1 +1 @@ -Subproject commit fb80505f6fd213f97f48101c044554cbe7497b57 +Subproject commit f142ad79e8f470efff82f9d382ea8edb053b98bd diff --git a/libraries/net/node.cpp b/libraries/net/node.cpp index 222b57c761..f031a88c2e 100644 --- a/libraries/net/node.cpp +++ b/libraries/net/node.cpp @@ -1425,8 +1425,8 @@ namespace graphene { namespace net { namespace detail { wlog( "Sending a keepalive message to peer ${peer} who hasn't sent us any messages in the last ${timeout} seconds", ( "peer", active_peer->get_remote_endpoint() )("timeout", active_send_keepalive_timeout ) ); peers_to_send_keep_alive.push_back(active_peer); - } - else if (active_peer->we_need_sync_items_from_peer && + } + else if (active_peer->we_need_sync_items_from_peer && !active_peer->is_currently_handling_message() && !active_peer->item_ids_requested_from_peer && active_peer->ids_of_items_to_get.empty()) @@ -1913,7 +1913,7 @@ namespace graphene { namespace net { namespace detail { fc::sha256::encoder shared_secret_encoder; fc::sha512 shared_secret = originating_peer->get_shared_secret(); shared_secret_encoder.write(shared_secret.data(), sizeof(shared_secret)); - fc::ecc::public_key expected_node_public_key(hello_message_received.signed_shared_secret, shared_secret_encoder.result(), false); + fc::ecc::public_key expected_node_public_key(hello_message_received.signed_shared_secret, shared_secret_encoder.result(), fc::ecc::canonical_signature_type::non_canonical); // store off the data provided in the hello message originating_peer->user_agent = hello_message_received.user_agent; @@ -3344,7 +3344,7 @@ namespace graphene { namespace net { namespace detail { ("endpoint", peer->get_remote_endpoint())("len", peer->ids_of_items_being_processed.size())); // if we just processed the last item in our list from this peer, we will want to - // send another request to find out if we are now in sync (this is normally handled in + // send another request to find out if we are now in sync (this is normally handled in // send_sync_block_to_node_delegate) if (peer->ids_of_items_to_get.empty() && peer->number_of_unfetched_item_ids == 0 && diff --git a/libraries/plugins/apis/block_api/include/steem/plugins/block_api/block_api_objects.hpp b/libraries/plugins/apis/block_api/include/steem/plugins/block_api/block_api_objects.hpp index 1b954a22be..206093018c 100644 --- a/libraries/plugins/apis/block_api/include/steem/plugins/block_api/block_api_objects.hpp +++ b/libraries/plugins/apis/block_api/include/steem/plugins/block_api/block_api_objects.hpp @@ -18,7 +18,7 @@ struct api_signed_block_object : public signed_block api_signed_block_object( const signed_block& block ) : signed_block( block ) { block_id = id(); - signing_key = signee(); + signing_key = signee( fc::ecc::canonical_signature_type::bip_0062 ); transaction_ids.reserve( transactions.size() ); for( const signed_transaction& tx : transactions ) transaction_ids.push_back( tx.id() ); diff --git a/libraries/plugins/apis/database_api/database_api.cpp b/libraries/plugins/apis/database_api/database_api.cpp index 9918311cb0..652033b439 100644 --- a/libraries/plugins/apis/database_api/database_api.cpp +++ b/libraries/plugins/apis/database_api/database_api.cpp @@ -1373,7 +1373,8 @@ DEFINE_API_IMPL( database_api_impl, get_required_signatures ) [&]( string account_name ){ return authority( _db.get< chain::account_authority_object, chain::by_account >( account_name ).active ); }, [&]( string account_name ){ return authority( _db.get< chain::account_authority_object, chain::by_account >( account_name ).owner ); }, [&]( string account_name ){ return authority( _db.get< chain::account_authority_object, chain::by_account >( account_name ).posting ); }, - STEEM_MAX_SIG_CHECK_DEPTH ); + STEEM_MAX_SIG_CHECK_DEPTH, + _db.has_hardfork( STEEM_HARDFORK_0_20__1944 ) ? fc::ecc::canonical_signature_type::bip_0062 : fc::ecc::canonical_signature_type::fc_canonical ); return result; } @@ -1405,7 +1406,8 @@ DEFINE_API_IMPL( database_api_impl, get_potential_signatures ) result.keys.insert( k ); return authority( auth ); }, - STEEM_MAX_SIG_CHECK_DEPTH + STEEM_MAX_SIG_CHECK_DEPTH, + _db.has_hardfork( STEEM_HARDFORK_0_20__1944 ) ? fc::ecc::canonical_signature_type::bip_0062 : fc::ecc::canonical_signature_type::fc_canonical ); return result; @@ -1417,7 +1419,8 @@ DEFINE_API_IMPL( database_api_impl, verify_authority ) [&]( string account_name ){ return authority( _db.get< chain::account_authority_object, chain::by_account >( account_name ).active ); }, [&]( string account_name ){ return authority( _db.get< chain::account_authority_object, chain::by_account >( account_name ).owner ); }, [&]( string account_name ){ return authority( _db.get< chain::account_authority_object, chain::by_account >( account_name ).posting ); }, - STEEM_MAX_SIG_CHECK_DEPTH ); + STEEM_MAX_SIG_CHECK_DEPTH, + _db.has_hardfork( STEEM_HARDFORK_0_20__1944 ) ? fc::ecc::canonical_signature_type::bip_0062 : fc::ecc::canonical_signature_type::fc_canonical ); return verify_authority_return( { true } ); } @@ -1444,7 +1447,7 @@ DEFINE_API_IMPL( database_api_impl, verify_signatures ) for( const auto& sig : args.signatures ) { STEEM_ASSERT( - sig_keys.insert( fc::ecc::public_key( sig, args.hash ) ).second, + sig_keys.insert( fc::ecc::public_key( sig, args.hash, fc::ecc::canonical_signature_type::bip_0062 ) ).second, protocol::tx_duplicate_sig, "Duplicate Signature detected" ); } diff --git a/libraries/plugins/apis/database_api/include/steem/plugins/database_api/database_api_objects.hpp b/libraries/plugins/apis/database_api/include/steem/plugins/database_api/database_api_objects.hpp index c2646c010c..6fd58e6187 100644 --- a/libraries/plugins/apis/database_api/include/steem/plugins/database_api/database_api_objects.hpp +++ b/libraries/plugins/apis/database_api/include/steem/plugins/database_api/database_api_objects.hpp @@ -474,7 +474,7 @@ struct api_signed_block_object : public signed_block api_signed_block_object( const signed_block& block ) : signed_block( block ) { block_id = id(); - signing_key = signee(); + signing_key = signee( fc::ecc::canonical_signature_type::bip_0062 ); transaction_ids.reserve( transactions.size() ); for( const signed_transaction& tx : transactions ) transaction_ids.push_back( tx.id() ); diff --git a/libraries/protocol/block.cpp b/libraries/protocol/block.cpp index f11f920615..4724767697 100644 --- a/libraries/protocol/block.cpp +++ b/libraries/protocol/block.cpp @@ -24,19 +24,19 @@ namespace steem { namespace protocol { return result; } - fc::ecc::public_key signed_block_header::signee()const + fc::ecc::public_key signed_block_header::signee( fc::ecc::canonical_signature_type canon_type )const { - return fc::ecc::public_key( witness_signature, digest(), true/*enforce canonical*/ ); + return fc::ecc::public_key( witness_signature, digest(), canon_type /*enforce canonical*/ ); } - void signed_block_header::sign( const fc::ecc::private_key& signer ) + void signed_block_header::sign( const fc::ecc::private_key& signer, fc::ecc::canonical_signature_type canon_type ) { - witness_signature = signer.sign_compact( digest() ); + witness_signature = signer.sign_compact( digest(), canon_type ); } - bool signed_block_header::validate_signee( const fc::ecc::public_key& expected_signee )const + bool signed_block_header::validate_signee( const fc::ecc::public_key& expected_signee, fc::ecc::canonical_signature_type canon_type )const { - return signee() == expected_signee; + return signee( canon_type ) == expected_signee; } checksum_type signed_block::calculate_merkle_root()const diff --git a/libraries/protocol/hardfork.d/0_20.hf b/libraries/protocol/hardfork.d/0_20.hf index d3dfadb1af..7b060736d0 100644 --- a/libraries/protocol/hardfork.d/0_20.hf +++ b/libraries/protocol/hardfork.d/0_20.hf @@ -8,6 +8,7 @@ #define STEEM_HARDFORK_0_20__1765 (STEEM_HARDFORK_0_20) #define STEEM_HARDFORK_0_20__1811 (STEEM_HARDFORK_0_20) #define STEEM_HARDFORK_0_20__1815 (STEEM_HARDFORK_0_20) +#define STEEM_HARDFORK_0_20__1944 (STEEM_HARDFORK_0_20) #define STEEM_HARDFORK_0_20_VERSION hardfork_version( 0, 20 ) diff --git a/libraries/protocol/include/steem/protocol/block_header.hpp b/libraries/protocol/include/steem/protocol/block_header.hpp index aa1aa4564b..e4043bb19a 100644 --- a/libraries/protocol/include/steem/protocol/block_header.hpp +++ b/libraries/protocol/include/steem/protocol/block_header.hpp @@ -19,9 +19,9 @@ namespace steem { namespace protocol { struct signed_block_header : public block_header { block_id_type id()const; - fc::ecc::public_key signee()const; - void sign( const fc::ecc::private_key& signer ); - bool validate_signee( const fc::ecc::public_key& expected_signee )const; + fc::ecc::public_key signee( fc::ecc::canonical_signature_type canon_type )const; + void sign( const fc::ecc::private_key& signer, fc::ecc::canonical_signature_type canon_type = fc::ecc::fc_canonical ); + bool validate_signee( const fc::ecc::public_key& expected_signee, fc::ecc::canonical_signature_type canon_type )const; signature_type witness_signature; }; diff --git a/libraries/protocol/include/steem/protocol/transaction.hpp b/libraries/protocol/include/steem/protocol/transaction.hpp index 41166aa339..8f2ab0940f 100644 --- a/libraries/protocol/include/steem/protocol/transaction.hpp +++ b/libraries/protocol/include/steem/protocol/transaction.hpp @@ -7,6 +7,8 @@ namespace steem { namespace protocol { + using fc::ecc::canonical_signature_type; + struct transaction { uint16_t ref_block_num = 0; @@ -53,9 +55,9 @@ namespace steem { namespace protocol { signed_transaction( const transaction& trx = transaction() ) : transaction(trx){} - const signature_type& sign( const private_key_type& key, const chain_id_type& chain_id ); + const signature_type& sign( const private_key_type& key, const chain_id_type& chain_id, canonical_signature_type canon_type/* = fc::ecc::fc_canonical*/ ); - signature_type sign( const private_key_type& key, const chain_id_type& chain_id )const; + signature_type sign( const private_key_type& key, const chain_id_type& chain_id, canonical_signature_type canon_type/* = fc::ecc::fc_canonical*/ )const; set get_required_signatures( const chain_id_type& chain_id, @@ -63,7 +65,8 @@ namespace steem { namespace protocol { const authority_getter& get_active, const authority_getter& get_owner, const authority_getter& get_posting, - uint32_t max_recursion = STEEM_MAX_SIG_CHECK_DEPTH + uint32_t max_recursion/* = STEEM_MAX_SIG_CHECK_DEPTH */, + canonical_signature_type canon_type/* = fc::ecc::fc_canonical */ )const; void verify_authority( @@ -71,7 +74,9 @@ namespace steem { namespace protocol { const authority_getter& get_active, const authority_getter& get_owner, const authority_getter& get_posting, - uint32_t max_recursion = STEEM_MAX_SIG_CHECK_DEPTH )const; + uint32_t max_recursion/* = STEEM_MAX_SIG_CHECK_DEPTH */, + canonical_signature_type canon_type/* = fc::ecc::fc_canonical*/ + )const; set minimize_required_signatures( const chain_id_type& chain_id, @@ -79,10 +84,11 @@ namespace steem { namespace protocol { const authority_getter& get_active, const authority_getter& get_owner, const authority_getter& get_posting, - uint32_t max_recursion = STEEM_MAX_SIG_CHECK_DEPTH - ) const; + uint32_t max_recursion /*= STEEM_MAX_SIG_CHECK_DEPTH*/, + canonical_signature_type canon_type/* = fc::ecc::fc_canonical*/ + )const; - flat_set get_signature_keys( const chain_id_type& chain_id )const; + flat_set get_signature_keys( const chain_id_type& chain_id, canonical_signature_type canon_type/* = fc::ecc::fc_canonical*/ )const; vector signatures; diff --git a/libraries/protocol/steem_operations.cpp b/libraries/protocol/steem_operations.cpp index c1d9c37a77..86b56f2b08 100644 --- a/libraries/protocol/steem_operations.cpp +++ b/libraries/protocol/steem_operations.cpp @@ -361,10 +361,10 @@ namespace steem { namespace protocol { void pow::create( const fc::ecc::private_key& w, const digest_type& i ) { input = i; - signature = w.sign_compact(input,false); + signature = w.sign_compact(input,fc::ecc::canonical_signature_type::non_canonical); auto sig_hash = fc::sha256::hash( signature ); - public_key_type recover = fc::ecc::public_key( signature, sig_hash, false ); + public_key_type recover = fc::ecc::public_key( signature, sig_hash, fc::ecc::canonical_signature_type::non_canonical ); work = fc::sha256::hash(recover); } @@ -376,7 +376,7 @@ namespace steem { namespace protocol { auto prv_key = fc::sha256::hash( input ); auto input = fc::sha256::hash( prv_key ); - auto signature = fc::ecc::private_key::regenerate( prv_key ).sign_compact(input); + auto signature = fc::ecc::private_key::regenerate( prv_key ).sign_compact(input, fc::ecc::canonical_signature_type::fc_canonical ); auto sig_hash = fc::sha256::hash( signature ); public_key_type recover = fc::ecc::public_key( signature, sig_hash ); @@ -399,9 +399,9 @@ namespace steem { namespace protocol { void pow::validate()const { FC_ASSERT( work != fc::sha256() ); - FC_ASSERT( public_key_type(fc::ecc::public_key( signature, input, false )) == worker ); + FC_ASSERT( public_key_type(fc::ecc::public_key( signature, input, fc::ecc::canonical_signature_type::non_canonical )) == worker ); auto sig_hash = fc::sha256::hash( signature ); - public_key_type recover = fc::ecc::public_key( signature, sig_hash, false ); + public_key_type recover = fc::ecc::public_key( signature, sig_hash, fc::ecc::canonical_signature_type::non_canonical ); FC_ASSERT( work == fc::sha256::hash(recover) ); } @@ -473,7 +473,7 @@ namespace steem { namespace protocol { validate_account_name( first_block.witness ); FC_ASSERT( first_block.witness == second_block.witness ); FC_ASSERT( first_block.timestamp == second_block.timestamp ); - FC_ASSERT( first_block.signee() == second_block.signee() ); + FC_ASSERT( first_block.signee( fc::ecc::canonical_signature_type::bip_0062 ) == second_block.signee( fc::ecc::canonical_signature_type::bip_0062 ) ); FC_ASSERT( first_block.id() != second_block.id() ); } diff --git a/libraries/protocol/transaction.cpp b/libraries/protocol/transaction.cpp index d1476530ba..e55404891c 100644 --- a/libraries/protocol/transaction.cpp +++ b/libraries/protocol/transaction.cpp @@ -47,19 +47,19 @@ steem::protocol::transaction_id_type steem::protocol::transaction::id() const return result; } -const signature_type& steem::protocol::signed_transaction::sign(const private_key_type& key, const chain_id_type& chain_id) +const signature_type& steem::protocol::signed_transaction::sign( const private_key_type& key, const chain_id_type& chain_id, canonical_signature_type canon_type ) { digest_type h = sig_digest( chain_id ); - signatures.push_back(key.sign_compact(h)); + signatures.push_back(key.sign_compact(h, canon_type)); return signatures.back(); } -signature_type steem::protocol::signed_transaction::sign(const private_key_type& key, const chain_id_type& chain_id)const +signature_type steem::protocol::signed_transaction::sign( const private_key_type& key, const chain_id_type& chain_id, canonical_signature_type canon_type )const { digest_type::encoder enc; fc::raw::pack( enc, chain_id ); fc::raw::pack( enc, *this ); - return key.sign_compact(enc.result()); + return key.sign_compact(enc.result(), canon_type); } void transaction::set_expiration( fc::time_point_sec expiration_time ) @@ -82,14 +82,14 @@ void transaction::get_required_authorities( flat_set< account_name_type >& activ operation_get_required_authorities( op, active, owner, posting, other ); } -flat_set signed_transaction::get_signature_keys( const chain_id_type& chain_id )const +flat_set signed_transaction::get_signature_keys( const chain_id_type& chain_id, canonical_signature_type canon_type )const { try { auto d = sig_digest( chain_id ); flat_set result; for( const auto& sig : signatures ) { STEEM_ASSERT( - result.insert( fc::ecc::public_key(sig,d) ).second, + result.insert( fc::ecc::public_key( sig, d, canon_type ) ).second, tx_duplicate_sig, "Duplicate Signature detected" ); } @@ -104,7 +104,8 @@ set signed_transaction::get_required_signatures( const authority_getter& get_active, const authority_getter& get_owner, const authority_getter& get_posting, - uint32_t max_recursion_depth )const + uint32_t max_recursion_depth, + canonical_signature_type canon_type )const { flat_set< account_name_type > required_active; flat_set< account_name_type > required_owner; @@ -114,7 +115,7 @@ set signed_transaction::get_required_signatures( /** posting authority cannot be mixed with active authority in same transaction */ if( required_posting.size() ) { - sign_state s(get_signature_keys( chain_id ),get_posting,available_keys); + sign_state s(get_signature_keys( chain_id, canon_type ),get_posting,available_keys); s.max_recursion = max_recursion_depth; FC_ASSERT( !required_owner.size() ); @@ -134,7 +135,7 @@ set signed_transaction::get_required_signatures( } - sign_state s(get_signature_keys( chain_id ),get_active,available_keys); + sign_state s(get_signature_keys( chain_id, canon_type ),get_active,available_keys); s.max_recursion = max_recursion_depth; for( const auto& auth : other ) @@ -161,10 +162,11 @@ set signed_transaction::minimize_required_signatures( const authority_getter& get_active, const authority_getter& get_owner, const authority_getter& get_posting, - uint32_t max_recursion + uint32_t max_recursion, + canonical_signature_type canon_type ) const { - set< public_key_type > s = get_required_signatures( chain_id, available_keys, get_active, get_owner, get_posting, max_recursion ); + set< public_key_type > s = get_required_signatures( chain_id, available_keys, get_active, get_owner, get_posting, max_recursion, canon_type ); flat_set< public_key_type > result( s.begin(), s.end() ); for( const public_key_type& k : s ) @@ -189,9 +191,10 @@ void signed_transaction::verify_authority( const authority_getter& get_active, const authority_getter& get_owner, const authority_getter& get_posting, - uint32_t max_recursion )const + uint32_t max_recursion, + canonical_signature_type canon_type )const { try { - steem::protocol::verify_authority( operations, get_signature_keys( chain_id ), get_active, get_owner, get_posting, max_recursion ); + steem::protocol::verify_authority( operations, get_signature_keys( chain_id, canon_type ), get_active, get_owner, get_posting, max_recursion ); } FC_CAPTURE_AND_RETHROW( (*this) ) } } } // steem::protocol diff --git a/libraries/wallet/wallet.cpp b/libraries/wallet/wallet.cpp index 948969b357..0106f8d9fe 100644 --- a/libraries/wallet/wallet.cpp +++ b/libraries/wallet/wallet.cpp @@ -679,14 +679,15 @@ class wallet_api_impl { return (get_account_from_lut( account_name ).owner); }, [&]( const string& account_name ) -> const authority& { return (get_account_from_lut( account_name ).posting); }, - STEEM_MAX_SIG_CHECK_DEPTH + STEEM_MAX_SIG_CHECK_DEPTH, + fc::ecc::canonical_signature_type::fc_canonical ); for( const public_key_type& k : minimal_signing_keys ) { auto it = available_private_keys.find(k); FC_ASSERT( it != available_private_keys.end() ); - tx.sign( it->second, steem_chain_id ); + tx.sign( it->second, steem_chain_id, fc::ecc::canonical_signature_type::fc_canonical ); } if( broadcast ) { diff --git a/tests/db_fixture/database_fixture.cpp b/tests/db_fixture/database_fixture.cpp index aca07a99ce..0c9bce7cda 100644 --- a/tests/db_fixture/database_fixture.cpp +++ b/tests/db_fixture/database_fixture.cpp @@ -311,7 +311,7 @@ const account_object& database_fixture::account_create( } trx.set_expiration( db->head_block_time() + STEEM_MAX_TIME_UNTIL_EXPIRATION ); - trx.sign( creator_key, db->get_chain_id() ); + sign( trx, creator_key ); trx.validate(); db->push_transaction( trx, 0 ); trx.operations.clear(); @@ -369,7 +369,7 @@ const witness_object& database_fixture::witness_create( trx.operations.push_back( op ); trx.set_expiration( db->head_block_time() + STEEM_MAX_TIME_UNTIL_EXPIRATION ); - trx.sign( owner_key, db->get_chain_id() ); + sign( trx, owner_key ); trx.validate(); db->push_transaction( trx, 0 ); trx.operations.clear(); @@ -571,7 +571,7 @@ const asset& database_fixture::get_balance( const string& account_name )const void database_fixture::sign(signed_transaction& trx, const fc::ecc::private_key& key) { - trx.sign( key, db->get_chain_id() ); + trx.sign( key, db->get_chain_id(), default_sig_canon ); } vector< operation > database_fixture::get_last_operations( uint32_t num_ops ) @@ -691,7 +691,7 @@ smt_database_fixture::create_smt_3(const char* control_account_name, const fc::e tx.operations.push_back( op1 ); tx.operations.push_back( op2 ); tx.set_expiration( db->head_block_time() + STEEM_MAX_TIME_UNTIL_EXPIRATION ); - tx.sign( key, db->get_chain_id() ); + sign( tx, key ); db->push_transaction( tx, 0 ); generate_block(); @@ -707,7 +707,7 @@ void push_invalid_operation(const operation& invalid_op, const fc::ecc::private_ signed_transaction tx; tx.operations.push_back( invalid_op ); tx.set_expiration( db->head_block_time() + STEEM_MAX_TIME_UNTIL_EXPIRATION ); - tx.sign( key, db->get_chain_id() ); + sign( tx, key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, database::skip_transaction_dupe_check ), fc::assert_exception ); } diff --git a/tests/db_fixture/database_fixture.hpp b/tests/db_fixture/database_fixture.hpp index 99887f5c08..4c34f9a443 100644 --- a/tests/db_fixture/database_fixture.hpp +++ b/tests/db_fixture/database_fixture.hpp @@ -155,6 +155,7 @@ struct database_fixture { string debug_key = steem::utilities::key_to_wif( init_account_priv_key ); public_key_type init_account_pub_key = init_account_priv_key.get_public_key(); uint32_t default_skip = 0 | database::skip_undo_history_check | database::skip_authority_check; + fc::ecc::canonical_signature_type default_sig_canon = fc::ecc::canonical_signature_type::fc_canonical; plugins::debug_node::debug_node_plugin* db_plugin; diff --git a/tests/plugin_tests/market_history.cpp b/tests/plugin_tests/market_history.cpp index fdf21d7ce4..d46b030cd9 100644 --- a/tests/plugin_tests/market_history.cpp +++ b/tests/plugin_tests/market_history.cpp @@ -88,7 +88,7 @@ BOOST_AUTO_TEST_CASE( mh_test ) op.min_to_receive = ASSET( "2.000 TESTS" ); tx.operations.push_back( op ); tx.set_expiration( db->head_block_time() + STEEM_MAX_TIME_UNTIL_EXPIRATION ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); tx.operations.clear(); @@ -98,7 +98,7 @@ BOOST_AUTO_TEST_CASE( mh_test ) op.amount_to_sell = ASSET( "1.500 TESTS" ); op.min_to_receive = ASSET( "0.750 TBD" ); tx.operations.push_back( op ); - tx.sign( bob_private_key, db->get_chain_id() ); + sign( tx, bob_private_key ); db->push_transaction( tx, 0 ); generate_blocks( db->head_block_time() + ( 60 * 90 ) ); @@ -113,7 +113,7 @@ BOOST_AUTO_TEST_CASE( mh_test ) op.min_to_receive = ASSET( "0.500 TBD" ); tx.operations.push_back( op ); tx.set_expiration( db->head_block_time() + STEEM_MAX_TIME_UNTIL_EXPIRATION ); - tx.sign( sam_private_key, db->get_chain_id() ); + sign( tx, sam_private_key ); db->push_transaction( tx, 0 ); generate_blocks( db->head_block_time() + 60 ); @@ -128,7 +128,7 @@ BOOST_AUTO_TEST_CASE( mh_test ) op.min_to_receive = ASSET( "0.900 TESTS" ); tx.operations.push_back( op ); tx.set_expiration( db->head_block_time() + STEEM_MAX_TIME_UNTIL_EXPIRATION ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); tx.operations.clear(); @@ -139,7 +139,7 @@ BOOST_AUTO_TEST_CASE( mh_test ) op.min_to_receive = ASSET( "0.250 TBD" ); tx.operations.push_back( op ); tx.set_expiration( db->head_block_time() + STEEM_MAX_TIME_UNTIL_EXPIRATION ); - tx.sign( bob_private_key, db->get_chain_id() ); + sign( tx, bob_private_key ); db->push_transaction( tx, 0 ); validate_database(); diff --git a/tests/tests/block_tests.cpp b/tests/tests/block_tests.cpp index d92967de66..184b9caebb 100644 --- a/tests/tests/block_tests.cpp +++ b/tests/tests/block_tests.cpp @@ -256,7 +256,7 @@ BOOST_AUTO_TEST_CASE( switch_forks_undo_create ) cop.active = cop.owner; trx.operations.push_back(cop); trx.set_expiration( db1.head_block_time() + STEEM_MAX_TIME_UNTIL_EXPIRATION ); - trx.sign( init_account_priv_key, db1.get_chain_id() ); + trx.sign( init_account_priv_key, db1.get_chain_id(), fc::ecc::canonical_signature_type::fc_canonical ); PUSH_TX( db1, trx ); //*/ // generate blocks @@ -316,7 +316,7 @@ BOOST_AUTO_TEST_CASE( duplicate_transactions ) cop.active = cop.owner; trx.operations.push_back(cop); trx.set_expiration( db1.head_block_time() + STEEM_MAX_TIME_UNTIL_EXPIRATION ); - trx.sign( init_account_priv_key, db1.get_chain_id() ); + trx.sign( init_account_priv_key, db1.get_chain_id(), fc::ecc::canonical_signature_type::fc_canonical ); PUSH_TX( db1, trx, skip_sigs ); trx = decltype(trx)(); @@ -326,7 +326,7 @@ BOOST_AUTO_TEST_CASE( duplicate_transactions ) t.amount = asset(500,STEEM_SYMBOL); trx.operations.push_back(t); trx.set_expiration( db1.head_block_time() + STEEM_MAX_TIME_UNTIL_EXPIRATION ); - trx.sign( init_account_priv_key, db1.get_chain_id() ); + trx.sign( init_account_priv_key, db1.get_chain_id(), fc::ecc::canonical_signature_type::fc_canonical ); PUSH_TX( db1, trx, skip_sigs ); STEEM_CHECK_THROW(PUSH_TX( db1, trx, skip_sigs ), fc::exception); @@ -370,7 +370,7 @@ BOOST_AUTO_TEST_CASE( tapos ) cop.active = cop.owner; trx.operations.push_back(cop); trx.set_expiration( db1.head_block_time() + STEEM_MAX_TIME_UNTIL_EXPIRATION ); - trx.sign( init_account_priv_key, db1.get_chain_id() ); + trx.sign( init_account_priv_key, db1.get_chain_id(), fc::ecc::canonical_signature_type::fc_canonical ); BOOST_TEST_MESSAGE( "Pushing Pending Transaction" ); idump((trx)); @@ -385,13 +385,13 @@ BOOST_AUTO_TEST_CASE( tapos ) t.amount = asset(50,STEEM_SYMBOL); trx.operations.push_back(t); trx.set_expiration( db1.head_block_time() + fc::seconds(2) ); - trx.sign( init_account_priv_key, db1.get_chain_id() ); + trx.sign( init_account_priv_key, db1.get_chain_id(), fc::ecc::canonical_signature_type::fc_canonical ); idump((trx)(db1.head_block_time())); b = db1.generate_block(db1.get_slot_time(1), db1.get_scheduled_witness(1), init_account_priv_key, database::skip_nothing); idump((b)); b = db1.generate_block(db1.get_slot_time(1), db1.get_scheduled_witness(1), init_account_priv_key, database::skip_nothing); trx.signatures.clear(); - trx.sign( init_account_priv_key, db1.get_chain_id() ); + trx.sign( init_account_priv_key, db1.get_chain_id(), fc::ecc::canonical_signature_type::fc_canonical ); BOOST_REQUIRE_THROW( db1.push_transaction(trx, 0/*database::skip_transaction_signatures | database::skip_authority_check*/), fc::exception ); } catch (fc::exception& e) { edump((e.to_detail_string())); @@ -424,14 +424,14 @@ BOOST_FIXTURE_TEST_CASE( optional_tapos, clean_database_fixture ) tx.ref_block_prefix = 0; tx.signatures.clear(); tx.set_expiration( db->head_block_time() + STEEM_MAX_TIME_UNTIL_EXPIRATION ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); PUSH_TX( *db, tx ); BOOST_TEST_MESSAGE( "proper ref_block_num, ref_block_prefix" ); tx.signatures.clear(); tx.set_expiration( db->head_block_time() + STEEM_MAX_TIME_UNTIL_EXPIRATION ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); PUSH_TX( *db, tx, database::skip_transaction_dupe_check ); BOOST_TEST_MESSAGE( "ref_block_num=0, ref_block_prefix=12345678" ); @@ -440,7 +440,7 @@ BOOST_FIXTURE_TEST_CASE( optional_tapos, clean_database_fixture ) tx.ref_block_prefix = 0x12345678; tx.signatures.clear(); tx.set_expiration( db->head_block_time() + STEEM_MAX_TIME_UNTIL_EXPIRATION ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); STEEM_REQUIRE_THROW( PUSH_TX( *db, tx, database::skip_transaction_dupe_check ), fc::exception ); BOOST_TEST_MESSAGE( "ref_block_num=1, ref_block_prefix=12345678" ); @@ -449,7 +449,7 @@ BOOST_FIXTURE_TEST_CASE( optional_tapos, clean_database_fixture ) tx.ref_block_prefix = 0x12345678; tx.signatures.clear(); tx.set_expiration( db->head_block_time() + STEEM_MAX_TIME_UNTIL_EXPIRATION ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); STEEM_REQUIRE_THROW( PUSH_TX( *db, tx, database::skip_transaction_dupe_check ), fc::exception ); BOOST_TEST_MESSAGE( "ref_block_num=9999, ref_block_prefix=12345678" ); @@ -458,7 +458,7 @@ BOOST_FIXTURE_TEST_CASE( optional_tapos, clean_database_fixture ) tx.ref_block_prefix = 0x12345678; tx.signatures.clear(); tx.set_expiration( db->head_block_time() + STEEM_MAX_TIME_UNTIL_EXPIRATION ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); STEEM_REQUIRE_THROW( PUSH_TX( *db, tx, database::skip_transaction_dupe_check ), fc::exception ); } catch (fc::exception& e) @@ -495,19 +495,19 @@ BOOST_FIXTURE_TEST_CASE( double_sign_check, clean_database_fixture ) STEEM_REQUIRE_THROW( db->push_transaction(trx, 0), fc::exception ); BOOST_TEST_MESSAGE( "Verify that double-signing causes an exception" ); - trx.sign( bob_private_key, db->get_chain_id() ); - trx.sign( bob_private_key, db->get_chain_id() ); + sign( trx, bob_private_key ); + sign( trx, bob_private_key ); STEEM_REQUIRE_THROW( db->push_transaction(trx, 0), tx_duplicate_sig ); BOOST_TEST_MESSAGE( "Verify that signing with an extra, unused key fails" ); trx.signatures.pop_back(); - trx.sign( generate_private_key("bogus" ), db->get_chain_id() ); + sign( trx, generate_private_key("bogus" ) ); STEEM_REQUIRE_THROW( db->push_transaction(trx, 0), tx_irrelevant_sig ); BOOST_TEST_MESSAGE( "Verify that signing once with the proper key passes" ); trx.signatures.pop_back(); db->push_transaction(trx, 0); - trx.sign( bob_private_key, db->get_chain_id() ); + sign( trx, bob_private_key ); } FC_LOG_AND_RETHROW() } @@ -715,6 +715,8 @@ BOOST_FIXTURE_TEST_CASE( hardfork_test, database_fixture ) try { try { + default_sig_canon = fc::ecc::canonical_signature_type::fc_canonical; + int argc = boost::unit_test::framework::master_test_suite().argc; char** argv = boost::unit_test::framework::master_test_suite().argv; for( int i=1; ihead_block_time() + STEEM_MAX_TIME_UNTIL_EXPIRATION ); tx.operations.push_back( op ); - tx.sign( init_account_priv_key, db->get_chain_id() ); + sign( tx, init_account_priv_key ); tx.validate(); db->push_transaction( tx, 0 ); @@ -147,7 +147,7 @@ BOOST_AUTO_TEST_CASE( account_create_apply ) op.fee = asset( db->get_account( STEEM_INIT_MINER_NAME ).balance.amount + 1, STEEM_SYMBOL ); op.new_account_name = "bob"; tx.operations.push_back( op ); - tx.sign( init_account_priv_key, db->get_chain_id() ); + sign( tx, init_account_priv_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), fc::exception ); validate_database(); @@ -165,7 +165,7 @@ BOOST_AUTO_TEST_CASE( account_create_apply ) tx.clear(); op.fee = ASSET( "1.000 TESTS" ); tx.operations.push_back( op ); - tx.sign( init_account_priv_key, db->get_chain_id() ); + sign( tx, init_account_priv_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), fc::exception ); validate_database(); } @@ -193,7 +193,7 @@ BOOST_AUTO_TEST_CASE( account_update_validate ) signed_transaction tx; tx.set_expiration( db->head_block_time() + STEEM_MAX_TIME_UNTIL_EXPIRATION ); tx.operations.push_back( op ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); BOOST_FAIL( "An exception was not thrown for an invalid account name" ); @@ -232,27 +232,27 @@ BOOST_AUTO_TEST_CASE( account_update_authorities ) STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), tx_missing_active_auth ); BOOST_TEST_MESSAGE( "--- Test failure when wrong signature" ); - tx.sign( bob_private_key, db->get_chain_id() ); + sign( tx, bob_private_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), tx_missing_active_auth ); BOOST_TEST_MESSAGE( "--- Test failure when containing additional incorrect signature" ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), tx_irrelevant_sig ); BOOST_TEST_MESSAGE( "--- Test failure when containing duplicate signatures" ); tx.signatures.clear(); - tx.sign( active_key, db->get_chain_id() ); - tx.sign( active_key, db->get_chain_id() ); + sign( tx, active_key ); + sign( tx, active_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), tx_duplicate_sig ); BOOST_TEST_MESSAGE( "--- Test success on active key" ); tx.signatures.clear(); - tx.sign( active_key, db->get_chain_id() ); + sign( tx, active_key ); db->push_transaction( tx, 0 ); BOOST_TEST_MESSAGE( "--- Test success on owner key alone" ); tx.signatures.clear(); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, database::skip_transaction_dupe_check ); BOOST_TEST_MESSAGE( " Tests when owner authority is updated ---" ); @@ -261,27 +261,27 @@ BOOST_AUTO_TEST_CASE( account_update_authorities ) tx.operations.clear(); op.owner = authority( 1, active_key.get_public_key(), 1 ); tx.operations.push_back( op ); - tx.sign( active_key, db->get_chain_id() ); + sign( tx, active_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), tx_missing_owner_auth ); BOOST_TEST_MESSAGE( "--- Test failure when owner key and active key are present" ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), tx_irrelevant_sig ); BOOST_TEST_MESSAGE( "--- Test failure when incorrect signature" ); tx.signatures.clear(); - tx.sign( alice_post_key, db->get_chain_id() ); + sign( tx, alice_post_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, 0), tx_missing_owner_auth ); BOOST_TEST_MESSAGE( "--- Test failure when duplicate owner keys are present" ); tx.signatures.clear(); - tx.sign( alice_private_key, db->get_chain_id() ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); + sign( tx, alice_private_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, 0), tx_duplicate_sig ); BOOST_TEST_MESSAGE( "--- Test success when updating the owner authority with an owner key" ); tx.signatures.clear(); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); validate_database(); @@ -310,7 +310,7 @@ BOOST_AUTO_TEST_CASE( account_update_apply ) signed_transaction tx; tx.operations.push_back( op ); tx.set_expiration( db->head_block_time() + STEEM_MAX_TIME_UNTIL_EXPIRATION ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); const account_object& acct = db->get_account( "alice" ); @@ -336,7 +336,7 @@ BOOST_AUTO_TEST_CASE( account_update_apply ) tx.signatures.clear(); op.account = "bob"; tx.operations.push_back( op ); - tx.sign( new_private_key, db->get_chain_id() ); + sign( tx, new_private_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), fc::exception ) validate_database(); @@ -349,7 +349,7 @@ BOOST_AUTO_TEST_CASE( account_update_apply ) op.posting->weight_threshold = 1; op.posting->add_authorities( "dave", 1 ); tx.operations.push_back( op ); - tx.sign( new_private_key, db->get_chain_id() ); + sign( tx, new_private_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), fc::exception ); validate_database(); } @@ -394,22 +394,22 @@ BOOST_AUTO_TEST_CASE( comment_authorities ) STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), tx_missing_posting_auth ); BOOST_TEST_MESSAGE( "--- Test failure when duplicate signatures" ); - tx.sign( alice_post_key, db->get_chain_id() ); - tx.sign( alice_post_key, db->get_chain_id() ); + sign( tx, alice_post_key ); + sign( tx, alice_post_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), tx_duplicate_sig ); BOOST_TEST_MESSAGE( "--- Test success with post signature" ); tx.signatures.clear(); - tx.sign( alice_post_key, db->get_chain_id() ); + sign( tx, alice_post_key ); db->push_transaction( tx, 0 ); BOOST_TEST_MESSAGE( "--- Test failure when signed by an additional signature not in the creator's authority" ); - tx.sign( bob_private_key, db->get_chain_id() ); + sign( tx, bob_private_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, database::skip_transaction_dupe_check ), tx_irrelevant_sig ); BOOST_TEST_MESSAGE( "--- Test failure when signed by a signature not in the creator's authority" ); tx.signatures.clear(); - tx.sign( bob_private_key, db->get_chain_id() ); + sign( tx, bob_private_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, database::skip_transaction_dupe_check ), tx_missing_posting_auth ); validate_database(); @@ -440,7 +440,7 @@ BOOST_AUTO_TEST_CASE( comment_apply ) BOOST_TEST_MESSAGE( "--- Test Alice posting a root comment" ); tx.operations.push_back( op ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); const comment_object& alice_comment = db->get_comment( "alice", string( "lorem" ) ); @@ -475,7 +475,7 @@ BOOST_AUTO_TEST_CASE( comment_apply ) tx.signatures.clear(); tx.operations.clear(); tx.operations.push_back( op ); - tx.sign( bob_private_key, db->get_chain_id() ); + sign( tx, bob_private_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), fc::exception ); BOOST_TEST_MESSAGE( "--- Test Bob posting a comment on Alice's comment" ); @@ -484,7 +484,7 @@ BOOST_AUTO_TEST_CASE( comment_apply ) tx.signatures.clear(); tx.operations.clear(); tx.operations.push_back( op ); - tx.sign( bob_private_key, db->get_chain_id() ); + sign( tx, bob_private_key ); db->push_transaction( tx, 0 ); const comment_object& bob_comment = db->get_comment( "bob", string( "ipsum" ) ); @@ -511,7 +511,7 @@ BOOST_AUTO_TEST_CASE( comment_apply ) tx.signatures.clear(); tx.operations.clear(); tx.operations.push_back( op ); - tx.sign( sam_private_key, db->get_chain_id() ); + sign( tx, sam_private_key ); db->push_transaction( tx, 0 ); const comment_object& sam_comment = db->get_comment( "sam", string( "dolor" ) ); @@ -557,7 +557,7 @@ BOOST_AUTO_TEST_CASE( comment_apply ) op.json_metadata = "{\"bar\":\"foo\"}"; tx.operations.push_back( op ); tx.set_expiration( db->head_block_time() + STEEM_MAX_TIME_UNTIL_EXPIRATION ); - tx.sign( sam_private_key, db->get_chain_id() ); + sign( tx, sam_private_key ); db->push_transaction( tx, 0 ); BOOST_REQUIRE( mod_sam_comment.author == op.author ); @@ -578,7 +578,7 @@ BOOST_AUTO_TEST_CASE( comment_apply ) tx.signatures.clear(); tx.set_expiration( db->head_block_time() + STEEM_MAX_TIME_UNTIL_EXPIRATION ); tx.operations.push_back( op ); - tx.sign( sam_private_key, db->get_chain_id() ); + sign( tx, sam_private_key ); db->push_transaction( tx, 0 ); generate_blocks( 60 * 5 / STEEM_BLOCK_INTERVAL ); @@ -588,7 +588,7 @@ BOOST_AUTO_TEST_CASE( comment_apply ) tx.signatures.clear(); tx.set_expiration( db->head_block_time() + STEEM_MAX_TIME_UNTIL_EXPIRATION ); tx.operations.push_back( op ); - tx.sign( sam_private_key, db->get_chain_id() ); + sign( tx, sam_private_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), fc::exception ); validate_database(); @@ -630,7 +630,7 @@ BOOST_AUTO_TEST_CASE( comment_delete_apply ) tx.operations.push_back( comment ); tx.operations.push_back( vote ); tx.set_expiration( db->head_block_time() + STEEM_MIN_TRANSACTION_EXPIRATION_LIMIT ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); BOOST_TEST_MESSAGE( "--- Test failue deleting a comment with positive rshares" ); @@ -640,7 +640,7 @@ BOOST_AUTO_TEST_CASE( comment_delete_apply ) op.permlink = "test1"; tx.clear(); tx.operations.push_back( op ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), fc::assert_exception ); @@ -651,7 +651,7 @@ BOOST_AUTO_TEST_CASE( comment_delete_apply ) tx.clear(); tx.operations.push_back( vote ); tx.operations.push_back( op ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); auto test_comment = db->find< comment_object, by_permlink >( boost::make_tuple( "alice", string( "test1" ) ) ); @@ -664,7 +664,7 @@ BOOST_AUTO_TEST_CASE( comment_delete_apply ) tx.clear(); tx.operations.push_back( comment ); tx.set_expiration( db->head_block_time() + STEEM_MIN_TRANSACTION_EXPIRATION_LIMIT ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); generate_blocks( STEEM_CASHOUT_WINDOW_SECONDS / STEEM_BLOCK_INTERVAL ); @@ -673,7 +673,7 @@ BOOST_AUTO_TEST_CASE( comment_delete_apply ) tx.clear(); tx.operations.push_back( op ); tx.set_expiration( db->head_block_time() + STEEM_MIN_TRANSACTION_EXPIRATION_LIMIT ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), fc::assert_exception ); @@ -685,7 +685,7 @@ BOOST_AUTO_TEST_CASE( comment_delete_apply ) tx.clear(); tx.operations.push_back( comment ); tx.set_expiration( db->head_block_time() + STEEM_MIN_TRANSACTION_EXPIRATION_LIMIT ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); generate_blocks( STEEM_MIN_ROOT_COMMENT_INTERVAL.to_seconds() / STEEM_BLOCK_INTERVAL ); @@ -694,13 +694,13 @@ BOOST_AUTO_TEST_CASE( comment_delete_apply ) tx.clear(); tx.operations.push_back( comment ); tx.set_expiration( db->head_block_time() + STEEM_MIN_TRANSACTION_EXPIRATION_LIMIT ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); op.permlink = "test2"; tx.clear(); tx.operations.push_back( op ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), fc::assert_exception ); } FC_LOG_AND_RETHROW() @@ -758,7 +758,7 @@ BOOST_AUTO_TEST_CASE( vote_apply ) comment_op.body = "foo bar"; tx.operations.push_back( comment_op ); tx.set_expiration( db->head_block_time() + STEEM_MAX_TIME_UNTIL_EXPIRATION ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); BOOST_TEST_MESSAGE( "--- Testing voting on a non-existent comment" ); @@ -772,7 +772,7 @@ BOOST_AUTO_TEST_CASE( vote_apply ) op.permlink = "foo"; op.weight = STEEM_100_PERCENT; tx.operations.push_back( op ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), fc::exception ); @@ -784,7 +784,7 @@ BOOST_AUTO_TEST_CASE( vote_apply ) tx.operations.clear(); tx.signatures.clear(); tx.operations.push_back( op ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), fc::exception ); @@ -799,7 +799,7 @@ BOOST_AUTO_TEST_CASE( vote_apply ) tx.operations.clear(); tx.signatures.clear(); tx.operations.push_back( op ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); @@ -828,7 +828,7 @@ BOOST_AUTO_TEST_CASE( vote_apply ) tx.operations.clear(); tx.signatures.clear(); tx.operations.push_back( comment_op ); - tx.sign( bob_private_key, db->get_chain_id() ); + sign( tx, bob_private_key ); db->push_transaction( tx, 0 ); op.weight = STEEM_100_PERCENT / 2; @@ -838,7 +838,7 @@ BOOST_AUTO_TEST_CASE( vote_apply ) tx.operations.clear(); tx.signatures.clear(); tx.operations.push_back( op ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); const auto& bob_comment = db->get_comment( "bob", string( "foo" ) ); @@ -868,7 +868,7 @@ BOOST_AUTO_TEST_CASE( vote_apply ) tx.signatures.clear(); tx.operations.push_back( op ); tx.set_expiration( db->head_block_time() + STEEM_MAX_TIME_UNTIL_EXPIRATION ); - tx.sign( bob_private_key, db->get_chain_id() ); + sign( tx, bob_private_key ); db->push_transaction( tx, 0 ); itr = vote_idx.find( std::make_tuple( new_alice_comment.id, new_bob.id ) ); @@ -894,7 +894,7 @@ BOOST_AUTO_TEST_CASE( vote_apply ) tx.operations.clear(); tx.signatures.clear(); tx.operations.push_back( op ); - tx.sign( sam_private_key, db->get_chain_id() ); + sign( tx, sam_private_key ); db->push_transaction( tx, 0 ); itr = vote_idx.find( std::make_tuple( new_bob_comment.id, new_sam.id ) ); @@ -924,7 +924,7 @@ BOOST_AUTO_TEST_CASE( vote_apply ) tx.operations.clear(); tx.signatures.clear(); tx.operations.push_back( comment_op ); - tx.sign( sam_private_key, db->get_chain_id() ); + sign( tx, sam_private_key ); db->push_transaction( tx, 0 ); op.weight = STEEM_100_PERCENT; @@ -934,7 +934,7 @@ BOOST_AUTO_TEST_CASE( vote_apply ) tx.operations.clear(); tx.signatures.clear(); tx.operations.push_back( op ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); auto new_rshares = ( ( fc::uint128_t( db->get_account( "alice" ).vesting_shares.amount.value ) * used_power ) / STEEM_100_PERCENT ).to_uint64(); @@ -962,7 +962,7 @@ BOOST_AUTO_TEST_CASE( vote_apply ) tx.operations.clear(); tx.signatures.clear(); tx.operations.push_back( op ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); alice_bob_vote = vote_idx.find( std::make_tuple( new_bob_comment.id, new_alice.id ) ); @@ -992,7 +992,7 @@ BOOST_AUTO_TEST_CASE( vote_apply ) tx.operations.clear(); tx.signatures.clear(); tx.operations.push_back( op ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); alice_bob_vote = vote_idx.find( std::make_tuple( new_bob_comment.id, new_alice.id ) ); @@ -1019,7 +1019,7 @@ BOOST_AUTO_TEST_CASE( vote_apply ) tx.operations.clear(); tx.signatures.clear(); tx.operations.push_back( op ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); alice_bob_vote = vote_idx.find( std::make_tuple( new_bob_comment.id, new_alice.id ) ); @@ -1040,7 +1040,7 @@ BOOST_AUTO_TEST_CASE( vote_apply ) tx.operations.clear(); tx.signatures.clear(); tx.operations.push_back( op ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), fc::exception ); validate_database(); @@ -1051,7 +1051,7 @@ BOOST_AUTO_TEST_CASE( vote_apply ) tx.operations.clear(); tx.signatures.clear(); tx.operations.push_back( op ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); validate_database(); @@ -1062,7 +1062,7 @@ BOOST_AUTO_TEST_CASE( vote_apply ) tx.operations.clear(); tx.signatures.clear(); tx.operations.push_back( op ); - tx.sign( dave_private_key, db->get_chain_id() ); + sign( tx, dave_private_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), fc::exception ); validate_database(); } @@ -1103,24 +1103,24 @@ BOOST_AUTO_TEST_CASE( transfer_authorities ) STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), tx_missing_active_auth ); BOOST_TEST_MESSAGE( "--- Test failure when signed by a signature not in the account's authority" ); - tx.sign( alice_post_key, db->get_chain_id() ); + sign( tx, alice_post_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), tx_missing_active_auth ); BOOST_TEST_MESSAGE( "--- Test failure when duplicate signatures" ); tx.signatures.clear(); - tx.sign( alice_private_key, db->get_chain_id() ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); + sign( tx, alice_private_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), tx_duplicate_sig ); BOOST_TEST_MESSAGE( "--- Test failure when signed by an additional signature not in the creator's authority" ); tx.signatures.clear(); - tx.sign( alice_private_key, db->get_chain_id() ); - tx.sign( bob_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); + sign( tx, bob_private_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), tx_irrelevant_sig ); BOOST_TEST_MESSAGE( "--- Test success with witness signature" ); tx.signatures.clear(); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); validate_database(); @@ -1147,7 +1147,7 @@ BOOST_AUTO_TEST_CASE( signature_stripping ) tx.set_expiration( db->head_block_time() + STEEM_MAX_TIME_UNTIL_EXPIRATION ); tx.operations.push_back( update_op ); - tx.sign( corp_private_key, db->get_chain_id() ); + sign( tx, corp_private_key ); db->push_transaction( tx, 0 ); tx.operations.clear(); @@ -1160,12 +1160,12 @@ BOOST_AUTO_TEST_CASE( signature_stripping ) tx.operations.push_back( transfer_op ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); signature_type alice_sig = tx.signatures.back(); STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), tx_missing_active_auth ); - tx.sign( bob_private_key, db->get_chain_id() ); + sign( tx, bob_private_key ); signature_type bob_sig = tx.signatures.back(); - tx.sign( sam_private_key, db->get_chain_id() ); + sign( tx, sam_private_key ); signature_type sam_sig = tx.signatures.back(); STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), tx_irrelevant_sig ); @@ -1204,7 +1204,7 @@ BOOST_AUTO_TEST_CASE( transfer_apply ) BOOST_TEST_MESSAGE( "--- Test normal transaction" ); tx.operations.push_back( op ); tx.set_expiration( db->head_block_time() + STEEM_MAX_TIME_UNTIL_EXPIRATION ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); BOOST_REQUIRE( alice.balance.amount.value == ASSET( "5.000 TESTS" ).amount.value ); @@ -1226,7 +1226,7 @@ BOOST_AUTO_TEST_CASE( transfer_apply ) tx.operations.clear(); tx.operations.push_back( op ); tx.set_expiration( db->head_block_time() + STEEM_MAX_TIME_UNTIL_EXPIRATION ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, database::skip_transaction_dupe_check ); BOOST_REQUIRE( new_alice.balance.amount.value == ASSET( "0.000 TESTS" ).amount.value ); @@ -1238,7 +1238,7 @@ BOOST_AUTO_TEST_CASE( transfer_apply ) tx.operations.clear(); tx.operations.push_back( op ); tx.set_expiration( db->head_block_time() + STEEM_MAX_TIME_UNTIL_EXPIRATION ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, database::skip_transaction_dupe_check ), fc::exception ); BOOST_REQUIRE( new_alice.balance.amount.value == ASSET( "0.000 TESTS" ).amount.value ); @@ -1282,24 +1282,24 @@ BOOST_AUTO_TEST_CASE( transfer_to_vesting_authorities ) STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), tx_missing_active_auth ); BOOST_TEST_MESSAGE( "--- Test failure when signed by a signature not in the account's authority" ); - tx.sign( alice_post_key, db->get_chain_id() ); + sign( tx, alice_post_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), tx_missing_active_auth ); BOOST_TEST_MESSAGE( "--- Test failure when duplicate signatures" ); tx.signatures.clear(); - tx.sign( alice_private_key, db->get_chain_id() ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); + sign( tx, alice_private_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), tx_duplicate_sig ); BOOST_TEST_MESSAGE( "--- Test failure when signed by an additional signature not in the creator's authority" ); tx.signatures.clear(); - tx.sign( alice_private_key, db->get_chain_id() ); - tx.sign( bob_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); + sign( tx, bob_private_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), tx_irrelevant_sig ); BOOST_TEST_MESSAGE( "--- Test success with from signature" ); tx.signatures.clear(); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); validate_database(); @@ -1333,7 +1333,7 @@ BOOST_AUTO_TEST_CASE( transfer_to_vesting_apply ) signed_transaction tx; tx.operations.push_back( op ); tx.set_expiration( db->head_block_time() + STEEM_MAX_TIME_UNTIL_EXPIRATION ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); auto new_vest = op.amount * ( shares / vests ); @@ -1353,7 +1353,7 @@ BOOST_AUTO_TEST_CASE( transfer_to_vesting_apply ) tx.signatures.clear(); tx.operations.push_back( op ); tx.set_expiration( db->head_block_time() + STEEM_MAX_TIME_UNTIL_EXPIRATION ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); new_vest = asset( ( op.amount * ( shares / vests ) ).amount, VESTS_SYMBOL ); @@ -1415,22 +1415,22 @@ BOOST_AUTO_TEST_CASE( withdraw_vesting_authorities ) STEEM_REQUIRE_THROW( db->push_transaction( tx, database::skip_transaction_dupe_check ), tx_missing_active_auth ); BOOST_TEST_MESSAGE( "--- Test success with account signature" ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, database::skip_transaction_dupe_check ); BOOST_TEST_MESSAGE( "--- Test failure with duplicate signature" ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, database::skip_transaction_dupe_check ), tx_duplicate_sig ); BOOST_TEST_MESSAGE( "--- Test failure with additional incorrect signature" ); tx.signatures.clear(); - tx.sign( alice_private_key, db->get_chain_id() ); - tx.sign( bob_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); + sign( tx, bob_private_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, database::skip_transaction_dupe_check ), tx_irrelevant_sig ); BOOST_TEST_MESSAGE( "--- Test failure with incorrect signature" ); tx.signatures.clear(); - tx.sign( alice_post_key, db->get_chain_id() ); + sign( tx, alice_post_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, database::skip_transaction_dupe_check ), tx_missing_active_auth ); validate_database(); @@ -1462,7 +1462,7 @@ BOOST_AUTO_TEST_CASE( withdraw_vesting_apply ) signed_transaction tx; tx.operations.push_back( op ); tx.set_expiration( db->head_block_time() + STEEM_MAX_TIME_UNTIL_EXPIRATION ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); BOOST_REQUIRE( alice.vesting_shares.amount.value == old_vesting_shares.amount.value ); @@ -1478,7 +1478,7 @@ BOOST_AUTO_TEST_CASE( withdraw_vesting_apply ) op.vesting_shares = asset( alice.vesting_shares.amount / 3, VESTS_SYMBOL ); tx.operations.push_back( op ); tx.set_expiration( db->head_block_time() + STEEM_MAX_TIME_UNTIL_EXPIRATION ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); BOOST_REQUIRE( alice.vesting_shares.amount.value == old_vesting_shares.amount.value ); @@ -1495,7 +1495,7 @@ BOOST_AUTO_TEST_CASE( withdraw_vesting_apply ) op.vesting_shares = asset( alice.vesting_shares.amount * 2, VESTS_SYMBOL ); tx.operations.push_back( op ); tx.set_expiration( db->head_block_time() + STEEM_MAX_TIME_UNTIL_EXPIRATION ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), fc::exception ); BOOST_REQUIRE( alice.vesting_shares.amount.value == old_vesting_shares.amount.value ); @@ -1510,7 +1510,7 @@ BOOST_AUTO_TEST_CASE( withdraw_vesting_apply ) op.vesting_shares = asset( 0, VESTS_SYMBOL ); tx.operations.push_back( op ); tx.set_expiration( db->head_block_time() + STEEM_MAX_TIME_UNTIL_EXPIRATION ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); BOOST_REQUIRE( alice.vesting_shares.amount.value == old_vesting_shares.amount.value ); @@ -1523,7 +1523,7 @@ BOOST_AUTO_TEST_CASE( withdraw_vesting_apply ) op.vesting_shares = alice.vesting_shares; tx.clear(); tx.operations.push_back( op ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); generate_block(); } @@ -1552,7 +1552,7 @@ BOOST_AUTO_TEST_CASE( withdraw_vesting_apply ) op.vesting_shares = ASSET( "0.000000 VESTS" ); tx.operations.push_back( op ); tx.set_expiration( db->head_block_time() + STEEM_MAX_TIME_UNTIL_EXPIRATION ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); BOOST_REQUIRE( db->get_account( "alice" ).vesting_withdraw_rate == ASSET( "0.000000 VESTS" ) ); @@ -1597,28 +1597,28 @@ BOOST_AUTO_TEST_CASE( witness_update_authorities ) STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), tx_missing_active_auth ); BOOST_TEST_MESSAGE( "--- Test failure when signed by a signature not in the account's authority" ); - tx.sign( alice_post_key, db->get_chain_id() ); + sign( tx, alice_post_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), tx_missing_active_auth ); BOOST_TEST_MESSAGE( "--- Test failure when duplicate signatures" ); tx.signatures.clear(); - tx.sign( alice_private_key, db->get_chain_id() ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); + sign( tx, alice_private_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), tx_duplicate_sig ); BOOST_TEST_MESSAGE( "--- Test failure when signed by an additional signature not in the creator's authority" ); tx.signatures.clear(); - tx.sign( alice_private_key, db->get_chain_id() ); - tx.sign( bob_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); + sign( tx, bob_private_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), tx_irrelevant_sig ); BOOST_TEST_MESSAGE( "--- Test success with witness signature" ); tx.signatures.clear(); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); tx.signatures.clear(); - tx.sign( signing_key, db->get_chain_id() ); + sign( tx, signing_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, database::skip_transaction_dupe_check ), tx_missing_active_auth ); validate_database(); } @@ -1649,7 +1649,7 @@ BOOST_AUTO_TEST_CASE( witness_update_apply ) signed_transaction tx; tx.set_expiration( db->head_block_time() + STEEM_MAX_TIME_UNTIL_EXPIRATION ); tx.operations.push_back( op ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); @@ -1678,7 +1678,7 @@ BOOST_AUTO_TEST_CASE( witness_update_apply ) tx.operations.clear(); op.url = "bar.foo"; tx.operations.push_back( op ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); @@ -1705,7 +1705,7 @@ BOOST_AUTO_TEST_CASE( witness_update_apply ) tx.operations.clear(); op.owner = "bob"; tx.operations.push_back( op ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), fc::exception ); validate_database(); } @@ -1747,30 +1747,30 @@ BOOST_AUTO_TEST_CASE( account_witness_vote_authorities ) STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), tx_missing_active_auth ); BOOST_TEST_MESSAGE( "--- Test failure when signed by a signature not in the account's authority" ); - tx.sign( bob_post_key, db->get_chain_id() ); + sign( tx, bob_post_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), tx_missing_active_auth ); BOOST_TEST_MESSAGE( "--- Test failure when duplicate signatures" ); tx.signatures.clear(); - tx.sign( bob_private_key, db->get_chain_id() ); - tx.sign( bob_private_key, db->get_chain_id() ); + sign( tx, bob_private_key ); + sign( tx, bob_private_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), tx_duplicate_sig ); BOOST_TEST_MESSAGE( "--- Test failure when signed by an additional signature not in the creator's authority" ); tx.signatures.clear(); - tx.sign( bob_private_key, db->get_chain_id() ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, bob_private_key ); + sign( tx, alice_private_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), tx_irrelevant_sig ); BOOST_TEST_MESSAGE( "--- Test success with witness signature" ); tx.signatures.clear(); - tx.sign( bob_private_key, db->get_chain_id() ); + sign( tx, bob_private_key ); db->push_transaction( tx, 0 ); BOOST_TEST_MESSAGE( "--- Test failure with proxy signature" ); proxy( "bob", "sam" ); tx.signatures.clear(); - tx.sign( sam_private_key, db->get_chain_id() ); + sign( tx, sam_private_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, database::skip_transaction_dupe_check ), tx_missing_active_auth ); validate_database(); @@ -1804,7 +1804,7 @@ BOOST_AUTO_TEST_CASE( account_witness_vote_apply ) signed_transaction tx; tx.set_expiration( db->head_block_time() + STEEM_MAX_TIME_UNTIL_EXPIRATION ); tx.operations.push_back( op ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); @@ -1817,7 +1817,7 @@ BOOST_AUTO_TEST_CASE( account_witness_vote_apply ) tx.operations.clear(); tx.signatures.clear(); tx.operations.push_back( op ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); BOOST_REQUIRE( sam_witness.votes.value == 0 ); @@ -1836,7 +1836,7 @@ BOOST_AUTO_TEST_CASE( account_witness_vote_apply ) op.approve = true; op.account = "bob"; tx.operations.push_back( op ); - tx.sign( bob_private_key, db->get_chain_id() ); + sign( tx, bob_private_key ); db->push_transaction( tx, 0 ); @@ -1849,7 +1849,7 @@ BOOST_AUTO_TEST_CASE( account_witness_vote_apply ) tx.signatures.clear(); op.account = "alice"; tx.operations.push_back( op ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, database::skip_transaction_dupe_check ), fc::exception ); BOOST_REQUIRE( sam_witness.votes == ( bob.proxied_vsf_votes_total() + bob.vesting_shares.amount ) ); @@ -1862,7 +1862,7 @@ BOOST_AUTO_TEST_CASE( account_witness_vote_apply ) op.account = "bob"; op.approve = false; tx.operations.push_back( op ); - tx.sign( bob_private_key, db->get_chain_id() ); + sign( tx, bob_private_key ); db->push_transaction( tx, 0 ); @@ -1876,7 +1876,7 @@ BOOST_AUTO_TEST_CASE( account_witness_vote_apply ) op.witness = "dave"; op.approve = true; tx.operations.push_back( op ); - tx.sign( bob_private_key, db->get_chain_id() ); + sign( tx, bob_private_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), fc::exception ); validate_database(); @@ -1886,7 +1886,7 @@ BOOST_AUTO_TEST_CASE( account_witness_vote_apply ) tx.signatures.clear(); op.witness = "alice"; tx.operations.push_back( op ); - tx.sign( bob_private_key, db->get_chain_id() ); + sign( tx, bob_private_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), fc::exception ); validate_database(); @@ -1925,29 +1925,29 @@ BOOST_AUTO_TEST_CASE( account_witness_proxy_authorities ) STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), tx_missing_active_auth ); BOOST_TEST_MESSAGE( "--- Test failure when signed by a signature not in the account's authority" ); - tx.sign( bob_post_key, db->get_chain_id() ); + sign( tx, bob_post_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), tx_missing_active_auth ); BOOST_TEST_MESSAGE( "--- Test failure when duplicate signatures" ); tx.signatures.clear(); - tx.sign( bob_private_key, db->get_chain_id() ); - tx.sign( bob_private_key, db->get_chain_id() ); + sign( tx, bob_private_key ); + sign( tx, bob_private_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), tx_duplicate_sig ); BOOST_TEST_MESSAGE( "--- Test failure when signed by an additional signature not in the creator's authority" ); tx.signatures.clear(); - tx.sign( bob_private_key, db->get_chain_id() ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, bob_private_key ); + sign( tx, alice_private_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), tx_irrelevant_sig ); BOOST_TEST_MESSAGE( "--- Test success with witness signature" ); tx.signatures.clear(); - tx.sign( bob_private_key, db->get_chain_id() ); + sign( tx, bob_private_key ); db->push_transaction( tx, 0 ); BOOST_TEST_MESSAGE( "--- Test failure with proxy signature" ); tx.signatures.clear(); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, database::skip_transaction_dupe_check ), tx_missing_active_auth ); validate_database(); @@ -1981,7 +1981,7 @@ BOOST_AUTO_TEST_CASE( account_witness_proxy_apply ) signed_transaction tx; tx.operations.push_back( op ); tx.set_expiration( db->head_block_time() + STEEM_MAX_TIME_UNTIL_EXPIRATION ); - tx.sign( bob_private_key, db->get_chain_id() ); + sign( tx, bob_private_key ); db->push_transaction( tx, 0 ); @@ -1998,7 +1998,7 @@ BOOST_AUTO_TEST_CASE( account_witness_proxy_apply ) tx.signatures.clear(); op.proxy = "sam"; tx.operations.push_back( op ); - tx.sign( bob_private_key, db->get_chain_id() ); + sign( tx, bob_private_key ); db->push_transaction( tx, 0 ); @@ -2027,7 +2027,7 @@ BOOST_AUTO_TEST_CASE( account_witness_proxy_apply ) op.proxy = "dave"; op.account = "sam"; tx.operations.push_back( op ); - tx.sign( sam_private_key, db->get_chain_id() ); + sign( tx, sam_private_key ); db->push_transaction( tx, 0 ); @@ -2049,7 +2049,7 @@ BOOST_AUTO_TEST_CASE( account_witness_proxy_apply ) op.proxy = "sam"; op.account = "alice"; tx.operations.push_back( op ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); @@ -2071,7 +2071,7 @@ BOOST_AUTO_TEST_CASE( account_witness_proxy_apply ) op.proxy = STEEM_PROXY_TO_SELF_ACCOUNT; op.account = "bob"; tx.operations.push_back( op ); - tx.sign( bob_private_key, db->get_chain_id() ); + sign( tx, bob_private_key ); db->push_transaction( tx, 0 ); @@ -2092,7 +2092,7 @@ BOOST_AUTO_TEST_CASE( account_witness_proxy_apply ) tx.operations.clear(); tx.signatures.clear(); tx.operations.push_back( vote ); - tx.sign( bob_private_key, db->get_chain_id() ); + sign( tx, bob_private_key ); db->push_transaction( tx, 0 ); @@ -2101,7 +2101,7 @@ BOOST_AUTO_TEST_CASE( account_witness_proxy_apply ) op.account = "alice"; op.proxy = "bob"; tx.operations.push_back( op ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); @@ -2113,7 +2113,7 @@ BOOST_AUTO_TEST_CASE( account_witness_proxy_apply ) tx.signatures.clear(); tx.operations.clear(); tx.operations.push_back( op ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); @@ -2235,23 +2235,23 @@ BOOST_AUTO_TEST_CASE( feed_publish_authorities ) BOOST_TEST_MESSAGE( "--- Test failure with incorrect signature" ); tx.signatures.clear(); - tx.sign( alice_post_key, db->get_chain_id() ); + sign( tx, alice_post_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, database::skip_transaction_dupe_check ), tx_missing_active_auth ); BOOST_TEST_MESSAGE( "--- Test failure with duplicate signature" ); - tx.sign( alice_private_key, db->get_chain_id() ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); + sign( tx, alice_private_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, database::skip_transaction_dupe_check ), tx_duplicate_sig ); BOOST_TEST_MESSAGE( "--- Test failure with additional incorrect signature" ); tx.signatures.clear(); - tx.sign( alice_private_key, db->get_chain_id() ); - tx.sign( bob_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); + sign( tx, bob_private_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, database::skip_transaction_dupe_check ), tx_irrelevant_sig ); BOOST_TEST_MESSAGE( "--- Test success with witness account signature" ); tx.signatures.clear(); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, database::skip_transaction_dupe_check ); validate_database(); @@ -2277,7 +2277,7 @@ BOOST_AUTO_TEST_CASE( feed_publish_apply ) signed_transaction tx; tx.set_expiration( db->head_block_time() + STEEM_MAX_TIME_UNTIL_EXPIRATION ); tx.operations.push_back( op ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); @@ -2292,7 +2292,7 @@ BOOST_AUTO_TEST_CASE( feed_publish_apply ) tx.operations.clear(); tx.signatures.clear(); op.publisher = "bob"; - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), fc::exception ); validate_database(); @@ -2302,7 +2302,7 @@ BOOST_AUTO_TEST_CASE( feed_publish_apply ) tx.operations.clear(); tx.signatures.clear(); op.exchange_rate = price( ASSET( "1.000 TBD" ), ASSET( "1.000 TESTS" ) ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), fc::assert_exception ); validate_database(); @@ -2314,7 +2314,7 @@ BOOST_AUTO_TEST_CASE( feed_publish_apply ) op.exchange_rate = price( ASSET(" 1.000 TBD" ), ASSET( "1500.000 TESTS" ) ); op.publisher = "alice"; tx.operations.push_back( op ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); @@ -2362,24 +2362,24 @@ BOOST_AUTO_TEST_CASE( convert_authorities ) STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), tx_missing_active_auth ); BOOST_TEST_MESSAGE( "--- Test failure when signed by a signature not in the account's authority" ); - tx.sign( alice_post_key, db->get_chain_id() ); + sign( tx, alice_post_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), tx_missing_active_auth ); BOOST_TEST_MESSAGE( "--- Test failure when duplicate signatures" ); tx.signatures.clear(); - tx.sign( alice_private_key, db->get_chain_id() ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); + sign( tx, alice_private_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), tx_duplicate_sig ); BOOST_TEST_MESSAGE( "--- Test failure when signed by an additional signature not in the creator's authority" ); tx.signatures.clear(); - tx.sign( alice_private_key, db->get_chain_id() ); - tx.sign( bob_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); + sign( tx, bob_private_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), tx_irrelevant_sig ); BOOST_TEST_MESSAGE( "--- Test success with owner signature" ); tx.signatures.clear(); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); validate_database(); @@ -2414,7 +2414,7 @@ BOOST_AUTO_TEST_CASE( convert_apply ) op.owner = "bob"; op.amount = ASSET( "5.000 TESTS" ); tx.operations.push_back( op ); - tx.sign( bob_private_key, db->get_chain_id() ); + sign( tx, bob_private_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), fc::exception ); BOOST_REQUIRE( new_bob.balance.amount.value == ASSET( "3.000 TESTS" ).amount.value ); @@ -2427,7 +2427,7 @@ BOOST_AUTO_TEST_CASE( convert_apply ) tx.operations.clear(); tx.signatures.clear(); tx.operations.push_back( op ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), fc::exception ); BOOST_REQUIRE( new_alice.balance.amount.value == ASSET( "7.500 TESTS" ).amount.value ); @@ -2439,7 +2439,7 @@ BOOST_AUTO_TEST_CASE( convert_apply ) tx.operations.clear(); tx.signatures.clear(); tx.operations.push_back( op ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), fc::exception ); BOOST_TEST_MESSAGE( "--- Test success converting SBD to TESTS" ); @@ -2449,7 +2449,7 @@ BOOST_AUTO_TEST_CASE( convert_apply ) tx.signatures.clear(); tx.operations.push_back( op ); tx.set_expiration( db->head_block_time() + STEEM_MAX_TIME_UNTIL_EXPIRATION ); - tx.sign( bob_private_key, db->get_chain_id() ); + sign( tx, bob_private_key ); db->push_transaction( tx, 0 ); BOOST_REQUIRE( new_bob.balance.amount.value == ASSET( "3.000 TESTS" ).amount.value ); @@ -2468,7 +2468,7 @@ BOOST_AUTO_TEST_CASE( convert_apply ) tx.operations.clear(); tx.signatures.clear(); tx.operations.push_back( op ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), fc::exception ); BOOST_REQUIRE( new_bob.balance.amount.value == ASSET( "3.000 TESTS" ).amount.value ); @@ -2533,22 +2533,22 @@ BOOST_AUTO_TEST_CASE( limit_order_create_authorities ) STEEM_REQUIRE_THROW( db->push_transaction( tx, database::skip_transaction_dupe_check ), tx_missing_active_auth ); BOOST_TEST_MESSAGE( "--- Test success with account signature" ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, database::skip_transaction_dupe_check ); BOOST_TEST_MESSAGE( "--- Test failure with duplicate signature" ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, database::skip_transaction_dupe_check ), tx_duplicate_sig ); BOOST_TEST_MESSAGE( "--- Test failure with additional incorrect signature" ); tx.signatures.clear(); - tx.sign( alice_private_key, db->get_chain_id() ); - tx.sign( bob_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); + sign( tx, bob_private_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, database::skip_transaction_dupe_check ), tx_irrelevant_sig ); BOOST_TEST_MESSAGE( "--- Test failure with incorrect signature" ); tx.signatures.clear(); - tx.sign( alice_post_key, db->get_chain_id() ); + sign( tx, alice_post_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, database::skip_transaction_dupe_check ), tx_missing_active_auth ); validate_database(); @@ -2582,7 +2582,7 @@ BOOST_AUTO_TEST_CASE( limit_order_create_apply ) op.fill_or_kill = false; tx.operations.push_back( op ); tx.set_expiration( db->head_block_time() + STEEM_MAX_TIME_UNTIL_EXPIRATION ); - tx.sign( bob_private_key, db->get_chain_id() ); + sign( tx, bob_private_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), fc::exception ); BOOST_REQUIRE( limit_order_idx.find( std::make_tuple( "bob", op.orderid ) ) == limit_order_idx.end() ); @@ -2597,7 +2597,7 @@ BOOST_AUTO_TEST_CASE( limit_order_create_apply ) tx.operations.clear(); tx.signatures.clear(); tx.operations.push_back( op ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), fc::exception ); BOOST_REQUIRE( limit_order_idx.find( std::make_tuple( "alice", op.orderid ) ) == limit_order_idx.end() ); @@ -2612,7 +2612,7 @@ BOOST_AUTO_TEST_CASE( limit_order_create_apply ) tx.operations.clear(); tx.signatures.clear(); tx.operations.push_back( op ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), fc::exception ); BOOST_REQUIRE( limit_order_idx.find( std::make_tuple( "alice", op.orderid ) ) == limit_order_idx.end() ); @@ -2627,7 +2627,7 @@ BOOST_AUTO_TEST_CASE( limit_order_create_apply ) tx.operations.clear(); tx.signatures.clear(); tx.operations.push_back( op ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); auto limit_order = limit_order_idx.find( std::make_tuple( "alice", op.orderid ) ); @@ -2647,7 +2647,7 @@ BOOST_AUTO_TEST_CASE( limit_order_create_apply ) tx.operations.clear(); tx.signatures.clear(); tx.operations.push_back( op ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), fc::exception ); limit_order = limit_order_idx.find( std::make_tuple( "alice", op.orderid ) ); @@ -2668,7 +2668,7 @@ BOOST_AUTO_TEST_CASE( limit_order_create_apply ) tx.operations.clear(); tx.signatures.clear(); tx.operations.push_back( op ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), fc::exception ); BOOST_REQUIRE( limit_order_idx.find( std::make_tuple( "alice", op.orderid ) ) == limit_order_idx.end() ); @@ -2688,7 +2688,7 @@ BOOST_AUTO_TEST_CASE( limit_order_create_apply ) tx.operations.clear(); tx.signatures.clear(); tx.operations.push_back( op ); - tx.sign( bob_private_key, db->get_chain_id() ); + sign( tx, bob_private_key ); db->push_transaction( tx, 0 ); auto recent_ops = get_last_operations( 1 ); @@ -2721,7 +2721,7 @@ BOOST_AUTO_TEST_CASE( limit_order_create_apply ) tx.operations.clear(); tx.signatures.clear(); tx.operations.push_back( op ); - tx.sign( bob_private_key, db->get_chain_id() ); + sign( tx, bob_private_key ); db->push_transaction( tx, 0 ); limit_order = limit_order_idx.find( std::make_tuple( "bob", 1 ) ); @@ -2747,7 +2747,7 @@ BOOST_AUTO_TEST_CASE( limit_order_create_apply ) tx.operations.clear(); tx.signatures.clear(); tx.operations.push_back( op ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); BOOST_REQUIRE( limit_order_idx.find( std::make_tuple( "alice", 3 ) ) == limit_order_idx.end() ); @@ -2767,7 +2767,7 @@ BOOST_AUTO_TEST_CASE( limit_order_create_apply ) tx.operations.clear(); tx.signatures.clear(); tx.operations.push_back( op ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); op.owner = "bob"; @@ -2777,7 +2777,7 @@ BOOST_AUTO_TEST_CASE( limit_order_create_apply ) tx.operations.clear(); tx.signatures.clear(); tx.operations.push_back( op ); - tx.sign( bob_private_key, db->get_chain_id() ); + sign( tx, bob_private_key ); db->push_transaction( tx, 0 ); limit_order = limit_order_idx.find( std::make_tuple( "bob", 4 ) ); @@ -2800,7 +2800,7 @@ BOOST_AUTO_TEST_CASE( limit_order_create_apply ) tx.operations.clear(); tx.signatures.clear(); tx.operations.push_back( can ); - tx.sign( bob_private_key, db->get_chain_id() ); + sign( tx, bob_private_key ); db->push_transaction( tx, 0 ); BOOST_TEST_MESSAGE( "--- Test filling limit order with better order when partial order is worse." ); @@ -2815,7 +2815,7 @@ BOOST_AUTO_TEST_CASE( limit_order_create_apply ) tx.operations.clear(); tx.signatures.clear(); tx.operations.push_back( op ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); op.owner = "bob"; @@ -2825,7 +2825,7 @@ BOOST_AUTO_TEST_CASE( limit_order_create_apply ) tx.operations.clear(); tx.signatures.clear(); tx.operations.push_back( op ); - tx.sign( bob_private_key, db->get_chain_id() ); + sign( tx, bob_private_key ); db->push_transaction( tx, 0 ); limit_order = limit_order_idx.find( std::make_tuple( "alice", 5 ) ); @@ -2867,22 +2867,22 @@ BOOST_AUTO_TEST_CASE( limit_order_create2_authorities ) STEEM_REQUIRE_THROW( db->push_transaction( tx, database::skip_transaction_dupe_check ), tx_missing_active_auth ); BOOST_TEST_MESSAGE( "--- Test success with account signature" ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, database::skip_transaction_dupe_check ); BOOST_TEST_MESSAGE( "--- Test failure with duplicate signature" ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, database::skip_transaction_dupe_check ), tx_duplicate_sig ); BOOST_TEST_MESSAGE( "--- Test failure with additional incorrect signature" ); tx.signatures.clear(); - tx.sign( alice_private_key, db->get_chain_id() ); - tx.sign( bob_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); + sign( tx, bob_private_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, database::skip_transaction_dupe_check ), tx_irrelevant_sig ); BOOST_TEST_MESSAGE( "--- Test failure with incorrect signature" ); tx.signatures.clear(); - tx.sign( alice_post_key, db->get_chain_id() ); + sign( tx, alice_post_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, database::skip_transaction_dupe_check ), tx_missing_active_auth ); validate_database(); @@ -2916,7 +2916,7 @@ BOOST_AUTO_TEST_CASE( limit_order_create2_apply ) op.fill_or_kill = false; tx.operations.push_back( op ); tx.set_expiration( db->head_block_time() + STEEM_MAX_TIME_UNTIL_EXPIRATION ); - tx.sign( bob_private_key, db->get_chain_id() ); + sign( tx, bob_private_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), fc::exception ); BOOST_REQUIRE( limit_order_idx.find( std::make_tuple( "bob", op.orderid ) ) == limit_order_idx.end() ); @@ -2951,7 +2951,7 @@ BOOST_AUTO_TEST_CASE( limit_order_create2_apply ) tx.operations.clear(); tx.signatures.clear(); tx.operations.push_back( op ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), fc::exception ); BOOST_REQUIRE( limit_order_idx.find( std::make_tuple( "alice", op.orderid ) ) == limit_order_idx.end() ); @@ -2966,7 +2966,7 @@ BOOST_AUTO_TEST_CASE( limit_order_create2_apply ) tx.operations.clear(); tx.signatures.clear(); tx.operations.push_back( op ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), fc::exception ); BOOST_REQUIRE( limit_order_idx.find( std::make_tuple( "alice", op.orderid ) ) == limit_order_idx.end() ); @@ -2981,7 +2981,7 @@ BOOST_AUTO_TEST_CASE( limit_order_create2_apply ) tx.operations.clear(); tx.signatures.clear(); tx.operations.push_back( op ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); auto limit_order = limit_order_idx.find( std::make_tuple( "alice", op.orderid ) ); @@ -3001,7 +3001,7 @@ BOOST_AUTO_TEST_CASE( limit_order_create2_apply ) tx.operations.clear(); tx.signatures.clear(); tx.operations.push_back( op ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), fc::exception ); limit_order = limit_order_idx.find( std::make_tuple( "alice", op.orderid ) ); @@ -3022,7 +3022,7 @@ BOOST_AUTO_TEST_CASE( limit_order_create2_apply ) tx.operations.clear(); tx.signatures.clear(); tx.operations.push_back( op ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), fc::exception ); BOOST_REQUIRE( limit_order_idx.find( std::make_tuple( "alice", op.orderid ) ) == limit_order_idx.end() ); @@ -3042,7 +3042,7 @@ BOOST_AUTO_TEST_CASE( limit_order_create2_apply ) tx.operations.clear(); tx.signatures.clear(); tx.operations.push_back( op ); - tx.sign( bob_private_key, db->get_chain_id() ); + sign( tx, bob_private_key ); db->push_transaction( tx, 0 ); auto recent_ops = get_last_operations( 1 ); @@ -3075,7 +3075,7 @@ BOOST_AUTO_TEST_CASE( limit_order_create2_apply ) tx.operations.clear(); tx.signatures.clear(); tx.operations.push_back( op ); - tx.sign( bob_private_key, db->get_chain_id() ); + sign( tx, bob_private_key ); db->push_transaction( tx, 0 ); limit_order = limit_order_idx.find( std::make_tuple( "bob", 1 ) ); @@ -3101,7 +3101,7 @@ BOOST_AUTO_TEST_CASE( limit_order_create2_apply ) tx.operations.clear(); tx.signatures.clear(); tx.operations.push_back( op ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); BOOST_REQUIRE( limit_order_idx.find( std::make_tuple( "alice", 3 ) ) == limit_order_idx.end() ); @@ -3121,7 +3121,7 @@ BOOST_AUTO_TEST_CASE( limit_order_create2_apply ) tx.operations.clear(); tx.signatures.clear(); tx.operations.push_back( op ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); op.owner = "bob"; @@ -3131,7 +3131,7 @@ BOOST_AUTO_TEST_CASE( limit_order_create2_apply ) tx.operations.clear(); tx.signatures.clear(); tx.operations.push_back( op ); - tx.sign( bob_private_key, db->get_chain_id() ); + sign( tx, bob_private_key ); db->push_transaction( tx, 0 ); limit_order = limit_order_idx.find( std::make_tuple( "bob", 4 ) ); @@ -3154,7 +3154,7 @@ BOOST_AUTO_TEST_CASE( limit_order_create2_apply ) tx.operations.clear(); tx.signatures.clear(); tx.operations.push_back( can ); - tx.sign( bob_private_key, db->get_chain_id() ); + sign( tx, bob_private_key ); db->push_transaction( tx, 0 ); BOOST_TEST_MESSAGE( "--- Test filling limit order with better order when partial order is worse." ); @@ -3170,7 +3170,7 @@ BOOST_AUTO_TEST_CASE( limit_order_create2_apply ) tx.operations.clear(); tx.signatures.clear(); tx.operations.push_back( op ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); op.owner = "bob"; @@ -3180,7 +3180,7 @@ BOOST_AUTO_TEST_CASE( limit_order_create2_apply ) tx.operations.clear(); tx.signatures.clear(); tx.operations.push_back( op ); - tx.sign( bob_private_key, db->get_chain_id() ); + sign( tx, bob_private_key ); db->push_transaction( tx, 0 ); limit_order = limit_order_idx.find( std::make_tuple( "alice", 5 ) ); @@ -3227,7 +3227,7 @@ BOOST_AUTO_TEST_CASE( limit_order_cancel_authorities ) signed_transaction tx; tx.operations.push_back( c ); tx.set_expiration( db->head_block_time() + STEEM_MAX_TIME_UNTIL_EXPIRATION ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); limit_order_cancel_operation op; @@ -3242,22 +3242,22 @@ BOOST_AUTO_TEST_CASE( limit_order_cancel_authorities ) STEEM_REQUIRE_THROW( db->push_transaction( tx, database::skip_transaction_dupe_check ), tx_missing_active_auth ); BOOST_TEST_MESSAGE( "--- Test success with account signature" ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, database::skip_transaction_dupe_check ); BOOST_TEST_MESSAGE( "--- Test failure with duplicate signature" ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, database::skip_transaction_dupe_check ), tx_duplicate_sig ); BOOST_TEST_MESSAGE( "--- Test failure with additional incorrect signature" ); tx.signatures.clear(); - tx.sign( alice_private_key, db->get_chain_id() ); - tx.sign( bob_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); + sign( tx, bob_private_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, database::skip_transaction_dupe_check ), tx_irrelevant_sig ); BOOST_TEST_MESSAGE( "--- Test failure with incorrect signature" ); tx.signatures.clear(); - tx.sign( alice_post_key, db->get_chain_id() ); + sign( tx, alice_post_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, database::skip_transaction_dupe_check ), tx_missing_active_auth ); validate_database(); @@ -3285,7 +3285,7 @@ BOOST_AUTO_TEST_CASE( limit_order_cancel_apply ) op.orderid = 5; tx.operations.push_back( op ); tx.set_expiration( db->head_block_time() + STEEM_MAX_TIME_UNTIL_EXPIRATION ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), fc::exception ); BOOST_TEST_MESSAGE( "--- Test cancel order" ); @@ -3298,7 +3298,7 @@ BOOST_AUTO_TEST_CASE( limit_order_cancel_apply ) tx.operations.clear(); tx.signatures.clear(); tx.operations.push_back( create ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); BOOST_REQUIRE( limit_order_idx.find( std::make_tuple( "alice", 5 ) ) != limit_order_idx.end() ); @@ -3306,7 +3306,7 @@ BOOST_AUTO_TEST_CASE( limit_order_cancel_apply ) tx.operations.clear(); tx.signatures.clear(); tx.operations.push_back( op ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); BOOST_REQUIRE( limit_order_idx.find( std::make_tuple( "alice", 5 ) ) == limit_order_idx.end() ); @@ -3369,7 +3369,7 @@ BOOST_AUTO_TEST_CASE( account_recovery ) signed_transaction tx; tx.operations.push_back( acc_create ); tx.set_expiration( db->head_block_time() + STEEM_MAX_TIME_UNTIL_EXPIRATION ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); const auto& bob_auth = db->get< account_authority_object, by_account >( "bob" ); @@ -3388,7 +3388,7 @@ BOOST_AUTO_TEST_CASE( account_recovery ) tx.signatures.clear(); tx.operations.push_back( acc_update ); - tx.sign( generate_private_key( "bob_owner" ), db->get_chain_id() ); + sign( tx, generate_private_key( "bob_owner" ) ); db->push_transaction( tx, 0 ); BOOST_REQUIRE( bob_auth.owner == *acc_update.owner ); @@ -3405,7 +3405,7 @@ BOOST_AUTO_TEST_CASE( account_recovery ) tx.signatures.clear(); tx.operations.push_back( request ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); BOOST_REQUIRE( bob_auth.owner == *acc_update.owner ); @@ -3424,8 +3424,8 @@ BOOST_AUTO_TEST_CASE( account_recovery ) tx.signatures.clear(); tx.operations.push_back( recover ); - tx.sign( generate_private_key( "bob_owner" ), db->get_chain_id() ); - tx.sign( generate_private_key( "new_key" ), db->get_chain_id() ); + sign( tx, generate_private_key( "bob_owner" ) ); + sign( tx, generate_private_key( "new_key" ) ); db->push_transaction( tx, 0 ); const auto& owner1 = db->get< account_authority_object, by_account >("bob").owner; @@ -3440,7 +3440,7 @@ BOOST_AUTO_TEST_CASE( account_recovery ) tx.signatures.clear(); tx.operations.push_back( request ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); @@ -3454,8 +3454,8 @@ BOOST_AUTO_TEST_CASE( account_recovery ) tx.signatures.clear(); tx.operations.push_back( recover ); - tx.sign( generate_private_key( "bob_owner" ), db->get_chain_id() ); - tx.sign( generate_private_key( "idontknow" ), db->get_chain_id() ); + sign( tx, generate_private_key( "bob_owner" ) ); + sign( tx, generate_private_key( "idontknow" ) ); STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), fc::exception ); const auto& owner2 = db->get< account_authority_object, by_account >("bob").owner; BOOST_REQUIRE( owner2 == authority( 1, generate_private_key( "new_key" ).get_public_key(), 1 ) ); @@ -3470,8 +3470,8 @@ BOOST_AUTO_TEST_CASE( account_recovery ) tx.signatures.clear(); tx.operations.push_back( recover ); - tx.sign( generate_private_key( "foo bar" ), db->get_chain_id() ); - tx.sign( generate_private_key( "idontknow" ), db->get_chain_id() ); + sign( tx, generate_private_key( "foo bar" ) ); + sign( tx, generate_private_key( "idontknow" ) ); STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), fc::exception ); const auto& owner3 = db->get< account_authority_object, by_account >("bob").owner; BOOST_REQUIRE( owner3 == authority( 1, generate_private_key( "new_key" ).get_public_key(), 1 ) ); @@ -3486,8 +3486,8 @@ BOOST_AUTO_TEST_CASE( account_recovery ) tx.signatures.clear(); tx.operations.push_back( recover ); - tx.sign( generate_private_key( "bob_owner" ), db->get_chain_id() ); - tx.sign( generate_private_key( "foo bar" ), db->get_chain_id() ); + sign( tx, generate_private_key( "bob_owner" ) ); + sign( tx, generate_private_key( "foo bar" ) ); db->push_transaction( tx, 0 ); const auto& owner4 = db->get< account_authority_object, by_account >("bob").owner; @@ -3501,7 +3501,7 @@ BOOST_AUTO_TEST_CASE( account_recovery ) tx.signatures.clear(); tx.operations.push_back( request ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); const auto& request_idx = db->get_index< account_recovery_request_index >().indices(); @@ -3531,8 +3531,8 @@ BOOST_AUTO_TEST_CASE( account_recovery ) tx.operations.push_back( recover ); tx.set_expiration( db->head_block_time() ); - tx.sign( generate_private_key( "expire" ), db->get_chain_id() ); - tx.sign( generate_private_key( "bob_owner" ), db->get_chain_id() ); + sign( tx, generate_private_key( "expire" ) ); + sign( tx, generate_private_key( "bob_owner" ) ); STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), fc::exception ); const auto& owner5 = db->get< account_authority_object, by_account >("bob").owner; BOOST_REQUIRE( owner5 == authority( 1, generate_private_key( "foo bar" ).get_public_key(), 1 ) ); @@ -3546,7 +3546,7 @@ BOOST_AUTO_TEST_CASE( account_recovery ) tx.operations.push_back( acc_update ); tx.set_expiration( db->head_block_time() + STEEM_MAX_TIME_UNTIL_EXPIRATION ); - tx.sign( generate_private_key( "foo bar" ), db->get_chain_id() ); + sign( tx, generate_private_key( "foo bar" ) ); db->push_transaction( tx, 0 ); generate_blocks( db->head_block_time() + ( STEEM_OWNER_AUTH_RECOVERY_PERIOD - STEEM_ACCOUNT_RECOVERY_REQUEST_EXPIRATION_PERIOD ) ); @@ -3559,7 +3559,7 @@ BOOST_AUTO_TEST_CASE( account_recovery ) tx.operations.push_back( request ); tx.set_expiration( db->head_block_time() + STEEM_MAX_TIME_UNTIL_EXPIRATION ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); recover.new_owner_authority = request.new_owner_authority; @@ -3570,8 +3570,8 @@ BOOST_AUTO_TEST_CASE( account_recovery ) tx.operations.push_back( recover ); tx.set_expiration( db->head_block_time() + STEEM_MAX_TIME_UNTIL_EXPIRATION ); - tx.sign( generate_private_key( "bob_owner" ), db->get_chain_id() ); - tx.sign( generate_private_key( "last key" ), db->get_chain_id() ); + sign( tx, generate_private_key( "bob_owner" ) ); + sign( tx, generate_private_key( "last key" ) ); STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), fc::exception ); const auto& owner6 = db->get< account_authority_object, by_account >("bob").owner; BOOST_REQUIRE( owner6 == authority( 1, generate_private_key( "new_key" ).get_public_key(), 1 ) ); @@ -3583,8 +3583,8 @@ BOOST_AUTO_TEST_CASE( account_recovery ) tx.operations.push_back( recover ); tx.set_expiration( db->head_block_time() + STEEM_MAX_TIME_UNTIL_EXPIRATION ); - tx.sign( generate_private_key( "foo bar" ), db->get_chain_id() ); - tx.sign( generate_private_key( "last key" ), db->get_chain_id() ); + sign( tx, generate_private_key( "foo bar" ) ); + sign( tx, generate_private_key( "last key" ) ); db->push_transaction( tx, 0 ); const auto& owner7 = db->get< account_authority_object, by_account >("bob").owner; BOOST_REQUIRE( owner7 == authority( 1, generate_private_key( "last key" ).get_public_key(), 1 ) ); @@ -3609,7 +3609,7 @@ BOOST_AUTO_TEST_CASE( change_recovery_account ) signed_transaction tx; tx.operations.push_back( op ); tx.set_expiration( db->head_block_time() + STEEM_MAX_TIME_UNTIL_EXPIRATION ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); }; @@ -3623,14 +3623,14 @@ BOOST_AUTO_TEST_CASE( change_recovery_account ) signed_transaction tx; tx.operations.push_back( op ); tx.set_expiration( db->head_block_time() + STEEM_MAX_TIME_UNTIL_EXPIRATION ); - tx.sign( recent_owner_key, db->get_chain_id() ); + sign( tx, recent_owner_key ); // only Alice -> throw STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), fc::exception ); tx.signatures.clear(); - tx.sign( new_owner_key, db->get_chain_id() ); + sign( tx, new_owner_key ); // only Sam -> throw STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), fc::exception ); - tx.sign( recent_owner_key, db->get_chain_id() ); + sign( tx, recent_owner_key ); // Alice+Sam -> OK db->push_transaction( tx, 0 ); }; @@ -3645,7 +3645,7 @@ BOOST_AUTO_TEST_CASE( change_recovery_account ) signed_transaction tx; tx.operations.push_back( op ); tx.set_expiration( db->head_block_time() + STEEM_MAX_TIME_UNTIL_EXPIRATION ); - tx.sign( recovery_account_key, db->get_chain_id() ); + sign( tx, recovery_account_key ); db->push_transaction( tx, 0 ); }; @@ -3658,7 +3658,7 @@ BOOST_AUTO_TEST_CASE( change_recovery_account ) signed_transaction tx; tx.operations.push_back( op ); tx.set_expiration( db->head_block_time() + STEEM_MAX_TIME_UNTIL_EXPIRATION ); - tx.sign( old_private_key, db->get_chain_id() ); + sign( tx, old_private_key ); db->push_transaction( tx, 0 ); }; @@ -3818,7 +3818,7 @@ BOOST_AUTO_TEST_CASE( escrow_transfer_apply ) signed_transaction tx; tx.operations.push_back( op ); tx.set_expiration( db->head_block_time() + STEEM_MAX_TIME_UNTIL_EXPIRATION ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), fc::exception ); BOOST_TEST_MESSAGE( "--- falure when from cannot cover amount + fee" ); @@ -3827,7 +3827,7 @@ BOOST_AUTO_TEST_CASE( escrow_transfer_apply ) tx.operations.clear(); tx.signatures.clear(); tx.operations.push_back( op ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), fc::exception ); BOOST_TEST_MESSAGE( "--- failure when ratification deadline is in the past" ); @@ -3836,7 +3836,7 @@ BOOST_AUTO_TEST_CASE( escrow_transfer_apply ) tx.operations.clear(); tx.signatures.clear(); tx.operations.push_back( op ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), fc::exception ); BOOST_TEST_MESSAGE( "--- failure when expiration is in the past" ); @@ -3844,7 +3844,7 @@ BOOST_AUTO_TEST_CASE( escrow_transfer_apply ) tx.operations.clear(); tx.signatures.clear(); tx.operations.push_back( op ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), fc::exception ); BOOST_TEST_MESSAGE( "--- success" ); @@ -3853,7 +3853,7 @@ BOOST_AUTO_TEST_CASE( escrow_transfer_apply ) tx.operations.clear(); tx.signatures.clear(); tx.operations.push_back( op ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); auto alice_steem_balance = alice.balance - op.steem_amount - op.fee; auto alice_sbd_balance = alice.sbd_balance - op.sbd_amount; @@ -3980,7 +3980,7 @@ BOOST_AUTO_TEST_CASE( escrow_approve_apply ) signed_transaction tx; tx.operations.push_back( et_op ); tx.set_expiration( db->head_block_time() + STEEM_MAX_TIME_UNTIL_EXPIRATION ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); tx.operations.clear(); tx.signatures.clear(); @@ -3995,7 +3995,7 @@ BOOST_AUTO_TEST_CASE( escrow_approve_apply ) op.approve = true; tx.operations.push_back( op ); - tx.sign( dave_private_key, db->get_chain_id() ); + sign( tx, dave_private_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), fc::exception ); @@ -4007,7 +4007,7 @@ BOOST_AUTO_TEST_CASE( escrow_approve_apply ) tx.signatures.clear(); tx.operations.push_back( op ); - tx.sign( dave_private_key, db->get_chain_id() ); + sign( tx, dave_private_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), fc::exception ); @@ -4019,7 +4019,7 @@ BOOST_AUTO_TEST_CASE( escrow_approve_apply ) tx.signatures.clear(); tx.operations.push_back( op ); - tx.sign( bob_private_key, db->get_chain_id() ); + sign( tx, bob_private_key ); db->push_transaction( tx, 0 ); auto& escrow = db->get_escrow( op.from, op.escrow_id ); @@ -4039,7 +4039,7 @@ BOOST_AUTO_TEST_CASE( escrow_approve_apply ) tx.signatures.clear(); tx.set_expiration( db->head_block_time() + STEEM_BLOCK_INTERVAL ); - tx.sign( bob_private_key, db->get_chain_id() ); + sign( tx, bob_private_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), fc::exception ); BOOST_REQUIRE( escrow.to == "bob" ); @@ -4061,7 +4061,7 @@ BOOST_AUTO_TEST_CASE( escrow_approve_apply ) op.approve = false; tx.operations.push_back( op ); - tx.sign( bob_private_key, db->get_chain_id() ); + sign( tx, bob_private_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), fc::exception ); BOOST_REQUIRE( escrow.to == "bob" ); @@ -4083,7 +4083,7 @@ BOOST_AUTO_TEST_CASE( escrow_approve_apply ) op.who = op.agent; tx.operations.push_back( op ); - tx.sign( sam_private_key, db->get_chain_id() ); + sign( tx, sam_private_key ); db->push_transaction( tx, 0 ); STEEM_REQUIRE_THROW( db->get_escrow( op.from, op.escrow_id ), fc::exception ); @@ -4095,7 +4095,7 @@ BOOST_AUTO_TEST_CASE( escrow_approve_apply ) tx.operations.clear(); tx.signatures.clear(); tx.operations.push_back( et_op ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); generate_blocks( et_op.ratification_deadline + STEEM_BLOCK_INTERVAL, true ); @@ -4112,7 +4112,7 @@ BOOST_AUTO_TEST_CASE( escrow_approve_apply ) et_op.escrow_expiration = db->head_block_time() + 200; tx.operations.push_back( et_op ); tx.set_expiration( db->head_block_time() + STEEM_MAX_TIME_UNTIL_EXPIRATION ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); tx.operations.clear(); @@ -4120,7 +4120,7 @@ BOOST_AUTO_TEST_CASE( escrow_approve_apply ) op.who = op.to; op.approve = true; tx.operations.push_back( op ); - tx.sign( bob_private_key, db->get_chain_id() ); + sign( tx, bob_private_key ); db->push_transaction( tx, 0 ); generate_blocks( et_op.ratification_deadline + STEEM_BLOCK_INTERVAL, true ); @@ -4137,14 +4137,14 @@ BOOST_AUTO_TEST_CASE( escrow_approve_apply ) et_op.escrow_expiration = db->head_block_time() + 200; tx.operations.push_back( et_op ); tx.set_expiration( db->head_block_time() + STEEM_MAX_TIME_UNTIL_EXPIRATION ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); tx.operations.clear(); tx.signatures.clear(); op.who = op.agent; tx.operations.push_back( op ); - tx.sign( sam_private_key, db->get_chain_id() ); + sign( tx, sam_private_key ); db->push_transaction( tx, 0 ); generate_blocks( et_op.ratification_deadline + STEEM_BLOCK_INTERVAL, true ); @@ -4161,21 +4161,21 @@ BOOST_AUTO_TEST_CASE( escrow_approve_apply ) et_op.escrow_expiration = db->head_block_time() + 200; tx.operations.push_back( et_op ); tx.set_expiration( db->head_block_time() + STEEM_MAX_TIME_UNTIL_EXPIRATION ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); tx.operations.clear(); tx.signatures.clear(); op.who = op.to; tx.operations.push_back( op ); - tx.sign( bob_private_key, db->get_chain_id() ); + sign( tx, bob_private_key ); db->push_transaction( tx, 0 ); tx.operations.clear(); tx.signatures.clear(); op.who = op.agent; tx.operations.push_back( op ); - tx.sign( sam_private_key, db->get_chain_id() ); + sign( tx, sam_private_key ); db->push_transaction( tx, 0 ); { @@ -4306,8 +4306,8 @@ BOOST_AUTO_TEST_CASE( escrow_dispute_apply ) tx.operations.push_back( et_op ); tx.operations.push_back( ea_b_op ); tx.set_expiration( db->head_block_time() + STEEM_MAX_TIME_UNTIL_EXPIRATION ); - tx.sign( alice_private_key, db->get_chain_id() ); - tx.sign( bob_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); + sign( tx, bob_private_key ); db->push_transaction( tx, 0 ); @@ -4321,7 +4321,7 @@ BOOST_AUTO_TEST_CASE( escrow_dispute_apply ) tx.operations.clear(); tx.signatures.clear(); tx.operations.push_back( op ); - tx.sign( bob_private_key, db->get_chain_id() ); + sign( tx, bob_private_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), fc::exception ); const auto& escrow = db->get_escrow( et_op.from, et_op.escrow_id ); @@ -4348,7 +4348,7 @@ BOOST_AUTO_TEST_CASE( escrow_dispute_apply ) tx.operations.clear(); tx.signatures.clear(); tx.operations.push_back( ea_s_op ); - tx.sign( sam_private_key, db->get_chain_id() ); + sign( tx, sam_private_key ); db->push_transaction( tx, 0 ); op.to = "dave"; @@ -4356,7 +4356,7 @@ BOOST_AUTO_TEST_CASE( escrow_dispute_apply ) tx.operations.clear(); tx.signatures.clear(); tx.operations.push_back( op ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), fc::exception ); BOOST_REQUIRE( escrow.to == "bob" ); @@ -4378,7 +4378,7 @@ BOOST_AUTO_TEST_CASE( escrow_dispute_apply ) tx.operations.clear(); tx.signatures.clear(); tx.operations.push_back( op ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), fc::exception ); BOOST_REQUIRE( escrow.to == "bob" ); @@ -4401,7 +4401,7 @@ BOOST_AUTO_TEST_CASE( escrow_dispute_apply ) op.agent = "sam"; tx.operations.push_back( op ); tx.set_expiration( db->head_block_time() + STEEM_MAX_TIME_UNTIL_EXPIRATION ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), fc::exception ); { @@ -4431,16 +4431,16 @@ BOOST_AUTO_TEST_CASE( escrow_dispute_apply ) tx.operations.push_back( et_op ); tx.operations.push_back( ea_b_op ); tx.operations.push_back( ea_s_op ); - tx.sign( alice_private_key, db->get_chain_id() ); - tx.sign( bob_private_key, db->get_chain_id() ); - tx.sign( sam_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); + sign( tx, bob_private_key ); + sign( tx, sam_private_key ); db->push_transaction( tx, 0 ); tx.operations.clear(); tx.signatures.clear(); op.escrow_id = et_op.escrow_id; tx.operations.push_back( op ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); { @@ -4463,7 +4463,7 @@ BOOST_AUTO_TEST_CASE( escrow_dispute_apply ) tx.signatures.clear(); op.who = "bob"; tx.operations.push_back( op ); - tx.sign( bob_private_key, db->get_chain_id() ); + sign( tx, bob_private_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), fc::exception ); { @@ -4592,7 +4592,7 @@ BOOST_AUTO_TEST_CASE( escrow_release_apply ) tx.operations.push_back( et_op ); tx.set_expiration( db->head_block_time() + STEEM_MAX_TIME_UNTIL_EXPIRATION ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); @@ -4607,7 +4607,7 @@ BOOST_AUTO_TEST_CASE( escrow_release_apply ) tx.clear(); tx.operations.push_back( op ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), fc::exception ); escrow_approve_operation ea_b_op; @@ -4625,15 +4625,15 @@ BOOST_AUTO_TEST_CASE( escrow_release_apply ) tx.clear(); tx.operations.push_back( ea_b_op ); tx.operations.push_back( ea_s_op ); - tx.sign( bob_private_key, db->get_chain_id() ); - tx.sign( sam_private_key, db->get_chain_id() ); + sign( tx, bob_private_key ); + sign( tx, sam_private_key ); db->push_transaction( tx, 0 ); BOOST_TEST_MESSAGE( "--- failure when 'agent' attempts to release non-disputed escrow to 'to'" ); op.who = et_op.agent; tx.clear(); tx.operations.push_back( op ); - tx.sign( sam_private_key, db->get_chain_id() ); + sign( tx, sam_private_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), fc::exception ); @@ -4642,7 +4642,7 @@ BOOST_AUTO_TEST_CASE( escrow_release_apply ) tx.clear(); tx.operations.push_back( op ); - tx.sign( sam_private_key, db->get_chain_id() ); + sign( tx, sam_private_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), fc::exception ); @@ -4651,7 +4651,7 @@ BOOST_AUTO_TEST_CASE( escrow_release_apply ) tx.clear(); tx.operations.push_back( op ); - tx.sign( sam_private_key, db->get_chain_id() ); + sign( tx, sam_private_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), fc::exception ); @@ -4661,7 +4661,7 @@ BOOST_AUTO_TEST_CASE( escrow_release_apply ) tx.clear(); tx.operations.push_back( op ); - tx.sign( dave_private_key, db->get_chain_id() ); + sign( tx, dave_private_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), fc::exception ); @@ -4670,7 +4670,7 @@ BOOST_AUTO_TEST_CASE( escrow_release_apply ) tx.clear(); tx.operations.push_back( op ); - tx.sign( dave_private_key, db->get_chain_id() ); + sign( tx, dave_private_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), fc::exception ); @@ -4679,7 +4679,7 @@ BOOST_AUTO_TEST_CASE( escrow_release_apply ) tx.clear(); tx.operations.push_back( op ); - tx.sign( dave_private_key, db->get_chain_id() ); + sign( tx, dave_private_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), fc::exception ); @@ -4689,7 +4689,7 @@ BOOST_AUTO_TEST_CASE( escrow_release_apply ) tx.clear(); tx.operations.push_back( op ); - tx.sign( bob_private_key, db->get_chain_id() ); + sign( tx, bob_private_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), fc::exception ); @@ -4698,7 +4698,7 @@ BOOST_AUTO_TEST_CASE( escrow_release_apply ) tx.clear(); tx.operations.push_back( op ); - tx.sign( bob_private_key, db->get_chain_id() ); + sign( tx, bob_private_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), fc::exception ); @@ -4707,7 +4707,7 @@ BOOST_AUTO_TEST_CASE( escrow_release_apply ) tx.clear(); tx.operations.push_back( op ); - tx.sign( bob_private_key, db->get_chain_id() ); + sign( tx, bob_private_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), fc::exception ); @@ -4716,7 +4716,7 @@ BOOST_AUTO_TEST_CASE( escrow_release_apply ) tx.clear(); tx.operations.push_back( op ); - tx.sign( bob_private_key, db->get_chain_id() ); + sign( tx, bob_private_key ); db->push_transaction( tx, 0 ); BOOST_REQUIRE( db->get_escrow( op.from, op.escrow_id ).steem_balance == ASSET( "0.900 TESTS" ) ); @@ -4729,7 +4729,7 @@ BOOST_AUTO_TEST_CASE( escrow_release_apply ) tx.clear(); tx.operations.push_back( op ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), fc::exception ); @@ -4738,7 +4738,7 @@ BOOST_AUTO_TEST_CASE( escrow_release_apply ) tx.clear(); tx.operations.push_back( op ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), fc::exception ); @@ -4747,7 +4747,7 @@ BOOST_AUTO_TEST_CASE( escrow_release_apply ) tx.clear(); tx.operations.push_back( op ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), fc::exception ); @@ -4756,7 +4756,7 @@ BOOST_AUTO_TEST_CASE( escrow_release_apply ) tx.clear(); tx.operations.push_back( op ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); BOOST_REQUIRE( db->get_escrow( op.from, op.escrow_id ).steem_balance == ASSET( "0.800 TESTS" ) ); @@ -4768,7 +4768,7 @@ BOOST_AUTO_TEST_CASE( escrow_release_apply ) tx.clear(); tx.operations.push_back( op ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), fc::exception ); @@ -4778,7 +4778,7 @@ BOOST_AUTO_TEST_CASE( escrow_release_apply ) tx.clear(); tx.operations.push_back( op ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), fc::exception ); @@ -4791,7 +4791,7 @@ BOOST_AUTO_TEST_CASE( escrow_release_apply ) tx.clear(); tx.operations.push_back( ed_op ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); tx.clear(); @@ -4801,7 +4801,7 @@ BOOST_AUTO_TEST_CASE( escrow_release_apply ) op.steem_amount = ASSET( "0.100 TESTS" ); op.sbd_amount = ASSET( "0.000 TBD" ); tx.operations.push_back( op ); - tx.sign( bob_private_key, db->get_chain_id() ); + sign( tx, bob_private_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), fc::exception ); @@ -4810,7 +4810,7 @@ BOOST_AUTO_TEST_CASE( escrow_release_apply ) op.receiver = et_op.to; op.who = et_op.from; tx.operations.push_back( op ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), fc::exception ); @@ -4819,7 +4819,7 @@ BOOST_AUTO_TEST_CASE( escrow_release_apply ) op.who = et_op.agent; op.receiver = "dave"; tx.operations.push_back( op ); - tx.sign( sam_private_key, db->get_chain_id() ); + sign( tx, sam_private_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), fc::exception ); @@ -4828,7 +4828,7 @@ BOOST_AUTO_TEST_CASE( escrow_release_apply ) op.who = "dave"; op.receiver = et_op.from; tx.operations.push_back( op ); - tx.sign( dave_private_key, db->get_chain_id() ); + sign( tx, dave_private_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), fc::exception ); @@ -4837,7 +4837,7 @@ BOOST_AUTO_TEST_CASE( escrow_release_apply ) op.receiver = et_op.to; op.who = et_op.agent; tx.operations.push_back( op ); - tx.sign( sam_private_key, db->get_chain_id() ); + sign( tx, sam_private_key ); db->push_transaction( tx, 0 ); BOOST_REQUIRE( db->get_account( "bob" ).balance == ASSET( "0.200 TESTS" ) ); @@ -4849,7 +4849,7 @@ BOOST_AUTO_TEST_CASE( escrow_release_apply ) op.receiver = et_op.from; op.who = et_op.agent; tx.operations.push_back( op ); - tx.sign( sam_private_key, db->get_chain_id() ); + sign( tx, sam_private_key ); db->push_transaction( tx, 0 ); BOOST_REQUIRE( db->get_account( "alice" ).balance == ASSET( "9.100 TESTS" ) ); @@ -4864,7 +4864,7 @@ BOOST_AUTO_TEST_CASE( escrow_release_apply ) op.who = et_op.to; tx.operations.push_back( op ); tx.set_expiration( db->head_block_time() + STEEM_MAX_TIME_UNTIL_EXPIRATION ); - tx.sign( bob_private_key, db->get_chain_id() ); + sign( tx, bob_private_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), fc::exception ); @@ -4873,7 +4873,7 @@ BOOST_AUTO_TEST_CASE( escrow_release_apply ) op.receiver = et_op.to; op.who = et_op.from; tx.operations.push_back( op ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), fc::exception ); @@ -4882,7 +4882,7 @@ BOOST_AUTO_TEST_CASE( escrow_release_apply ) op.receiver = et_op.from; op.who = et_op.agent; tx.operations.push_back( op ); - tx.sign( sam_private_key, db->get_chain_id() ); + sign( tx, sam_private_key ); db->push_transaction( tx, 0 ); BOOST_REQUIRE( db->get_account( "alice" ).balance == ASSET( "9.200 TESTS" ) ); @@ -4893,7 +4893,7 @@ BOOST_AUTO_TEST_CASE( escrow_release_apply ) tx.clear(); op.steem_amount = ASSET( "0.500 TESTS" ); tx.operations.push_back( op ); - tx.sign( sam_private_key, db->get_chain_id() ); + sign( tx, sam_private_key ); db->push_transaction( tx, 0 ); BOOST_REQUIRE( db->get_account( "alice" ).balance == ASSET( "9.700 TESTS" ) ); @@ -4907,9 +4907,9 @@ BOOST_AUTO_TEST_CASE( escrow_release_apply ) tx.operations.push_back( ea_b_op ); tx.operations.push_back( ea_s_op ); tx.set_expiration( db->head_block_time() + STEEM_MAX_TIME_UNTIL_EXPIRATION ); - tx.sign( alice_private_key, db->get_chain_id() ); - tx.sign( bob_private_key, db->get_chain_id() ); - tx.sign( sam_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); + sign( tx, bob_private_key ); + sign( tx, sam_private_key ); db->push_transaction( tx, 0 ); generate_blocks( 2 ); @@ -4920,7 +4920,7 @@ BOOST_AUTO_TEST_CASE( escrow_release_apply ) op.who = et_op.agent; op.steem_amount = ASSET( "0.100 TESTS" ); tx.operations.push_back( op ); - tx.sign( sam_private_key, db->get_chain_id() ); + sign( tx, sam_private_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), fc::exception ); @@ -4928,7 +4928,7 @@ BOOST_AUTO_TEST_CASE( escrow_release_apply ) tx.clear(); op.receiver = et_op.from; tx.operations.push_back( op ); - tx.sign( sam_private_key, db->get_chain_id() ); + sign( tx, sam_private_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), fc::exception ); @@ -4936,7 +4936,7 @@ BOOST_AUTO_TEST_CASE( escrow_release_apply ) tx.clear(); op.receiver = "dave"; tx.operations.push_back( op ); - tx.sign( sam_private_key, db->get_chain_id() ); + sign( tx, sam_private_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), fc::exception ); @@ -4945,7 +4945,7 @@ BOOST_AUTO_TEST_CASE( escrow_release_apply ) op.who = et_op.to; op.receiver = et_op.agent; tx.operations.push_back( op ); - tx.sign( bob_private_key, db->get_chain_id() ); + sign( tx, bob_private_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), fc::exception ); @@ -4953,7 +4953,7 @@ BOOST_AUTO_TEST_CASE( escrow_release_apply ) tx.clear(); op.receiver = "dave"; tx.operations.push_back( op ); - tx.sign( bob_private_key, db->get_chain_id() ); + sign( tx, bob_private_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), fc::exception ); @@ -4961,7 +4961,7 @@ BOOST_AUTO_TEST_CASE( escrow_release_apply ) tx.clear(); op.receiver = et_op.to; tx.operations.push_back( op ); - tx.sign( bob_private_key, db->get_chain_id() ); + sign( tx, bob_private_key ); db->push_transaction( tx, 0 ); BOOST_REQUIRE( db->get_account( "bob" ).balance == ASSET( "0.300 TESTS" ) ); @@ -4972,7 +4972,7 @@ BOOST_AUTO_TEST_CASE( escrow_release_apply ) tx.clear(); op.receiver = et_op.from; tx.operations.push_back( op ); - tx.sign( bob_private_key, db->get_chain_id() ); + sign( tx, bob_private_key ); db->push_transaction( tx, 0 ); BOOST_REQUIRE( db->get_account( "alice" ).balance == ASSET( "8.700 TESTS" ) ); @@ -4984,7 +4984,7 @@ BOOST_AUTO_TEST_CASE( escrow_release_apply ) op.who = et_op.from; op.receiver = et_op.agent; tx.operations.push_back( op ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), fc::exception ); @@ -4992,7 +4992,7 @@ BOOST_AUTO_TEST_CASE( escrow_release_apply ) tx.clear(); op.receiver = "dave"; tx.operations.push_back( op ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), fc::exception ); @@ -5000,7 +5000,7 @@ BOOST_AUTO_TEST_CASE( escrow_release_apply ) tx.clear(); op.receiver = et_op.to; tx.operations.push_back( op ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); BOOST_REQUIRE( db->get_account( "bob" ).balance == ASSET( "0.400 TESTS" ) ); @@ -5011,7 +5011,7 @@ BOOST_AUTO_TEST_CASE( escrow_release_apply ) tx.clear(); op.receiver = et_op.from; tx.operations.push_back( op ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); BOOST_REQUIRE( db->get_account( "alice" ).balance == ASSET( "8.800 TESTS" ) ); @@ -5022,7 +5022,7 @@ BOOST_AUTO_TEST_CASE( escrow_release_apply ) tx.clear(); op.steem_amount = ASSET( "0.600 TESTS" ); tx.operations.push_back( op ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); BOOST_REQUIRE( db->get_account( "alice" ).balance == ASSET( "9.400 TESTS" ) ); @@ -5136,7 +5136,7 @@ BOOST_AUTO_TEST_CASE( transfer_to_savings_apply ) tx.operations.push_back( op ); tx.set_expiration( db->head_block_time() + STEEM_MAX_TIME_UNTIL_EXPIRATION ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), fc::exception ); validate_database(); @@ -5147,7 +5147,7 @@ BOOST_AUTO_TEST_CASE( transfer_to_savings_apply ) tx.clear(); tx.operations.push_back( op ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), fc::exception ); validate_database(); @@ -5157,7 +5157,7 @@ BOOST_AUTO_TEST_CASE( transfer_to_savings_apply ) tx.clear(); tx.operations.push_back( op ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); BOOST_REQUIRE( db->get_account( "alice" ).balance == ASSET( "9.000 TESTS" ) ); @@ -5170,7 +5170,7 @@ BOOST_AUTO_TEST_CASE( transfer_to_savings_apply ) tx.clear(); tx.operations.push_back( op ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); BOOST_REQUIRE( db->get_account( "alice" ).sbd_balance == ASSET( "9.000 TBD" ) ); @@ -5184,7 +5184,7 @@ BOOST_AUTO_TEST_CASE( transfer_to_savings_apply ) tx.clear(); tx.operations.push_back( op ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); BOOST_REQUIRE( db->get_account( "alice" ).balance == ASSET( "8.000 TESTS" ) ); @@ -5197,7 +5197,7 @@ BOOST_AUTO_TEST_CASE( transfer_to_savings_apply ) tx.clear(); tx.operations.push_back( op ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); BOOST_REQUIRE( db->get_account( "alice" ).sbd_balance == ASSET( "8.000 TBD" ) ); @@ -5308,13 +5308,13 @@ BOOST_AUTO_TEST_CASE( transfer_from_savings_apply ) signed_transaction tx; tx.operations.push_back( save ); tx.set_expiration( db->head_block_time() + STEEM_MAX_TIME_UNTIL_EXPIRATION ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); save.amount = ASSET( "10.000 TBD" ); tx.clear(); tx.operations.push_back( save ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); @@ -5327,7 +5327,7 @@ BOOST_AUTO_TEST_CASE( transfer_from_savings_apply ) tx.clear(); tx.operations.push_back( op ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), fc::exception ); @@ -5337,7 +5337,7 @@ BOOST_AUTO_TEST_CASE( transfer_from_savings_apply ) tx.clear(); tx.operations.push_back( op ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), fc::exception ); @@ -5346,7 +5346,7 @@ BOOST_AUTO_TEST_CASE( transfer_from_savings_apply ) tx.clear(); tx.operations.push_back( op ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); BOOST_REQUIRE( db->get_account( "alice" ).balance == ASSET( "0.000 TESTS" ) ); @@ -5367,7 +5367,7 @@ BOOST_AUTO_TEST_CASE( transfer_from_savings_apply ) tx.clear(); tx.operations.push_back( op ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); BOOST_REQUIRE( db->get_account( "alice" ).sbd_balance == ASSET( "0.000 TBD" ) ); @@ -5387,7 +5387,7 @@ BOOST_AUTO_TEST_CASE( transfer_from_savings_apply ) tx.clear(); tx.operations.push_back( op ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), fc::exception ); @@ -5398,7 +5398,7 @@ BOOST_AUTO_TEST_CASE( transfer_from_savings_apply ) tx.clear(); tx.operations.push_back( op ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); BOOST_REQUIRE( db->get_account( "alice" ).balance == ASSET( "0.000 TESTS" ) ); @@ -5419,7 +5419,7 @@ BOOST_AUTO_TEST_CASE( transfer_from_savings_apply ) tx.clear(); tx.operations.push_back( op ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); BOOST_REQUIRE( db->get_account( "alice" ).sbd_balance == ASSET( "0.000 TBD" ) ); @@ -5464,7 +5464,7 @@ BOOST_AUTO_TEST_CASE( transfer_from_savings_apply ) op.request_id = i; tx.clear(); tx.operations.push_back( op ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); BOOST_REQUIRE( db->get_account( "alice" ).savings_withdraw_requests == i + 1 ); } @@ -5472,7 +5472,7 @@ BOOST_AUTO_TEST_CASE( transfer_from_savings_apply ) op.request_id = STEEM_SAVINGS_WITHDRAW_REQUEST_LIMIT; tx.clear(); tx.operations.push_back( op ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), fc::exception ); BOOST_REQUIRE( db->get_account( "alice" ).savings_withdraw_requests == STEEM_SAVINGS_WITHDRAW_REQUEST_LIMIT ); validate_database(); @@ -5561,7 +5561,7 @@ BOOST_AUTO_TEST_CASE( cancel_transfer_from_savings_apply ) tx.set_expiration( db->head_block_time() + STEEM_MAX_TIME_UNTIL_EXPIRATION ); tx.operations.push_back( save ); tx.operations.push_back( withdraw ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); validate_database(); @@ -5576,7 +5576,7 @@ BOOST_AUTO_TEST_CASE( cancel_transfer_from_savings_apply ) tx.clear(); tx.operations.push_back( op ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), fc::exception ); validate_database(); @@ -5589,7 +5589,7 @@ BOOST_AUTO_TEST_CASE( cancel_transfer_from_savings_apply ) tx.clear(); tx.operations.push_back( op ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); BOOST_REQUIRE( db->get_account( "alice" ).balance == ASSET( "0.000 TESTS" ) ); @@ -5647,7 +5647,7 @@ BOOST_AUTO_TEST_CASE( decline_voting_rights_apply ) signed_transaction tx; tx.set_expiration( db->head_block_time() + STEEM_MAX_TIME_UNTIL_EXPIRATION ); tx.operations.push_back( proxy ); - tx.sign( bob_private_key, db->get_chain_id() ); + sign( tx, bob_private_key ); db->push_transaction( tx, 0 ); @@ -5658,7 +5658,7 @@ BOOST_AUTO_TEST_CASE( decline_voting_rights_apply ) BOOST_TEST_MESSAGE( "--- success" ); tx.clear(); tx.operations.push_back( op ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); const auto& request_idx = db->get_index< decline_voting_rights_request_index >().indices().get< by_account >(); @@ -5672,7 +5672,7 @@ BOOST_AUTO_TEST_CASE( decline_voting_rights_apply ) tx.clear(); tx.operations.push_back( op ); tx.set_expiration( db->head_block_time() + STEEM_MAX_TIME_UNTIL_EXPIRATION ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), fc::exception ); @@ -5680,7 +5680,7 @@ BOOST_AUTO_TEST_CASE( decline_voting_rights_apply ) op.decline = false; tx.clear(); tx.operations.push_back( op ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); itr = request_idx.find( db->get_account( "alice" ).name ); @@ -5692,7 +5692,7 @@ BOOST_AUTO_TEST_CASE( decline_voting_rights_apply ) tx.clear(); tx.operations.push_back( op ); tx.set_expiration( db->head_block_time() + STEEM_MAX_TIME_UNTIL_EXPIRATION ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), fc::exception ); @@ -5700,7 +5700,7 @@ BOOST_AUTO_TEST_CASE( decline_voting_rights_apply ) op.decline = true; tx.clear(); tx.operations.push_back( op ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); generate_blocks( db->head_block_time() + STEEM_OWNER_AUTH_RECOVERY_PERIOD - fc::seconds( STEEM_BLOCK_INTERVAL ), true ); @@ -5713,7 +5713,7 @@ BOOST_AUTO_TEST_CASE( decline_voting_rights_apply ) tx.clear(); tx.operations.push_back( witness_vote ); tx.set_expiration( db->head_block_time() + STEEM_MAX_TIME_UNTIL_EXPIRATION ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); comment_operation comment; @@ -5730,7 +5730,7 @@ BOOST_AUTO_TEST_CASE( decline_voting_rights_apply ) tx.clear(); tx.operations.push_back( comment ); tx.operations.push_back( vote ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); validate_database(); @@ -5750,7 +5750,7 @@ BOOST_AUTO_TEST_CASE( decline_voting_rights_apply ) tx.clear(); tx.set_expiration( db->head_block_time() + STEEM_MAX_TIME_UNTIL_EXPIRATION ); tx.operations.push_back( witness_vote ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), fc::exception ); db->get< comment_vote_object, by_comment_voter >( boost::make_tuple( db->get_comment( "alice", string( "test" ) ).id, db->get_account( "alice" ).id ) ); @@ -5758,20 +5758,20 @@ BOOST_AUTO_TEST_CASE( decline_voting_rights_apply ) vote.weight = 0; tx.clear(); tx.operations.push_back( vote ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), fc::exception ); vote.weight = STEEM_1_PERCENT * 50; tx.clear(); tx.operations.push_back( vote ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), fc::exception ); proxy.account = "alice"; proxy.proxy = "bob"; tx.clear(); tx.operations.push_back( proxy ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), fc::exception ); } FC_LOG_AND_RETHROW() @@ -5802,7 +5802,7 @@ BOOST_AUTO_TEST_CASE( account_bandwidth ) tx.operations.push_back( op ); tx.set_expiration( db->head_block_time() + STEEM_MAX_TIME_UNTIL_EXPIRATION ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); @@ -5818,7 +5818,7 @@ BOOST_AUTO_TEST_CASE( account_bandwidth ) tx.clear(); tx.operations.push_back( op ); tx.set_expiration( db->head_block_time() + STEEM_MAX_TIME_UNTIL_EXPIRATION ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); @@ -5941,7 +5941,7 @@ BOOST_AUTO_TEST_CASE( account_create_with_delegation_authorities ) STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), tx_missing_active_auth ); BOOST_TEST_MESSAGE( "--- Test success with witness signature" ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); BOOST_TEST_MESSAGE( "--- Test failure when duplicate signatures" ); @@ -5949,19 +5949,19 @@ BOOST_AUTO_TEST_CASE( account_create_with_delegation_authorities ) tx.signatures.clear(); op.new_account_name = "sam"; tx.operations.push_back( op ); - tx.sign( alice_private_key, db->get_chain_id() ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); + sign( tx, alice_private_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), tx_duplicate_sig ); BOOST_TEST_MESSAGE( "--- Test failure when signed by an additional signature not in the creator's authority" ); tx.signatures.clear(); - tx.sign( init_account_priv_key, db->get_chain_id() ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, init_account_priv_key ); + sign( tx, alice_private_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), tx_irrelevant_sig ); BOOST_TEST_MESSAGE( "--- Test failure when signed by a signature not in the creator's authority" ); tx.signatures.clear(); - tx.sign( init_account_priv_key, db->get_chain_id() ); + sign( tx, init_account_priv_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), tx_missing_active_auth ); validate_database(); @@ -6013,14 +6013,14 @@ BOOST_AUTO_TEST_CASE( account_create_with_delegation_apply ) tx.operations.push_back( withdraw ); tx.operations.push_back( op ); tx.set_expiration( db->head_block_time() + STEEM_MAX_TIME_UNTIL_EXPIRATION ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), fc::assert_exception ); BOOST_TEST_MESSAGE( "--- Test success under normal conditions. " ); tx.clear(); tx.operations.push_back( op ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); const account_object& bob_acc = db->get_account( "bob" ); @@ -6050,7 +6050,7 @@ BOOST_AUTO_TEST_CASE( account_create_with_delegation_apply ) op.new_account_name = "sam"; tx.set_expiration( db->head_block_time() + STEEM_MAX_TIME_UNTIL_EXPIRATION ); tx.operations.push_back( op ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); BOOST_TEST_MESSAGE( "--- Test failure when insufficient funds to process transaction." ); @@ -6060,7 +6060,7 @@ BOOST_AUTO_TEST_CASE( account_create_with_delegation_apply ) op.new_account_name = "pam"; tx.set_expiration( db->head_block_time() + STEEM_MAX_TIME_UNTIL_EXPIRATION ); tx.operations.push_back( op ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), fc::exception ); @@ -6078,7 +6078,7 @@ BOOST_AUTO_TEST_CASE( account_create_with_delegation_apply ) delegate.delegatee = "bob"; delegate.vesting_shares = ASSET( "0.000000 VESTS" ); tx.operations.push_back( delegate ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); auto itr = db->get_index< vesting_delegation_expiration_index, by_id >().begin(); @@ -6145,7 +6145,7 @@ BOOST_AUTO_TEST_CASE( claim_reward_balance_apply ) tx.operations.push_back( op ); tx.set_expiration( db->head_block_time() + STEEM_MAX_TIME_UNTIL_EXPIRATION ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), fc::assert_exception ); @@ -6155,7 +6155,7 @@ BOOST_AUTO_TEST_CASE( claim_reward_balance_apply ) op.reward_vests = ASSET( "5.000000 VESTS" ); tx.clear(); tx.operations.push_back( op ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); BOOST_REQUIRE( db->get_account( "alice" ).balance == alice_steem + op.reward_steem ); @@ -6176,7 +6176,7 @@ BOOST_AUTO_TEST_CASE( claim_reward_balance_apply ) op.reward_sbd = ASSET( "10.000 TBD" ); tx.clear(); tx.operations.push_back( op ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); BOOST_REQUIRE( db->get_account( "alice" ).balance == alice_steem + op.reward_steem ); @@ -6226,7 +6226,7 @@ BOOST_AUTO_TEST_CASE( delegate_vesting_shares_authorities ) STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), tx_missing_active_auth ); BOOST_TEST_MESSAGE( "--- Test success with witness signature" ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); BOOST_TEST_MESSAGE( "--- Test failure when duplicate signatures" ); @@ -6234,19 +6234,19 @@ BOOST_AUTO_TEST_CASE( delegate_vesting_shares_authorities ) tx.signatures.clear(); op.delegatee = "sam"; tx.operations.push_back( op ); - tx.sign( alice_private_key, db->get_chain_id() ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); + sign( tx, alice_private_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), tx_duplicate_sig ); BOOST_TEST_MESSAGE( "--- Test failure when signed by an additional signature not in the creator's authority" ); tx.signatures.clear(); - tx.sign( init_account_priv_key, db->get_chain_id() ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, init_account_priv_key ); + sign( tx, alice_private_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), tx_irrelevant_sig ); BOOST_TEST_MESSAGE( "--- Test failure when signed by a signature not in the creator's authority" ); tx.signatures.clear(); - tx.sign( init_account_priv_key, db->get_chain_id() ); + sign( tx, init_account_priv_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), tx_missing_active_auth ); validate_database(); } @@ -6283,7 +6283,7 @@ BOOST_AUTO_TEST_CASE( delegate_vesting_shares_apply ) tx.set_expiration( db->head_block_time() + STEEM_MAX_TIME_UNTIL_EXPIRATION ); tx.operations.push_back( op ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); generate_blocks( 1 ); const account_object& alice_acc = db->get_account( "alice" ); @@ -6304,7 +6304,7 @@ BOOST_AUTO_TEST_CASE( delegate_vesting_shares_apply ) op.vesting_shares = ASSET( "20000000.000000 VESTS"); tx.set_expiration( db->head_block_time() + STEEM_MAX_TIME_UNTIL_EXPIRATION ); tx.operations.push_back( op ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); generate_blocks(1); @@ -6326,7 +6326,7 @@ BOOST_AUTO_TEST_CASE( delegate_vesting_shares_apply ) comment_op.body = "foo bar"; tx.operations.push_back( comment_op ); tx.set_expiration( db->head_block_time() + STEEM_MAX_TIME_UNTIL_EXPIRATION ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); tx.signatures.clear(); tx.operations.clear(); @@ -6337,7 +6337,7 @@ BOOST_AUTO_TEST_CASE( delegate_vesting_shares_apply ) vote_op.weight = STEEM_100_PERCENT; tx.set_expiration( db->head_block_time() + STEEM_MAX_TIME_UNTIL_EXPIRATION ); tx.operations.push_back( vote_op ); - tx.sign( bob_private_key, db->get_chain_id() ); + sign( tx, bob_private_key ); auto old_voting_power = bob_acc.voting_power; db->push_transaction( tx, 0 ); @@ -6366,7 +6366,7 @@ BOOST_AUTO_TEST_CASE( delegate_vesting_shares_apply ) op.delegator = "sam"; op.delegatee = "dave"; tx.set_expiration( db->head_block_time() + STEEM_MAX_TIME_UNTIL_EXPIRATION ); - tx.sign( sam_private_key, db->get_chain_id() ); + sign( tx, sam_private_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx ), fc::assert_exception ); @@ -6374,7 +6374,7 @@ BOOST_AUTO_TEST_CASE( delegate_vesting_shares_apply ) tx.clear(); op.vesting_shares = asset( sam_vest.amount + 1, VESTS_SYMBOL ); tx.operations.push_back( op ); - tx.sign( sam_private_key, db->get_chain_id() ); + sign( tx, sam_private_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx ), fc::assert_exception ); @@ -6385,19 +6385,19 @@ BOOST_AUTO_TEST_CASE( delegate_vesting_shares_apply ) withdraw.account = "sam"; withdraw.vesting_shares = sam_vest; tx.operations.push_back( withdraw ); - tx.sign( sam_private_key, db->get_chain_id() ); + sign( tx, sam_private_key ); db->push_transaction( tx, 0 ); tx.clear(); op.vesting_shares = asset( sam_vest.amount + 2, VESTS_SYMBOL ); tx.operations.push_back( op ); - tx.sign( sam_private_key, db->get_chain_id() ); + sign( tx, sam_private_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx ), fc::assert_exception ); tx.clear(); withdraw.vesting_shares = ASSET( "0.000000 VESTS" ); tx.operations.push_back( withdraw ); - tx.sign( sam_private_key, db->get_chain_id() ); + sign( tx, sam_private_key ); db->push_transaction( tx, 0 ); @@ -6406,13 +6406,13 @@ BOOST_AUTO_TEST_CASE( delegate_vesting_shares_apply ) op.vesting_shares = sam_vest; tx.clear(); tx.operations.push_back( op ); - tx.sign( sam_private_key, db->get_chain_id() ); + sign( tx, sam_private_key ); db->push_transaction( tx, 0 ); tx.clear(); withdraw.vesting_shares = asset( sam_vest.amount, VESTS_SYMBOL ); tx.operations.push_back( withdraw ); - tx.sign( sam_private_key, db->get_chain_id() ); + sign( tx, sam_private_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx ), fc::assert_exception ); @@ -6420,7 +6420,7 @@ BOOST_AUTO_TEST_CASE( delegate_vesting_shares_apply ) tx.clear(); op.vesting_shares = ASSET( "0.000000 VESTS" ); tx.operations.push_back( op ); - tx.sign( sam_private_key, db->get_chain_id() ); + sign( tx, sam_private_key ); db->push_transaction( tx, 0 ); auto exp_obj = db->get_index< vesting_delegation_expiration_index, by_id >().begin(); @@ -6477,7 +6477,7 @@ BOOST_AUTO_TEST_CASE( issue_971_vesting_removal ) tx.set_expiration( db->head_block_time() + STEEM_MAX_TIME_UNTIL_EXPIRATION ); tx.operations.push_back( op ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); generate_block(); const account_object& alice_acc = db->get_account( "alice" ); @@ -6502,7 +6502,7 @@ BOOST_AUTO_TEST_CASE( issue_971_vesting_removal ) tx.clear(); tx.operations.push_back( op ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); generate_block(); @@ -6607,7 +6607,7 @@ BOOST_AUTO_TEST_CASE( comment_beneficiaries_apply ) tx.operations.push_back( comment ); tx.set_expiration( db->head_block_time() + STEEM_MIN_TRANSACTION_EXPIRATION_LIMIT ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx ); BOOST_TEST_MESSAGE( "--- Test failure on more than 8 benefactors" ); @@ -6624,7 +6624,7 @@ BOOST_AUTO_TEST_CASE( comment_beneficiaries_apply ) op.extensions.insert( b ); tx.clear(); tx.operations.push_back( op ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx ), chain::plugin_exception ); @@ -6635,7 +6635,7 @@ BOOST_AUTO_TEST_CASE( comment_beneficiaries_apply ) op.extensions.insert( b ); tx.clear(); tx.operations.push_back( op ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx ), fc::assert_exception ); @@ -6654,15 +6654,15 @@ BOOST_AUTO_TEST_CASE( comment_beneficiaries_apply ) tx.clear(); tx.operations.push_back( vote ); tx.operations.push_back( op ); - tx.sign( alice_private_key, db->get_chain_id() ); - tx.sign( bob_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); + sign( tx, bob_private_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx ), fc::assert_exception ); BOOST_TEST_MESSAGE( "--- Test success" ); tx.clear(); tx.operations.push_back( op ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx ); @@ -6671,14 +6671,14 @@ BOOST_AUTO_TEST_CASE( comment_beneficiaries_apply ) b.beneficiaries.push_back( beneficiary_route_type( account_name_type( "dave" ), 25 * STEEM_1_PERCENT ) ); op.extensions.clear(); op.extensions.insert( b ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx ), fc::assert_exception ); BOOST_TEST_MESSAGE( "--- Payout and verify rewards were split properly" ); tx.clear(); tx.operations.push_back( vote ); - tx.sign( bob_private_key, db->get_chain_id() ); + sign( tx, bob_private_key ); db->push_transaction( tx, 0 ); generate_blocks( db->get_comment( "alice", string( "test" ) ).cashout_time - STEEM_BLOCK_INTERVAL ); @@ -6725,7 +6725,7 @@ BOOST_AUTO_TEST_CASE( witness_set_properties_validate ) signed_transaction tx; tx.set_expiration( db->head_block_time() + STEEM_MAX_TIME_UNTIL_EXPIRATION ); tx.operations.push_back( op ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); generate_block(); @@ -6843,7 +6843,7 @@ BOOST_AUTO_TEST_CASE( witness_set_properties_apply ) signed_transaction tx; tx.set_expiration( db->head_block_time() + STEEM_MAX_TIME_UNTIL_EXPIRATION ); tx.operations.push_back( op ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); BOOST_TEST_MESSAGE( "--- Test setting runtime parameters" ); @@ -6856,7 +6856,7 @@ BOOST_AUTO_TEST_CASE( witness_set_properties_apply ) prop_op.props[ "account_creation_fee" ] = fc::raw::pack( ASSET( "2.000 TESTS" ) ); tx.clear(); tx.operations.push_back( prop_op ); - tx.sign( signing_key, db->get_chain_id() ); + sign( tx, signing_key ); db->push_transaction( tx, 0 ); BOOST_REQUIRE( alice_witness.props.account_creation_fee == ASSET( "2.000 TESTS" ) ); @@ -6865,7 +6865,7 @@ BOOST_AUTO_TEST_CASE( witness_set_properties_apply ) prop_op.props[ "maximum_block_size" ] = fc::raw::pack( STEEM_MIN_BLOCK_SIZE_LIMIT + 1 ); tx.clear(); tx.operations.push_back( prop_op ); - tx.sign( signing_key, db->get_chain_id() ); + sign( tx, signing_key ); db->push_transaction( tx, 0 ); BOOST_REQUIRE( alice_witness.props.maximum_block_size == STEEM_MIN_BLOCK_SIZE_LIMIT + 1 ); @@ -6874,7 +6874,7 @@ BOOST_AUTO_TEST_CASE( witness_set_properties_apply ) prop_op.props[ "sbd_interest_rate" ] = fc::raw::pack( 700 ); tx.clear(); tx.operations.push_back( prop_op ); - tx.sign( signing_key, db->get_chain_id() ); + sign( tx, signing_key ); db->push_transaction( tx, 0 ); BOOST_REQUIRE( alice_witness.props.sbd_interest_rate == 700 ); @@ -6886,7 +6886,7 @@ BOOST_AUTO_TEST_CASE( witness_set_properties_apply ) prop_op.props[ "new_signing_key" ] = fc::raw::pack( alice_pub ); tx.clear(); tx.operations.push_back( prop_op ); - tx.sign( old_signing_key, db->get_chain_id() ); + sign( tx, old_signing_key ); db->push_transaction( tx, 0 ); BOOST_REQUIRE( alice_witness.signing_key == alice_pub ); @@ -6897,7 +6897,7 @@ BOOST_AUTO_TEST_CASE( witness_set_properties_apply ) prop_op.props[ "sbd_exchange_rate" ] = fc::raw::pack( price( ASSET(" 1.000 TBD" ), ASSET( "100.000 TESTS" ) ) ); tx.clear(); tx.operations.push_back( prop_op ); - tx.sign( signing_key, db->get_chain_id() ); + sign( tx, signing_key ); db->push_transaction( tx, 0 ); BOOST_REQUIRE( alice_witness.sbd_exchange_rate == price( ASSET( "1.000 TBD" ), ASSET( "100.000 TESTS" ) ) ); BOOST_REQUIRE( alice_witness.last_sbd_exchange_update == db->head_block_time() ); @@ -6907,7 +6907,7 @@ BOOST_AUTO_TEST_CASE( witness_set_properties_apply ) prop_op.props[ "url" ] = fc::raw::pack( "foo.bar" ); tx.clear(); tx.operations.push_back( prop_op ); - tx.sign( signing_key, db->get_chain_id() ); + sign( tx, signing_key ); db->push_transaction( tx, 0 ); BOOST_REQUIRE( alice_witness.url == "foo.bar" ); @@ -6916,7 +6916,7 @@ BOOST_AUTO_TEST_CASE( witness_set_properties_apply ) prop_op.props[ "extranious_property" ] = fc::raw::pack( "foo" ); tx.clear(); tx.operations.push_back( prop_op ); - tx.sign( signing_key, db->get_chain_id() ); + sign( tx, signing_key ); db->push_transaction( tx, 0 ); BOOST_TEST_MESSAGE( "--- Testing failure when 'key' does not match witness signing key" ); @@ -6925,7 +6925,7 @@ BOOST_AUTO_TEST_CASE( witness_set_properties_apply ) prop_op.props[ "key" ] = fc::raw::pack( old_signing_key.get_public_key() ); tx.clear(); tx.operations.push_back( prop_op ); - tx.sign( old_signing_key, db->get_chain_id() ); + sign( tx, old_signing_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), fc::assert_exception ); BOOST_TEST_MESSAGE( "--- Testing setting account subsidy limit" ); @@ -6934,7 +6934,7 @@ BOOST_AUTO_TEST_CASE( witness_set_properties_apply ) prop_op.props[ "account_subsidy_limit" ] = fc::raw::pack( 1000 ); tx.clear(); tx.operations.push_back( prop_op ); - tx.sign( signing_key, db->get_chain_id() ); + sign( tx, signing_key ); db->push_transaction( tx, 0 ); BOOST_REQUIRE( alice_witness.props.account_subsidy_limit == 1000 ); diff --git a/tests/tests/operation_time_tests.cpp b/tests/tests/operation_time_tests.cpp index 6937756af9..4fc307e02d 100644 --- a/tests/tests/operation_time_tests.cpp +++ b/tests/tests/operation_time_tests.cpp @@ -99,7 +99,7 @@ BOOST_AUTO_TEST_CASE( comment_payout_equalize ) } tx.set_expiration( db->head_block_time() + STEEM_MAX_TIME_UNTIL_EXPIRATION ); - tx.sign( author.private_key, db->get_chain_id() ); + sign( tx, author.private_key ); db->push_transaction( tx, 0 ); } @@ -116,7 +116,7 @@ BOOST_AUTO_TEST_CASE( comment_payout_equalize ) vote.weight = STEEM_100_PERCENT; tx.operations.push_back( vote ); tx.set_expiration( db->head_block_time() + STEEM_MAX_TIME_UNTIL_EXPIRATION ); - tx.sign( voter.private_key, db->get_chain_id() ); + sign( tx, voter.private_key ); db->push_transaction( tx, 0 ); } @@ -185,7 +185,7 @@ BOOST_AUTO_TEST_CASE( comment_payout_dust ) tx.operations.push_back( comment ); tx.operations.push_back( vote ); tx.set_expiration( db->head_block_time() + STEEM_MAX_TIME_UNTIL_EXPIRATION ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); validate_database(); @@ -197,7 +197,7 @@ BOOST_AUTO_TEST_CASE( comment_payout_dust ) tx.clear(); tx.operations.push_back( comment ); tx.operations.push_back( vote ); - tx.sign( bob_private_key, db->get_chain_id() ); + sign( tx, bob_private_key ); db->push_transaction( tx, 0 ); validate_database(); @@ -243,7 +243,7 @@ BOOST_AUTO_TEST_CASE( reward_funds ) tx.operations.push_back( comment ); tx.operations.push_back( vote ); tx.set_expiration( db->head_block_time() + STEEM_MAX_TIME_UNTIL_EXPIRATION ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); generate_blocks( 5 ); @@ -255,7 +255,7 @@ BOOST_AUTO_TEST_CASE( reward_funds ) tx.clear(); tx.operations.push_back( comment ); tx.operations.push_back( vote ); - tx.sign( bob_private_key, db->get_chain_id() ); + sign( tx, bob_private_key ); db->push_transaction( tx, 0 ); generate_blocks( db->get_comment( "alice", string( "test" ) ).cashout_time ); @@ -315,7 +315,7 @@ BOOST_AUTO_TEST_CASE( recent_claims_decay ) tx.operations.push_back( comment ); tx.operations.push_back( vote ); tx.set_expiration( db->head_block_time() + STEEM_MAX_TIME_UNTIL_EXPIRATION ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); auto alice_vshares = util::evaluate_reward_curve( db->get_comment( "alice", string( "test" ) ).net_rshares.value, @@ -330,7 +330,7 @@ BOOST_AUTO_TEST_CASE( recent_claims_decay ) tx.clear(); tx.operations.push_back( comment ); tx.operations.push_back( vote ); - tx.sign( bob_private_key, db->get_chain_id() ); + sign( tx, bob_private_key ); db->push_transaction( tx, 0 ); generate_blocks( db->get_comment( "alice", string( "test" ) ).cashout_time ); @@ -401,7 +401,7 @@ BOOST_AUTO_TEST_CASE( recent_claims_decay ) com.body = "bar"; tx.operations.push_back( com ); tx.set_expiration( db->head_block_time() + STEEM_MAX_TIME_UNTIL_EXPIRATION ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); tx.operations.clear(); @@ -409,7 +409,7 @@ BOOST_AUTO_TEST_CASE( recent_claims_decay ) com.author = "bob"; tx.operations.push_back( com ); - tx.sign( bob_private_key, db->get_chain_id() ); + sign( tx, bob_private_key ); db->push_transaction( tx, 0 ); tx.operations.clear(); @@ -423,7 +423,7 @@ BOOST_AUTO_TEST_CASE( recent_claims_decay ) vote.permlink = "test"; vote.weight = STEEM_100_PERCENT; tx.operations.push_back( vote ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); tx.operations.clear(); @@ -432,7 +432,7 @@ BOOST_AUTO_TEST_CASE( recent_claims_decay ) vote.voter = "sam"; vote.author = "alice"; tx.operations.push_back( vote ); - tx.sign( sam_private_key, db->get_chain_id() ); + sign( tx, sam_private_key ); db->push_transaction( tx, 0 ); tx.operations.clear(); @@ -441,7 +441,7 @@ BOOST_AUTO_TEST_CASE( recent_claims_decay ) vote.voter = "bob"; vote.author = "bob"; tx.operations.push_back( vote ); - tx.sign( bob_private_key, db->get_chain_id() ); + sign( tx, bob_private_key ); db->push_transaction( tx, 0 ); tx.operations.clear(); @@ -450,7 +450,7 @@ BOOST_AUTO_TEST_CASE( recent_claims_decay ) vote.voter = "dave"; vote.author = "bob"; tx.operations.push_back( vote ); - tx.sign( dave_private_key, db->get_chain_id() ); + sign( tx, dave_private_key ); db->push_transaction( tx, 0 ); BOOST_TEST_MESSAGE( "Generate blocks up until first payout" ); @@ -486,7 +486,7 @@ BOOST_AUTO_TEST_CASE( recent_claims_decay ) vote.author = "alice"; tx.operations.push_back( vote ); tx.set_expiration( db->head_block_time() + STEEM_MAX_TIME_UNTIL_EXPIRATION ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); tx.operations.clear(); @@ -495,7 +495,7 @@ BOOST_AUTO_TEST_CASE( recent_claims_decay ) vote.author = "bob"; vote.weight = STEEM_1_PERCENT; tx.operations.push_back( vote ); - tx.sign( dave_private_key, db->get_chain_id() ); + sign( tx, dave_private_key ); db->push_transaction( tx, 0 ); generate_blocks( db->get_comment( "bob", string( "test" ) ).cashout_time - STEEM_BLOCK_INTERVAL, true ); @@ -507,21 +507,21 @@ BOOST_AUTO_TEST_CASE( recent_claims_decay ) vote.weight = STEEM_100_PERCENT; tx.operations.push_back( vote ); tx.set_expiration( db->head_block_time() + STEEM_MAX_TIME_UNTIL_EXPIRATION ); - tx.sign( bob_private_key, db->get_chain_id() ); + sign( tx, bob_private_key ); db->push_transaction( tx, 0 ); tx.operations.clear(); tx.signatures.clear(); vote.voter = "sam"; tx.operations.push_back( vote ); - tx.sign( sam_private_key, db->get_chain_id() ); + sign( tx, sam_private_key ); db->push_transaction( tx, 0 ); tx.operations.clear(); tx.signatures.clear(); vote.voter = "dave"; tx.operations.push_back( vote ); - tx.sign( dave_private_key, db->get_chain_id() ); + sign( tx, dave_private_key ); db->push_transaction( tx, 0 ); bob_vest_shares = db->get_account( "bob" ).vesting_shares; @@ -570,14 +570,14 @@ BOOST_AUTO_TEST_CASE( comment_payout ) com.body = "bar"; tx.operations.push_back( com ); tx.set_expiration( db->head_block_time() + STEEM_MAX_TIME_UNTIL_EXPIRATION ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); tx.operations.clear(); tx.signatures.clear(); com.author = "bob"; tx.operations.push_back( com ); - tx.sign( bob_private_key, db->get_chain_id() ); + sign( tx, bob_private_key ); db->push_transaction( tx, 0 ); BOOST_TEST_MESSAGE( "First round of votes." ); @@ -590,14 +590,14 @@ BOOST_AUTO_TEST_CASE( comment_payout ) vote.permlink = "test"; vote.weight = STEEM_100_PERCENT; tx.operations.push_back( vote ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); tx.operations.clear(); tx.signatures.clear(); vote.voter = "dave"; tx.operations.push_back( vote ); - tx.sign( dave_private_key, db->get_chain_id() ); + sign( tx, dave_private_key ); db->push_transaction( tx, 0 ); tx.operations.clear(); @@ -605,14 +605,14 @@ BOOST_AUTO_TEST_CASE( comment_payout ) vote.voter = "bob"; vote.author = "bob"; tx.operations.push_back( vote ); - tx.sign( bob_private_key, db->get_chain_id() ); + sign( tx, bob_private_key ); db->push_transaction( tx, 0 ); tx.operations.clear(); tx.signatures.clear(); vote.voter = "sam"; tx.operations.push_back( vote ); - tx.sign( sam_private_key, db->get_chain_id() ); + sign( tx, sam_private_key ); db->push_transaction( tx, 0 ); BOOST_TEST_MESSAGE( "Generating blocks..." ); @@ -627,7 +627,7 @@ BOOST_AUTO_TEST_CASE( comment_payout ) vote.author = "bob"; tx.set_expiration( db->head_block_time() + STEEM_MAX_TIME_UNTIL_EXPIRATION ); tx.operations.push_back( vote ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); tx.operations.clear(); @@ -635,14 +635,14 @@ BOOST_AUTO_TEST_CASE( comment_payout ) vote.voter = "bob"; vote.author = "alice"; tx.operations.push_back( vote ); - tx.sign( bob_private_key, db->get_chain_id() ); + sign( tx, bob_private_key ); db->push_transaction( tx, 0 ); tx.operations.clear(); tx.signatures.clear(); vote.voter = "sam"; tx.operations.push_back( vote ); - tx.sign( sam_private_key, db->get_chain_id() ); + sign( tx, sam_private_key ); db->push_transaction( tx, 0 ); BOOST_TEST_MESSAGE( "Generating more blocks..." ); @@ -798,7 +798,7 @@ BOOST_AUTO_TEST_CASE( comment_payout ) vote.author = "alice"; tx.operations.push_back( vote ); tx.set_expiration( db->head_block_time() + STEEM_MAX_TIME_UNTIL_EXPIRATION ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); tx.operations.clear(); @@ -807,7 +807,7 @@ BOOST_AUTO_TEST_CASE( comment_payout ) vote.author = "bob"; vote.weight = STEEM_1_PERCENT; tx.operations.push_back( vote ); - tx.sign( dave_private_key, db->get_chain_id() ); + sign( tx, dave_private_key ); db->push_transaction( tx, 0 ); generate_blocks( db->get_comment( "bob", string( "test" ) ).cashout_time - STEEM_BLOCK_INTERVAL, true ); @@ -819,21 +819,21 @@ BOOST_AUTO_TEST_CASE( comment_payout ) vote.weight = STEEM_100_PERCENT; tx.operations.push_back( vote ); tx.set_expiration( db->head_block_time() + STEEM_MAX_TIME_UNTIL_EXPIRATION ); - tx.sign( bob_private_key, db->get_chain_id() ); + sign( tx, bob_private_key ); db->push_transaction( tx, 0 ); tx.operations.clear(); tx.signatures.clear(); vote.voter = "sam"; tx.operations.push_back( vote ); - tx.sign( sam_private_key, db->get_chain_id() ); + sign( tx, sam_private_key ); db->push_transaction( tx, 0 ); tx.operations.clear(); tx.signatures.clear(); vote.voter = "dave"; tx.operations.push_back( vote ); - tx.sign( dave_private_key, db->get_chain_id() ); + sign( tx, dave_private_key ); db->push_transaction( tx, 0 ); bob_vest_shares = db->get_account( "bob" ).vesting_shares; @@ -878,7 +878,7 @@ BOOST_AUTO_TEST_CASE( nested_comments ) comment_op.body = "bar"; tx.set_expiration( db->head_block_time() + STEEM_MAX_TIME_UNTIL_EXPIRATION ); tx.operations.push_back( comment_op ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); comment_op.author = "bob"; @@ -887,7 +887,7 @@ BOOST_AUTO_TEST_CASE( nested_comments ) tx.operations.clear(); tx.signatures.clear(); tx.operations.push_back( comment_op ); - tx.sign( bob_private_key, db->get_chain_id() ); + sign( tx, bob_private_key ); db->push_transaction( tx, 0 ); comment_op.author = "sam"; @@ -895,7 +895,7 @@ BOOST_AUTO_TEST_CASE( nested_comments ) tx.operations.clear(); tx.signatures.clear(); tx.operations.push_back( comment_op ); - tx.sign( sam_private_key, db->get_chain_id() ); + sign( tx, sam_private_key ); db->push_transaction( tx, 0 ); comment_op.author = "dave"; @@ -903,7 +903,7 @@ BOOST_AUTO_TEST_CASE( nested_comments ) tx.operations.clear(); tx.signatures.clear(); tx.operations.push_back( comment_op ); - tx.sign( dave_private_key, db->get_chain_id() ); + sign( tx, dave_private_key ); db->push_transaction( tx, 0 ); tx.operations.clear(); @@ -917,7 +917,7 @@ BOOST_AUTO_TEST_CASE( nested_comments ) tx.operations.push_back( vote_op ); vote_op.author = "bob"; tx.operations.push_back( vote_op ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); tx.operations.clear(); @@ -930,7 +930,7 @@ BOOST_AUTO_TEST_CASE( nested_comments ) vote_op.author = "dave"; vote_op.weight = STEEM_1_PERCENT * 20; tx.operations.push_back( vote_op ); - tx.sign( bob_private_key, db->get_chain_id() ); + sign( tx, bob_private_key ); db->push_transaction( tx, 0 ); tx.operations.clear(); @@ -939,7 +939,7 @@ BOOST_AUTO_TEST_CASE( nested_comments ) vote_op.author = "bob"; vote_op.weight = STEEM_100_PERCENT; tx.operations.push_back( vote_op ); - tx.sign( sam_private_key, db->get_chain_id() ); + sign( tx, sam_private_key ); db->push_transaction( tx, 0 ); generate_blocks( db->get_comment( "alice", string( "test" ) ).cashout_time - fc::seconds( STEEM_BLOCK_INTERVAL ), true ); @@ -1191,7 +1191,7 @@ BOOST_AUTO_TEST_CASE( vesting_withdrawals ) op.vesting_shares = asset( new_alice.vesting_shares.amount / 2, VESTS_SYMBOL ); tx.set_expiration( db->head_block_time() + STEEM_MAX_TIME_UNTIL_EXPIRATION ); tx.operations.push_back( op ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); auto next_withdrawal = db->head_block_time() + STEEM_VESTING_WITHDRAW_INTERVAL_SECONDS; @@ -1317,7 +1317,7 @@ BOOST_AUTO_TEST_CASE( vesting_withdraw_route ) signed_transaction tx; tx.set_expiration( db->head_block_time() + STEEM_MAX_TIME_UNTIL_EXPIRATION ); tx.operations.push_back( wv ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); tx.operations.clear(); @@ -1336,7 +1336,7 @@ BOOST_AUTO_TEST_CASE( vesting_withdraw_route ) op.percent = STEEM_1_PERCENT * 30; op.auto_vest = false; tx.operations.push_back( op ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); BOOST_TEST_MESSAGE( "Setting up first withdraw" ); @@ -1379,7 +1379,7 @@ BOOST_AUTO_TEST_CASE( vesting_withdraw_route ) op.percent = STEEM_1_PERCENT * 50 + 1; tx.operations.push_back( op ); tx.set_expiration( db->head_block_time() + STEEM_MAX_TIME_UNTIL_EXPIRATION ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); STEEM_REQUIRE_THROW( db->push_transaction( tx, 0 ), fc::exception ); BOOST_TEST_MESSAGE( "Test from_account receiving no withdraw" ); @@ -1390,7 +1390,7 @@ BOOST_AUTO_TEST_CASE( vesting_withdraw_route ) op.to_account = "sam"; op.percent = STEEM_1_PERCENT * 50; tx.operations.push_back( op ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); generate_blocks( db->get_account( "alice" ).next_vesting_withdrawal, true ); @@ -1467,7 +1467,7 @@ BOOST_AUTO_TEST_CASE( feed_publish_mean ) { txs[i].set_expiration( db->head_block_time() + STEEM_MAX_TIME_UNTIL_EXPIRATION ); txs[i].operations.push_back( ops[i] ); - txs[i].sign( keys[i], db->get_chain_id() ); + sign( txs[i], keys[i] ); db->push_transaction( txs[i], 0 ); } @@ -1492,7 +1492,7 @@ BOOST_AUTO_TEST_CASE( feed_publish_mean ) ops[j].exchange_rate = price( ops[j].exchange_rate.base, asset( ops[j].exchange_rate.quote.amount + 10, STEEM_SYMBOL ) ); txs[j].set_expiration( db->head_block_time() + STEEM_MAX_TIME_UNTIL_EXPIRATION ); txs[j].operations.push_back( ops[j] ); - txs[j].sign( keys[j], db->get_chain_id() ); + sign( txs[j], keys[j] ); db->push_transaction( txs[j], 0 ); } @@ -1535,7 +1535,7 @@ BOOST_AUTO_TEST_CASE( convert_delay ) op.requestid = 2; tx.operations.push_back( op ); tx.set_expiration( db->head_block_time() + STEEM_MAX_TIME_UNTIL_EXPIRATION ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); BOOST_TEST_MESSAGE( "Generating Blocks up to conversion block" ); @@ -1786,7 +1786,7 @@ BOOST_AUTO_TEST_CASE( sbd_interest ) tx.signatures.clear(); tx.set_expiration( db->head_block_time() + STEEM_MAX_TIME_UNTIL_EXPIRATION ); tx.operations.push_back( transfer ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); auto gpo = db->get_dynamic_global_properties(); @@ -1809,7 +1809,7 @@ BOOST_AUTO_TEST_CASE( sbd_interest ) tx.signatures.clear(); tx.operations.push_back( transfer ); tx.set_expiration( db->head_block_time() + STEEM_MAX_TIME_UNTIL_EXPIRATION ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); BOOST_REQUIRE( db->get_account( "alice" ).sbd_balance.amount.value == alice_sbd.amount.value - ASSET( "1.000 TBD" ).amount.value ); @@ -1827,7 +1827,7 @@ BOOST_AUTO_TEST_CASE( sbd_interest ) tx.signatures.clear(); tx.operations.push_back( transfer ); tx.set_expiration( db->head_block_time() + STEEM_MAX_TIME_UNTIL_EXPIRATION ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); BOOST_REQUIRE( static_cast(db->get_account( "alice" ).sbd_balance.amount.value) == alice_sbd.amount.value - ASSET( "1.000 TBD" ).amount.value + ( ( ( ( uint128_t( alice_sbd.amount.value ) * ( db->head_block_time() - start_time ).to_seconds() + alice_coindays ) / STEEM_SECONDS_PER_YEAR ) * gpo.sbd_interest_rate ) / STEEM_100_PERCENT ).to_uint64() ); @@ -1893,7 +1893,7 @@ BOOST_AUTO_TEST_CASE( liquidity_rewards ) tx.operations.clear(); tx.set_expiration( db->head_block_time() + STEEM_MAX_TIME_UNTIL_EXPIRATION ); tx.operations.push_back( op ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); BOOST_TEST_MESSAGE( "Waiting 10 minutes" ); @@ -1912,7 +1912,7 @@ BOOST_AUTO_TEST_CASE( liquidity_rewards ) tx.operations.clear(); tx.set_expiration( db->head_block_time() + STEEM_MAX_TIME_UNTIL_EXPIRATION ); tx.operations.push_back( op ); - tx.sign( bob_private_key, db->get_chain_id() ); + sign( tx, bob_private_key ); db->push_transaction( tx, 0 ); alice_steem_volume += ( asset( alice_sbd.amount / 20, SBD_SYMBOL ) * exchange_rate ).amount.value; @@ -1960,7 +1960,7 @@ BOOST_AUTO_TEST_CASE( liquidity_rewards ) tx.signatures.clear(); tx.operations.clear(); tx.operations.push_back( op ); - tx.sign( sam_private_key, db->get_chain_id() ); + sign( tx, sam_private_key ); db->push_transaction( tx, 0 ); BOOST_TEST_MESSAGE( "Waiting 10 minutes" ); @@ -1978,7 +1978,7 @@ BOOST_AUTO_TEST_CASE( liquidity_rewards ) tx.operations.clear(); tx.set_expiration( db->head_block_time() + STEEM_MAX_TIME_UNTIL_EXPIRATION ); tx.operations.push_back( op ); - tx.sign( bob_private_key, db->get_chain_id() ); + sign( tx, bob_private_key ); db->push_transaction( tx, 0 ); BOOST_TEST_MESSAGE( "Waiting 30 minutes" ); @@ -1996,7 +1996,7 @@ BOOST_AUTO_TEST_CASE( liquidity_rewards ) tx.operations.clear(); tx.set_expiration( db->head_block_time() + STEEM_MAX_TIME_UNTIL_EXPIRATION ); tx.operations.push_back( op ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); alice_sbd_volume -= ( alice_sbd.amount.value / 10 ) * 3; @@ -2054,7 +2054,7 @@ BOOST_AUTO_TEST_CASE( liquidity_rewards ) tx.operations.clear(); tx.set_expiration( db->head_block_time() + STEEM_MAX_TIME_UNTIL_EXPIRATION ); tx.operations.push_back( op ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); generate_blocks( db->head_block_time() + fc::seconds( STEEM_MIN_LIQUIDITY_REWARD_PERIOD_SEC_HF10.to_seconds() / 2 ), true ); @@ -2068,7 +2068,7 @@ BOOST_AUTO_TEST_CASE( liquidity_rewards ) tx.operations.clear(); tx.set_expiration( db->head_block_time() + STEEM_MAX_TIME_UNTIL_EXPIRATION ); tx.operations.push_back( op ); - tx.sign( bob_private_key, db->get_chain_id() ); + sign( tx, bob_private_key ); db->push_transaction( tx, 0 ); generate_blocks( db->head_block_time() + fc::seconds( STEEM_MIN_LIQUIDITY_REWARD_PERIOD_SEC_HF10.to_seconds() / 2 ), true ); @@ -2113,7 +2113,7 @@ BOOST_AUTO_TEST_CASE( liquidity_rewards ) tx.operations.clear(); tx.set_expiration( db->head_block_time() + STEEM_MAX_TIME_UNTIL_EXPIRATION ); tx.operations.push_back( op ); - tx.sign( sam_private_key, db->get_chain_id() ); + sign( tx, sam_private_key ); db->push_transaction( tx, 0 ); alice_steem_volume += alice_sbd.amount.value / 20; @@ -2163,7 +2163,7 @@ BOOST_AUTO_TEST_CASE( liquidity_rewards ) tx.signatures.clear(); tx.operations.push_back( transfer ); tx.set_expiration( db->head_block_time() + STEEM_MAX_TIME_UNTIL_EXPIRATION ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); op.owner = "alice"; @@ -2173,7 +2173,7 @@ BOOST_AUTO_TEST_CASE( liquidity_rewards ) tx.operations.clear(); tx.signatures.clear(); tx.operations.push_back( op ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); generate_blocks( db->head_block_time() + STEEM_MIN_LIQUIDITY_REWARD_PERIOD_SEC_HF10, true ); @@ -2186,7 +2186,7 @@ BOOST_AUTO_TEST_CASE( liquidity_rewards ) tx.signatures.clear(); tx.operations.push_back( op ); tx.set_expiration( db->head_block_time() + STEEM_MAX_TIME_UNTIL_EXPIRATION ); - tx.sign( dave_private_key, db->get_chain_id() ); + sign( tx, dave_private_key ); db->push_transaction( tx, 0 ); alice_sbd_volume += op.amount_to_sell.amount.value; @@ -2239,7 +2239,7 @@ BOOST_AUTO_TEST_CASE( liquidity_rewards ) tx.operations.clear(); tx.signatures.clear(); tx.operations.push_back( op ); - tx.sign( bob_private_key, db->get_chain_id() ); + sign( tx, bob_private_key ); db->push_transaction( tx, 0 ); alice_sbd_volume += op.amount_to_sell.amount.value; @@ -2292,7 +2292,7 @@ BOOST_AUTO_TEST_CASE( liquidity_rewards ) tx.signatures.clear(); tx.operations.push_back( transfer ); tx.set_expiration( db->head_block_time() + STEEM_MAX_TIME_UNTIL_EXPIRATION ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); op.owner = "bob"; @@ -2302,7 +2302,7 @@ BOOST_AUTO_TEST_CASE( liquidity_rewards ) tx.operations.clear(); tx.signatures.clear(); tx.operations.push_back( op ); - tx.sign( bob_private_key, db->get_chain_id() ); + sign( tx, bob_private_key ); db->push_transaction( tx, 0 ); generate_blocks( db->head_block_time() + STEEM_MIN_LIQUIDITY_REWARD_PERIOD_SEC_HF10, true ); @@ -2314,7 +2314,7 @@ BOOST_AUTO_TEST_CASE( liquidity_rewards ) tx.operations.clear(); tx.signatures.clear(); tx.operations.push_back( op ); - tx.sign( dave_private_key, db->get_chain_id() ); + sign( tx, dave_private_key ); db->push_transaction( tx, 0 ); bob_steem_volume += op.amount_to_sell.amount.value; @@ -2421,7 +2421,7 @@ BOOST_AUTO_TEST_CASE( liquidity_rewards ) tx.signatures.clear(); tx.operations.push_back( op ); tx.set_expiration( db->head_block_time() + STEEM_MAX_TIME_UNTIL_EXPIRATION ); - tx.sign( sam_private_key, db->get_chain_id() ); + sign( tx, sam_private_key ); db->push_transaction( tx, 0 ); generate_blocks( db->head_block_time() + ( STEEM_BLOCK_INTERVAL / 2 ) + STEEM_LIQUIDITY_TIMEOUT_SEC, true ); @@ -2443,7 +2443,7 @@ BOOST_AUTO_TEST_CASE( liquidity_rewards ) tx.signatures.clear(); tx.operations.push_back( op ); tx.set_expiration( db->head_block_time() + STEEM_MAX_TIME_UNTIL_EXPIRATION ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); sam_sbd_volume = ASSET( "1.000 TBD" ).amount.value; @@ -2480,7 +2480,7 @@ BOOST_AUTO_TEST_CASE( post_rate_limit ) tx.operations.push_back( op ); tx.set_expiration( db->head_block_time() + STEEM_MAX_TIME_UNTIL_EXPIRATION ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); BOOST_REQUIRE( db->get_comment( "alice", string( "test1" ) ).reward_weight == STEEM_100_PERCENT ); @@ -2493,7 +2493,7 @@ BOOST_AUTO_TEST_CASE( post_rate_limit ) op.permlink = "test2"; tx.operations.push_back( op ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); BOOST_REQUIRE( db->get_comment( "alice", string( "test2" ) ).reward_weight == STEEM_100_PERCENT ); @@ -2506,7 +2506,7 @@ BOOST_AUTO_TEST_CASE( post_rate_limit ) op.permlink = "test3"; tx.operations.push_back( op ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); BOOST_REQUIRE( db->get_comment( "alice", string( "test3" ) ).reward_weight == STEEM_100_PERCENT ); @@ -2519,7 +2519,7 @@ BOOST_AUTO_TEST_CASE( post_rate_limit ) op.permlink = "test4"; tx.operations.push_back( op ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); BOOST_REQUIRE( db->get_comment( "alice", string( "test4" ) ).reward_weight == STEEM_100_PERCENT ); @@ -2532,7 +2532,7 @@ BOOST_AUTO_TEST_CASE( post_rate_limit ) op.permlink = "test5"; tx.operations.push_back( op ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); BOOST_REQUIRE( db->get_comment( "alice", string( "test5" ) ).reward_weight == STEEM_100_PERCENT ); @@ -2569,7 +2569,7 @@ BOOST_AUTO_TEST_CASE( comment_freeze ) tx.operations.push_back( comment ); tx.set_expiration( db->head_block_time() + STEEM_MAX_TIME_UNTIL_EXPIRATION ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); comment.body = "test2"; @@ -2578,7 +2578,7 @@ BOOST_AUTO_TEST_CASE( comment_freeze ) tx.signatures.clear(); tx.operations.push_back( comment ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); vote_operation vote; @@ -2591,7 +2591,7 @@ BOOST_AUTO_TEST_CASE( comment_freeze ) tx.signatures.clear(); tx.operations.push_back( vote ); - tx.sign( bob_private_key, db->get_chain_id() ); + sign( tx, bob_private_key ); db->push_transaction( tx, 0 ); BOOST_REQUIRE( db->get_comment( "alice", string( "test" ) ).last_payout == fc::time_point_sec::min() ); @@ -2610,7 +2610,7 @@ BOOST_AUTO_TEST_CASE( comment_freeze ) tx.operations.push_back( vote ); tx.set_expiration( db->head_block_time() + STEEM_MAX_TIME_UNTIL_EXPIRATION ); - tx.sign( sam_private_key, db->get_chain_id() ); + sign( tx, sam_private_key ); db->push_transaction( tx, 0 ); BOOST_REQUIRE( db->get_comment( "alice", string( "test" ) ).cashout_time == fc::time_point_sec::maximum() ); @@ -2625,7 +2625,7 @@ BOOST_AUTO_TEST_CASE( comment_freeze ) tx.operations.push_back( vote ); tx.set_expiration( db->head_block_time() + STEEM_MAX_TIME_UNTIL_EXPIRATION ); - tx.sign( bob_private_key, db->get_chain_id() ); + sign( tx, bob_private_key ); db->push_transaction( tx, 0 ); BOOST_REQUIRE( db->get_comment( "alice", string( "test" ) ).cashout_time == fc::time_point_sec::maximum() ); @@ -2640,7 +2640,7 @@ BOOST_AUTO_TEST_CASE( comment_freeze ) tx.operations.push_back( vote ); tx.set_expiration( db->head_block_time() + STEEM_MAX_TIME_UNTIL_EXPIRATION ); - tx.sign( dave_private_key, db->get_chain_id() ); + sign( tx, dave_private_key ); db->push_transaction( tx, 0 ); BOOST_REQUIRE( db->get_comment( "alice", string( "test" ) ).cashout_time == fc::time_point_sec::maximum() ); @@ -2653,7 +2653,7 @@ BOOST_AUTO_TEST_CASE( comment_freeze ) tx.signatures.clear(); tx.operations.push_back( comment ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); // Works now in #1714 } FC_LOG_AND_RETHROW() @@ -2692,7 +2692,7 @@ BOOST_AUTO_TEST_CASE( sbd_stability ) signed_transaction tx; tx.operations.push_back( comment ); tx.set_expiration( db->head_block_time() + STEEM_MAX_TIME_UNTIL_EXPIRATION ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); vote_operation vote; @@ -2705,7 +2705,7 @@ BOOST_AUTO_TEST_CASE( sbd_stability ) tx.signatures.clear(); tx.operations.push_back( vote ); - tx.sign( bob_private_key, db->get_chain_id() ); + sign( tx, bob_private_key ); db->push_transaction( tx, 0 ); BOOST_TEST_MESSAGE( "Generating blocks up to comment payout" ); @@ -2827,7 +2827,7 @@ BOOST_AUTO_TEST_CASE( sbd_price_feed_limit ) tx.operations.push_back( comment ); tx.operations.push_back( vote ); tx.set_expiration( db->head_block_time() + STEEM_MAX_TIME_UNTIL_EXPIRATION ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); generate_blocks( db->get_comment( "alice", string( "test" ) ).cashout_time, true ); @@ -2893,7 +2893,7 @@ BOOST_AUTO_TEST_CASE( clear_null_account ) tx.operations.push_back( save1); tx.operations.push_back( save2 ); tx.set_expiration( db->head_block_time() + STEEM_MAX_TIME_UNTIL_EXPIRATION ); - tx.sign( alice_private_key, db->get_chain_id() ); + sign( tx, alice_private_key ); db->push_transaction( tx, 0 ); validate_database(); diff --git a/tests/tests/smt_tests.cpp b/tests/tests/smt_tests.cpp index a085f71a20..d13d5da13c 100644 --- a/tests/tests/smt_tests.cpp +++ b/tests/tests/smt_tests.cpp @@ -108,7 +108,7 @@ BOOST_AUTO_TEST_CASE( smt_create_authorities ) #define OP2TX(OP,TX,KEY) \ TX.operations.push_back( OP ); \ TX.set_expiration( db->head_block_time() + STEEM_MAX_TIME_UNTIL_EXPIRATION ); \ -TX.sign( KEY, db->get_chain_id() ); +sign( TX, KEY ); #define PUSH_OP(OP,KEY) \ { \ @@ -141,7 +141,7 @@ BOOST_AUTO_TEST_CASE( smt_create_apply ) generate_block(); fund( "alice", 10 * 1000 * 1000 ); - + generate_block(); set_price_feed( price( ASSET( "1.000 TBD" ), ASSET( "1.000 TESTS" ) ) ); @@ -352,7 +352,7 @@ BOOST_AUTO_TEST_CASE( setup_emissions_apply ) fail_op.emissions_unit.token_unit["bob"] = 10; // Do invalid attempt at SMT creation. - create_invalid_smt("alice", alice_private_key); + create_invalid_smt("alice", alice_private_key); // Fail due to non-existing SMT (too early). FAIL_WITH_OP(fail_op, alice_private_key, fc::assert_exception) @@ -395,7 +395,7 @@ BOOST_AUTO_TEST_CASE( set_setup_parameters_apply ) try { ACTORS( (dany)(eddy) ) - + generate_block(); fund( "dany", 5000000 ); @@ -404,16 +404,16 @@ BOOST_AUTO_TEST_CASE( set_setup_parameters_apply ) set_price_feed( price( ASSET( "1.000 TBD" ), ASSET( "1.000 TESTS" ) ) ); convert( "dany", ASSET( "5000.000 TESTS" ) ); - + smt_set_setup_parameters_operation fail_op; fail_op.control_account = "dany"; // Do invalid attempt at SMT creation. create_invalid_smt("dany", dany_private_key); - + // Fail due to non-existing SMT (too early). FAIL_WITH_OP(fail_op, dany_private_key, fc::assert_exception) - + // Create SMT(s) and continue. auto smts = create_smt_3("dany", dany_private_key); { @@ -674,7 +674,7 @@ BOOST_AUTO_TEST_CASE( smt_transfer_apply ) db->validate_invariants(); db->validate_smt_invariants(); } - FC_LOG_AND_RETHROW() + FC_LOG_AND_RETHROW() } BOOST_AUTO_TEST_SUITE_END()