【问题标题】:NEAR smart contract rust Error: "Cannot deserialize value with Borsh"NEAR 智能合约生锈错误:“无法使用 Borsh 反序列化值”
【发布时间】:2021-09-19 09:11:40
【问题描述】:

我正在尝试调用视图方法来检索 u128 值的 Vec,结果我收到此错误,我不知道该怎么做,有人可以帮助我吗?

{
  "block_hash": "76auef76bmvvKT6kVZabiCrrHeTzoBP2vxGZGqaBjDc1",
  "block_height": 54564995,
  "error": "wasm execution failed with error: FunctionCallError(HostError(GuestPanic { panic_msg: \"Cannot deserialize value with Borsh\" }))",
  "logs": []
}
    at JsonRpcProvider.query (json-rpc-provider.js:116)
    at async ConnectedWalletAccount.viewFunction (account.js:356)
    at async <anonymous>:1:1
TypedError @ errors.js:18
query @ json-rpc-provider.js:116

感谢您的帮助!

【问题讨论】:

  • 我们需要查看合约代码来回答可能出现的问题。

标签: rust blockchain smartcontracts nearprotocol


【解决方案1】:

我的猜测是,您重新部署了一份合约,其中更改了状态结构的结构(标有#[near_bindgen] 的结构)。因此,当您调用任何方法时,它都无法将现有状态反序列化为新结构。如果是这种情况,您有几个选择:

【讨论】:

    猜你喜欢
    • 2021-12-30
    • 2021-06-14
    • 2022-06-23
    • 2021-03-31
    • 2020-10-02
    • 1970-01-01
    • 2021-01-12
    • 2022-06-22
    • 1970-01-01
    相关资源
    最近更新 更多