成功解决:chaincode argument error: json: cannot unmarshal xxx into Go struct field .Args of type string

Fabric在调用链码时候报错:

Error: chaincode argument error: json: cannot unmarshal number into Go struct field .Args of type string

Error: chaincode argument error: json: cannot unmarshal bool into Go struct field .Args of type string

数据在结构体中有字符串布尔浮点整型,如下所示:

调用的指令是

主要看传参处,按照结构体中数据类型进行传参,整型布尔浮点型数据都没有双引号,但是调用时报错

解决方法是在调用时在所有参数处都加上双引号,此做法并不会改变数据类型,可以在调用后根据key查询得以验证

成功解决:chaincode argument error: json: cannot unmarshal xxx into Go struct field .Args of type string的问题

欢迎小伙伴讨论,如有错误请在评论区评论或发私聊消息,谢谢你。

评论 13
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

余府

谢谢你的鼓励

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值