成功解决: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的问题

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

猜你喜欢

转载自blog.csdn.net/bean_business/article/details/110821903