Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Sign in
issue
issue
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 23
    • Issues 23
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar

新注册的用户请输入邮箱并保存,随后登录邮箱激活账号。后续可直接使用邮箱登录!

  • chainmaker
  • issueissue
  • Issues
  • #1229

Closed
Open
Opened Oct 31, 2024 by Zongjin Li@lzjstcvv

go-sdk 执行solidity合约 传参string[]的时候报错

// 设置指定 key 的数组值
function set(string memory key, string[] memory value) public {
    data[key] = value;
}        solidity是这样写的 
  然后我执行go-sdk的时候这样使用:
                 method := "set"
		a := []string{"dsa", "das"}
		dataByte, err := myAbi.Pack(method, "key", a)
		if err != nil {
			fmt.Println(err)
		}
		dataString := hex.EncodeToString(dataByte)
		kvs := []*common.KeyValuePair{
			{
				Key:   "data",
				Value: []byte(dataString),
			},
		}
		resp, err := cc.InvokeContract("ffb3d95fb80749c1f4613cec62a702b410315078", method, "", kvs, -1, true)
		if err != nil {
			fmt.Println(err)
		}
 但是会报错!求助
Edited Oct 31, 2024 by Zongjin Li
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: chainmaker/issue#1229

Copyright © 2021 ChainMaker Org. All Rights Reserved. 长安链 版权所有。