无法构建智能合约-使用erdpy构建合约编译elrond-wasm时出错



当我尝试从这里使用:

构建乒乓智能合约时:
erdpy build contract

我没有得到以下预期的输出:

INFO:projects.core:WASM file generated: output/ping-pong.wasm

,因为sc_results.rs文件中出现以下错误:

Compiling elrond-codec v0.5.3
Compiling elrond-wasm v0.18.2
error[E0432]: unresolved import `core::ops::FromResidual`
--> /Users/<username>/elrondsdk/vendor-rust/registry/src/github.com-1ecc6299db9ec823/elrond-wasm-0.18.2/src/types/io/sc_result.rs:7:30
...
error[E0437]: type Output is not a member of trait `Try`
--> /Users/<username>/elrondsdk/vendor-rust/registry/src/github.com-1ecc6299db9ec823/elrond-wasm-0.18.2/src/types/io/sc_result.rs:62:5
...
error[E0437]: type Residual is not a member of trait `Try`
--> /Users/<username>/elrondsdk/vendor-rust/registry/src/github.com-1ecc6299db9ec823/elrond-wasm-0.18.2/src/types/io/sc_result.rs:63:5
...
error[E0407]: method branch is not a member of trait `Try`
--> /Users/<username>/elrondsdk/vendor-rust/registry/src/github.com-1ecc6299db9ec823/elrond-wasm-0.18.2/src/types/io/sc_result.rs:65:5
...
error[E0407]: method from_output is not a member of trait `Try`
--> /Users/<username>/elrondsdk/vendor-rust/registry/src/github.com-1ecc6299db9ec823/elrond-wasm-0.18.2/src/types/io/sc_result.rs:71:5
...
error aborting due to 5 previous errors
...
CRITICAL:cli:Build error: error code = 101, see output.

环境:

  • elrond-wasm - v0.18.2
  • erdpy - v1.0.19

如何解决这个构建问题?

问题是Rust在今年早些时候有一个不向后兼容的更改。因此,与旧版本不兼容,但与新版本兼容。

使用

更新Rust
rustup update

解决了问题。

:

rustc --version | grep -o '^[^(]*'

打印

rustc 1.57.0-nightly

最新更新