提交 e9a3651b 编写于 作者: A arhag

fix bug in staking to another account with transfer #3309

上级 503e0c8e
......@@ -316,7 +316,7 @@ namespace eosiosystem {
auto transfer_amount = net_balance + cpu_balance;
if ( asset(0) < transfer_amount ) {
INLINE_ACTION_SENDER(eosio::token, transfer)( N(eosio.token), {from,N(active)},
INLINE_ACTION_SENDER(eosio::token, transfer)( N(eosio.token), {source_stake_from, N(active)},
{ source_stake_from, N(eosio), asset(transfer_amount), std::string("stake bandwidth") } );
}
}
......
......@@ -208,6 +208,10 @@ BOOST_FIXTURE_TEST_CASE( stake_unstake_with_transfer, eosio_system_tester ) try
BOOST_REQUIRE_EQUAL( core_from_string("10.0000"), total["net_weight"].as<asset>());
BOOST_REQUIRE_EQUAL( core_from_string("10.0000"), total["cpu_weight"].as<asset>());
REQUIRE_MATCHING_OBJECT( voter( "alice1111111", core_from_string("0.0000")), get_voter_info( "alice1111111" ) );
// Now alice stakes to bob with transfer flag
BOOST_REQUIRE_EQUAL( success(), stake_with_transfer( "alice1111111", "bob111111111", core_from_string("100.0000"), core_from_string("100.0000") ) );
} FC_LOG_AND_RETHROW()
BOOST_FIXTURE_TEST_CASE( fail_without_auth, eosio_system_tester ) try {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册