From 430a1290131cbe3c9a5bcf5240c13675cccad060 Mon Sep 17 00:00:00 2001 From: satyakoneru <15652887+satyakoneru@users.noreply.github.com> Date: Fri, 1 May 2020 09:25:34 +0000 Subject: [PATCH] Fix the tests --- libraries/chain/db_notify.cpp | 2 +- libraries/wallet/wallet.cpp | 2 +- tests/tests/son_operations_tests.cpp | 3 +-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/libraries/chain/db_notify.cpp b/libraries/chain/db_notify.cpp index 68ff2572..fcd2cb75 100644 --- a/libraries/chain/db_notify.cpp +++ b/libraries/chain/db_notify.cpp @@ -300,7 +300,7 @@ struct get_impacted_account_visitor _impacted.insert( op.owner_account ); } void operator()( const son_deregister_operation& op ) { - _impacted.insert( op.owner_account ); + _impacted.insert( op.payer); } void operator()( const son_heartbeat_operation& op ) { _impacted.insert( op.owner_account ); diff --git a/libraries/wallet/wallet.cpp b/libraries/wallet/wallet.cpp index d98ffe91..0e805fff 100644 --- a/libraries/wallet/wallet.cpp +++ b/libraries/wallet/wallet.cpp @@ -2055,7 +2055,7 @@ public: std::inserter(result, result.end()), [](fc::optional& acct, fc::optional son) { FC_ASSERT(acct, "Invalid active SONs list in global properties."); - if (son.valid()) + if (son.valid() && son->status != son_status::deregistered) return std::make_pair(string(acct->name), std::move(son->id)); return std::make_pair(string(acct->name), std::move(son_id_type())); }); diff --git a/tests/tests/son_operations_tests.cpp b/tests/tests/son_operations_tests.cpp index fbb2b778..accb592e 100644 --- a/tests/tests/son_operations_tests.cpp +++ b/tests/tests/son_operations_tests.cpp @@ -214,7 +214,7 @@ try { BOOST_REQUIRE( idx.size() == 1 ); BOOST_REQUIRE( obj->status == son_status::deregistered ); - BOOST_REQUIRE( son_stats_obj->deregistered_timestamp == db.head_block_time() ); + BOOST_REQUIRE( son_stats_obj->deregistered_timestamp == now ); deposit_vesting = db.get(vesting_balance_id_type(0)); BOOST_CHECK_EQUAL(deposit_vesting.policy.get().vesting_cliff_seconds, @@ -267,7 +267,6 @@ try { // bob tries to deregister a son object he dont own { son_deregister_operation op; - op.owner_account = bob_id; op.son_id = son_id_type(0); op.payer = bob_id;