eos - (eosjs) 如何获取字符串类型的行
问题描述
在 A.cpp 中,有 string 类型的 starinfo 结构和 memo 属性。
struct starinfo{
uint64_t num;
account_name account;
asset price;
string memo;
}
我发布了合约,并使用推送操作写了一些价值。
这是结果。(cleos.sh 获取表 aaaa0000aaaa0000 aaaa0000aaaa0000 星信息)
{
"rows": [{
"num": 0,
"account": "aaabbbcccddd",
"price": "1.0000 EOS",
"memo": "M"
}
],
"more": false
}
但是当我使用 eos.getTableRows 时出现以下错误。
"Unable to unpack built-in type 'string' while processing 'starinfo.memo'"
详细地,
Error: {"code":500,"message":"Internal Service Error","error":{"code":3015013, "name":"unpack_exception","what":"Unpack data exception","details":[{"message" :"Unable to unpack built-in type 'string' while processing 'starinfo.memo'","f ile":"abi_serializer.cpp","line_number":327,"method":"_binary_to_variant"},{"m essage":"read datastream of length 58 over by -40","file":"datastream.cpp","li ne_number":6,"method":"throw_datastream_range_error"}]}}
当我在 cleos 控制台下获取一行时,它可以工作。但是当我使用 eosjs 获取一行时,它不起作用。
解决方案
推荐阅读
- python - 如何使用电报机器人获取作者的用户名?
- javascript - 使用循环访问另一个 var 中的 var
- python - 在 Scapy Python 中访问数据包时出错
- grails - 如何将 Grails 从 Grails 2.4.4 升级到 Grails 4.0.1?
- oauth-2.0 - 在 Outlook 加载项中存储访问令牌的正确位置在哪里?
- python - 无法在 Jyputer 笔记本中读取 csv 文件
- java - 如何使用 FasterXML Jackson 将 XML 本身反序列化为列表
- java - Every time a player leaves my minecraft server, events are run twice. Why is this happening?
- c# - What does the question mark sign '?' mean after a C# type?
- emacs - where to customize lsp-project-blacklist in spacemacs lsp layer