I have a simple struct with one member and want to pass this to an action.
struct field {
bool is_private;
};
// @abi action
// Create a new profile
void create(const account_name& account, const field& first_name);
The .abi looks like this:
"structs": [{
"name": "field",
"base": "",
"fields": [{
"name": "is_private",
"type": "bool"
}
]
},{
"name": "create",
"base": "",
"fields": [{
"name": "account",
"type": "name"
},{
"name": "first_name",
"type": "field"
}
]
}
...
I tried a lot of different variations along the lines of cleos push action "contract" "create" '[acc_name, {"is_private": "true"}]' -p acc_name@active. But none of them seem to work. Are structs supported and if yes how do you pass the argument?
Thanks a lot!
Found the solution myself. You have to recreate the .abi structure in json:
cleos push action contract create '{"account":"acc_name","first_name":{"is_private":true"}}' -p acc_name@active
https://github.com/EOSIO/eos/issues/4914
版权属于:区块链中文技术社区 / 转载原创者
本文链接:https://bcskill.com/index.php/archives/466.html
相关技术文章仅限于相关区块链底层技术研究,禁止用于非法用途,后果自负!本站严格遵守一切相关法律政策!