我已经发布了一个名为certificates的模块: 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"]我试图使用以下签名调用一个名为issue_certificate的函数:
public entry fun issue_certificate(_: &CertCreatorCap,
name: vector<u8>,
year: u8,
recipient: address,
ctx: &mut TxContext)&CertCreatorCap具有以下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使用的命令是: 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我试过输入b"JIM“和”<74,105,109>“,它们给出了以下错误。
\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我认为最基本的问题是如何通过CLI传递向量/字符串参数来调用Sui上的move函数。
发布于 2022-10-28 08:24:13
\identities>sui client call --function issue_certificate --module certificates --package 0x426ff70c987a00b9384b102f10a4f8bb8945141f --args 0x8e724e1266e1f4f1a8d6cfa904b2e0749ed41953 "JIM" 22 0xb7a9c2bc3a65ad0b02851e426e6b34dcf069b6c7 --gas-budget 100000上面的命令运行lol,因为2022年比u8大得多.真是个粗心的错误。
https://stackoverflow.com/questions/74232167
复制相似问题