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