From 4a848929814916486e651a91a6833f4ce74483e7 Mon Sep 17 00:00:00 2001 From: Vikram Rajkumar Date: Thu, 2 Jul 2015 12:58:21 -0400 Subject: [PATCH] Fix build errors --- libraries/chain/include/graphene/chain/operations.hpp | 2 +- libraries/chain/transaction.cpp | 10 ++++++++++ tests/app/main.cpp | 9 ++++++--- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/libraries/chain/include/graphene/chain/operations.hpp b/libraries/chain/include/graphene/chain/operations.hpp index cbec3db8..4c770536 100644 --- a/libraries/chain/include/graphene/chain/operations.hpp +++ b/libraries/chain/include/graphene/chain/operations.hpp @@ -351,7 +351,7 @@ namespace graphene { namespace chain { /// The account which owns the delegate. This account pays the fee for this operation. account_id_type witness_account; string url; - public_key_type block_signing_key; + public_key_type block_signing_key; secret_hash_type initial_secret; account_id_type fee_payer()const { return witness_account; } diff --git a/libraries/chain/transaction.cpp b/libraries/chain/transaction.cpp index dea15771..ff963bcf 100644 --- a/libraries/chain/transaction.cpp +++ b/libraries/chain/transaction.cpp @@ -60,6 +60,7 @@ graphene::chain::transaction_id_type graphene::chain::transaction::id() const memcpy(result._hash, hash._hash, std::min(sizeof(result), sizeof(hash))); return result; } + void graphene::chain::signed_transaction::sign(const private_key_type& key) { if( relative_expiration != 0 ) @@ -71,6 +72,15 @@ void graphene::chain::signed_transaction::sign(const private_key_type& key) signatures.push_back(key.sign_compact(digest())); } } + +void transaction::set_expiration( fc::time_point_sec expiration_time ) +{ + ref_block_num = 0; + relative_expiration = 0; + ref_block_prefix = expiration_time.sec_since_epoch(); + block_id_cache.reset(); +} + void transaction::set_expiration( const block_id_type& reference_block, unsigned_int lifetime_intervals ) { ref_block_num = boost::endian::endian_reverse(reference_block._hash[0]); diff --git a/tests/app/main.cpp b/tests/app/main.cpp index 80e3ee6f..c1d00537 100644 --- a/tests/app/main.cpp +++ b/tests/app/main.cpp @@ -70,9 +70,12 @@ BOOST_AUTO_TEST_CASE( two_node_network ) trx.set_expiration(now + fc::seconds(30)); std::shared_ptr db2 = app2.chain_database(); - trx.operations.push_back(assert_operation({asset(), - GRAPHENE_TEMP_ACCOUNT, - { fc::raw::pack( graphene::chain::pred::asset_symbol_eq_lit{asset_id_type(),"CORE"} ) } })); + assert_operation op; + op.fee_paying_account = GRAPHENE_TEMP_ACCOUNT; + op.predicates.push_back( fc::raw::pack( graphene::chain::pred::asset_symbol_eq_lit{ asset_id_type(), "CORE" } ) ); + + trx.operations.push_back( std::move( op ) ); + trx.validate(); processed_transaction ptrx = app1.chain_database()->push_transaction(trx); app1.p2p_node()->broadcast(graphene::net::trx_message(trx));