I have published a module called certificates
at 0x426ff70c987a00b9384b102f10a4f8bb8945141f
\identities>sui client object --id 0x426ff70c987a00b9384b102f10a4f8bb8945141f
----- Move Package (0x426ff70c987a00b9384b102f10a4f8bb8945141f[1]) -----
Owner: Immutable
Version: 1
Storage Rebate: 0
Previous Transaction: K01/b4ZdtujIIAiFODDRATUUMs3mw41OHNoB2kfMghY=
----- Data -----
Modules: ["certificates"]
I am trying to call a function named issue_certificate
with the following signature:
public entry fun issue_certificate(_: &CertCreatorCap,
name: vector<u8>,
year: u8,
recipient: address,
ctx: &mut TxContext)
&CertCreatorCap
has the following ID: 0x8e724e1266e1f4f1a8d6cfa904b2e0749ed41953
\identities>sui client object --id 0x8e724e1266e1f4f1a8d6cfa904b2e0749ed41953
----- Move Object (0x8e724e1266e1f4f1a8d6cfa904b2e0749ed41953[1]) -----
Owner: Account Address ( 0xb7a9c2bc3a65ad0b02851e426e6b34dcf069b6c7 )
Version: 1
Storage Rebate: 14
Previous Transaction: K01/b4ZdtujIIAiFODDRATUUMs3mw41OHNoB2kfMghY=
----- Data -----
type: 0x426ff70c987a00b9384b102f10a4f8bb8945141f::certificates::CertCreatorCap
id: 0x8e724e1266e1f4f1a8d6cfa904b2e0749ed41953
The command using Sui Client CLI is: variant -> name = "JIM"
\identities>sui client call --function issue_certificate --module certificates --package 0x426ff70c987a00b9384b102f10a4f8bb8945141f --args 0x8e724e1266e1f4f1a8d6cfa904b2e0749ed41953 "JIM" 2022 0xb7a9c2bc3a65ad0b02851e426e6b34dcf069b6c7 --gas-budget 100000
Could not serialize argument of type U8 at 2 into u8. Got error: out of range integral type conversion attempted
I have tried putting in b"JIM" and <74,105,109>, they give the following errors.
\identities>sui client call --function issue_certificate --module certificates --package 0x426ff70c987a00b9384b102f10a4f8bb8945141f --args 0x8e724e1266e1f4f1a8d6cfa904b2e0749ed41953 <74,105,109> 2022 0xb7a9c2bc3a65ad0b02851e426e6b34dcf069b6c7 --gas-budget 100000
The system cannot find the file specified.
\identities>sui client call --function issue_certificate --module certificates --package 0x426ff70c987a00b9384b102f10a4f8bb8945141f --args 0x8e724e1266e1f4f1a8d6cfa904b2e0749ed41953 b"JIM" 2022 0xb7a9c2bc3a65ad0b02851e426e6b34dcf069b6c7 --gas-budget 100000
Could not serialize argument of type U8 at 2 into u8. Got error: out of range integral type conversion attempted
I think the fundamental question is how I do pass vector/string arguments via the CLI to call a move function on Sui.
\identities>sui client call --function issue_certificate --module certificates --package 0x426ff70c987a00b9384b102f10a4f8bb8945141f --args 0x8e724e1266e1f4f1a8d6cfa904b2e0749ed41953 "JIM" 22 0xb7a9c2bc3a65ad0b02851e426e6b34dcf069b6c7 --gas-budget 100000
The above command works lol, it's because 2022 is way bigger than u8... What a careless mistake.