提交 bb77eaa8 编写于 作者: A arhag

fail earlier on transfer and test rethrown exceptions of tester::push_transaction

上级 56c47bfd
......@@ -10,8 +10,8 @@ namespace eosio {
void token::create( account_name issuer,
asset maximum_supply,
uint8_t issuer_can_freeze,
uint8_t issuer_can_recall,
uint8_t issuer_can_whitelist )
uint8_t issuer_can_recall,
uint8_t issuer_can_whitelist )
{
require_auth( _self );
......@@ -33,7 +33,7 @@ void token::create( account_name issuer,
}
void token::issue( account_name to, asset quantity, string memo )
void token::issue( account_name to, asset quantity, string memo )
{
print( "issue" );
auto sym = quantity.symbol.name();
......@@ -56,13 +56,14 @@ void token::issue( account_name to, asset quantity, string memo )
}
}
void token::transfer( account_name from,
void token::transfer( account_name from,
account_name to,
asset quantity,
string /*memo*/ )
string /*memo*/ )
{
print( "transfer" );
require_auth( from );
eosio_assert( is_account( to ), "to account does not exist");
auto sym = quantity.symbol.name();
stats statstable( _self, sym );
const auto& st = statstable.get( sym );
......
......@@ -106,6 +106,8 @@ extern "C" {
*/
void require_auth2( account_name name, permission_name permission );
bool is_account( account_name name );
/**
* Send an inline action in the context of this action's parent transaction
* @param serialized_action - serialized action
......
......@@ -179,7 +179,22 @@ int main( int argc, char** argv ) {
//bad_block.producer = N(sam);
//bad_block.schedule_version = 12;
bad_block.transaction_mroot = bad_block.previous;
c.control->push_block( std::make_shared<signed_block>(bad_block) );
try {
c.control->push_block( std::make_shared<signed_block>(bad_block) );
} catch( const fc::exception& e ) {
elog(e.to_detail_string());
}
c.produce_blocks(3);
cr = c.push_action( N(eosio.token), N(issue), N(eosio), mutable_variant_object()
("to", "unregistered" )
("quantity", "100.0000 EOS")
("memo", "")
);
wdump((fc::json::to_pretty_string(cr)));
} FC_CAPTURE_AND_RETHROW()
} catch ( const fc::exception& e ) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册