问题
这是我的功能:
#[endpoint(registerItem)]
fn register_item(&self, items_id: &[String])
{
// nothing for the moment
}
在我的 Mandos 测试中,一切都很好(setState、scDeploy 等),直到我像这样测试此端点的调用:
{
"step": "scCall",
"tx": {
"from": "address:owner",
"to": "sc:equip",
"function": "registerItem",
"arguments": [
"0x70757461696e|0x70757461696e"
],
"gasLimit": "5,000,000",
"gasPrice": "0"
},
"expect": {
"status": "0",
"gas": "*",
"refund": "*"
}
}
当我运行它时,我得到错误代码 10 又名执行失败。
这是整个日志:
Output: Scenario: init.scen.json ... FAIL: result code mismatch. Tx . Want: 0. Have: 10 (execution failed). Message: execution failed
Done. Passed: 0. Failed: 1. Skipped: 0.
ERROR: some tests failed
**我尝试过的事情**
我已将字符串数组替换为 int 数组,但没有遇到此问题。我也试过 [str] 但我得到了这个错误:
15 | #[elrond_wasm::derive::contract]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time