diff --git a/libraries/chain/include/graphene/chain/exceptions.hpp b/libraries/chain/include/graphene/chain/exceptions.hpp index 0e474548..5479fcc7 100644 --- a/libraries/chain/include/graphene/chain/exceptions.hpp +++ b/libraries/chain/include/graphene/chain/exceptions.hpp @@ -73,7 +73,7 @@ namespace graphene { namespace chain { FC_DECLARE_DERIVED_EXCEPTION( tx_missing_active_auth, graphene::chain::transaction_exception, 3030001, "missing required active authority" ) FC_DECLARE_DERIVED_EXCEPTION( tx_missing_owner_auth, graphene::chain::transaction_exception, 3030002, "missing required owner authority" ) FC_DECLARE_DERIVED_EXCEPTION( tx_missing_other_auth, graphene::chain::transaction_exception, 3030003, "missing required other authority" ) - FC_DECLARE_DERIVED_EXCEPTION( tx_irrelevant_authority, graphene::chain::transaction_exception, 3030004, "irrelevant authority" ) + FC_DECLARE_DERIVED_EXCEPTION( tx_irrelevant_sig, graphene::chain::transaction_exception, 3030004, "irrelevant signature included" ) FC_DECLARE_DERIVED_EXCEPTION( invalid_committee_approval, graphene::chain::transaction_exception, 3030005, "committee account cannot directly approve transaction" ) diff --git a/libraries/chain/protocol/transaction.cpp b/libraries/chain/protocol/transaction.cpp index 6e295032..bdf7da27 100644 --- a/libraries/chain/protocol/transaction.cpp +++ b/libraries/chain/protocol/transaction.cpp @@ -227,7 +227,11 @@ void verify_authority( const vector& ops, const flat_set #include +#include #include #include @@ -625,7 +626,7 @@ BOOST_FIXTURE_TEST_CASE( double_sign_check, database_fixture ) BOOST_TEST_MESSAGE( "Verify that signing with an extra, unused key fails" ); trx.signatures.pop_back(); trx.sign(generate_private_key("bogus")); - GRAPHENE_REQUIRE_THROW( db.push_transaction(trx, 0), fc::exception ); + GRAPHENE_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(); diff --git a/tests/tests/operation_tests2.cpp b/tests/tests/operation_tests2.cpp index 8c16675e..ae0e6f32 100644 --- a/tests/tests/operation_tests2.cpp +++ b/tests/tests/operation_tests2.cpp @@ -1029,8 +1029,9 @@ BOOST_AUTO_TEST_CASE( assert_op_test ) PUSH_TX( db, trx ); // nathan checks that his public key is not equal to the given value (fail) - op.predicates.back() = account_name_eq_lit_predicate{ nathan_id, "dan" }; - trx.operations.back() = op; + trx.clear(); + op.predicates.emplace_back(account_name_eq_lit_predicate{ nathan_id, "dan" }); + trx.operations.push_back(op); trx.sign(nathan_private_key); GRAPHENE_CHECK_THROW( PUSH_TX( db, trx ), fc::exception ); } FC_LOG_AND_RETHROW()