Skip to content

Commit 433ae27

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 a3a88b3 commit 433ae27

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
@@ -3335,6 +3335,15 @@ read_only::get_abi_results read_only::get_abi( const get_abi_params& params )con
33353335
const auto& accnt = d.get<account_object,by_name>( params.account_name );
33363336

33373337
abi_def abi;
3338+
3339+
if (accnt.abi.size() == 0) {
3340+
const auto& accnt_systokenabi = d.get<account_object,by_name>( infrablockchain::chain::infrablockchain_standard_token_interface_abi_account_name );
3341+
if( abi_serializer::to_abi(accnt_systokenabi.abi, abi) ) {
3342+
result.abi = std::move(abi);
3343+
}
3344+
return result;
3345+
}
3346+
33383347
if( abi_serializer::to_abi(accnt.abi, abi) ) {
33393348
result.abi = std::move(abi);
33403349
}

0 commit comments

Comments
 (0)