提交 047e8d5c 编写于 作者: K Kevin Heifner

Use built_in_types of eosio::chain to use correct types for builtins like account_name

上级 fe72179f
#include <eosio/abi_generator/abi_generator.hpp>
#include <eosio/chain/abi_def.hpp>
namespace eosio {
......@@ -82,6 +83,14 @@ string abi_generator::translate_type(const string& type_name) {
else if (type_name == "long" || type_name == "int32_t") built_in_type = "int32";
else if (type_name == "short" || type_name == "int16_t") built_in_type = "int16";
else if (type_name == "char" || type_name == "int8_t") built_in_type = "int8";
else {
static auto types = eosio::chain::built_in_types();
auto itr = std::find_if( types.begin(), types.end(),
[&type_name]( const eosio::chain::type_def& t ) { return t.new_type_name == type_name; } );
if( itr != types.end()) {
built_in_type = itr->type;
}
}
return built_in_type;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册