multiversx/mx-sdk-rs

`#[only_owner]` attribute by Rust Testing Framework

newtmex opened this issue · 2 comments

Seems like a bug; the Rust Testing Framework does not handle endpoints annotated with the #[only_owner] as expected.

The Rust Testing Framework, as it is, gives you access directly to the contract methods, so annotations do not come into effect in this case (and cannot for that matter).

There is an alternate way to test contracts in a setting more akin to the real blockchain, check this out: https://github.com/ElrondNetwork/elrond-wasm-rs/blob/master/contracts/examples/multisig/tests/multisig_rust_test_v2.rs
It's closer to mandos, but in a programmatic Rust way.

Thanks @andrei-marinica for the reply.

I will study the file.

(Also thanks for the elrond-interact-snippets library, it's a very useful tool.