Skip to content

Commit f78c121

Browse files
committed
[StandardToken][Core] get_abi chain API : return sys.tokenabi standard token abi if an account doesn't have abi set explicitly
1 parent 17698a5 commit f78c121

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

plugins/chain_plugin/chain_plugin.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2470,6 +2470,15 @@ read_only::get_abi_results read_only::get_abi( const get_abi_params& params )con
24702470
const auto& accnt = d.get<account_object,by_name>( params.account_name );
24712471

24722472
abi_def abi;
2473+
2474+
if (accnt.abi.size() == 0) {
2475+
const auto& accnt_systokenabi = d.get<account_object,by_name>( infrablockchain::chain::infrablockchain_standard_token_interface_abi_account_name );
2476+
if( abi_serializer::to_abi(accnt_systokenabi.abi, abi) ) {
2477+
result.abi = std::move(abi);
2478+
}
2479+
return result;
2480+
}
2481+
24732482
if( abi_serializer::to_abi(accnt.abi, abi) ) {
24742483
result.abi = std::move(abi);
24752484
}

0 commit comments

Comments
 (0)