TLDR: NEAR的FungibleToken示例是goto标准,用于如何编写模拟测试,而且它没有编译。
https://github.com/thor314/FungibleToken详细介绍了我的奥德赛,试图编译可替换的令牌示例,这样我就可以对模拟测试进行建模。ReadMe包含了我到目前为止尝试过的内容。
最初的回购生活在near_sdk回购内部。https://github.com/near/near-sdk-rs/tree/master/examples/fungible-token
在@sirwillem的有用答案之后,更新此帖子以反映sim测试中的驻留错误:
---- test_sim_transfer stdout ----
thread 'test_sim_transfer' panicked at 'Outcome ExecutionOutcome {
logs: [],
receipt_ids: [
`9S5QHJgLThMCPtgJbtARenx6duSLBu3oCCtVbVpEwdLC`,
],
burnt_gas: 16326564288269,
tokens_burnt: 0,
status: Failure(Action #0: The account contract wouldn't have enough balance to cover storage, required to have 116059483300000000000000000 yoctoNEAR more),
} was a failure', /home/thor/.cargo/git/checkouts/near-sdk-rs-7ba52202f378a9d9/ea112e2/near-sdk-sim/src/outcome.rs:87:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace更新2;需要用构建脚本更新.wasm文件。谢谢。
发布于 2020-12-18 15:28:33
谢谢你跋涉进入未知的领域!我们仍在努力在模拟器所依赖的近核中发布核心箱。一旦我们有了这个,我们就可以出版它了。这将稳定它,您将不会得到这些类型的错误。
现在,要将您的Cargo.toml编辑为最新的标记,请同时修复这两种方法:
[dependencies]
near-sdk = { git = "https://github.com/near/near-sdk-rs.git", tag="2.2.0" }
[dev-dependencies]
near-sdk-sim = { git = "https://github.com/near/near-sdk-rs.git", tag="2.2.0" }然后,您必须在第70行编辑general.rs以:
contract.transfer(alice.account_id(), transfer_amount.into()),https://stackoverflow.com/questions/65356511
复制相似问题