github multiversx/mx-sdk-rs v0.16.0
elrond-wasm 0.16.0, mandos 0.7.0, elrond-codec 0.5.3

latest releases: v0.43.0, v0.42.0, v0.41.3...
3 years ago

Major redesign of important framework components:

  • The arguments to contract/module/proxy annotations are gone. All items are generated in the same Rust module. Both submodule inclusion and contract calls are now Rust-module-aware.
  • Submodule imports are now expressed as supertraits instead of the module getter annotated methods. Note: explicitly specifying the Rust module is required, in order for the framework to fetch generated types and functions from that module.
  • Each contract now generates its own callable proxy to ease calling it. Caller contracts do no longer need to define a call interface, they can import it from the crate of the contract they want to call. Callable proxies contain the methods from the main contract, as well as from all the modules. Note: calling a contract requires the caller to specify the Rust module where it resides.
  • We no longer have a separate syntax/parser/code generation for call proxies. They are just contracts with no implementations and annotated with #[elrond_wasm_derive::proxy] instead of #[elrond_wasm_derive::contract].
  • BigUint and BigInt are now associated types instead of generics in all API traits. Contracts need to specify them as Self::BigUint instead of just BigUint. Although more verbose, this might be more intuitive for the developer.
  • ContractCalls, AsyncCalls and all other call & transfer result types now contain a reference to the Send API. This also means the execute_on_dest_context method no longer requires an api argument.
  • execute_on_dest_context can now deserialize the call results automatically and provide them to the calling contract. There is a mechanism in place to deconstruct non-serialized types, e.g. SCResult<T> becomes T and AsyncCall<Self::BigUint> becomes ().
  • Callbacks and callback proxies needed to be adapted to the new system, but work similar to how they did in the past.
  • Contracts can define proxy getter methods using the #[proxy] annotation.
  • Callbacks can now have names, just like endpoints. This name gets saved in the callback closure in storage, but has no other impact on the contract. The reason I needed it was to help me with defining callback forwarders and avoiding some name collisions there. Callback forwarders are still needed for a little longer, until module callbacks are properly implemented.

Mandos

  • mandos-rs syntax synchronized with mandos-go (sc: syntax, new ESDT call value syntax, no NFTs yet).

Don't miss a new mx-sdk-rs release

NewReleases is sending notifications on new releases.