I'm trying to create a new ManagedBuffer
in a rust test, but the tests panic. I've tried using both, the ManagedBuffer::new_from_bytes
function and the managed_buffer!
macro, but both of them result in the same error:
thread 'use_managed_buffer_new_from_bytes' panicked at 'called
Option::unwrap()
on aNone
value', /home/mccuna/elrondsdk/vendor-rust/registry/src/github.com-1ecc6299db9ec823/elrond-wasm-debug-0.27.4/src/tx_mock/tx_context_stack.rs:16:28
thread 'use_managed_buffer_macro' panicked at 'called
Option::unwrap()
on aNone
value', /home/mccuna/elrondsdk/vendor-rust/registry/src/github.com-1ecc6299db9ec823/elrond-wasm-debug-0.27.4/src/tx_mock/tx_context_stack.rs:16:28
// test_test.rs
use elrond_wasm::types::ManagedBuffer;
use elrond_wasm_debug::{managed_buffer, tx_mock::TxContextRef};
#[test]
fn use_managed_buffer_macro() {
let test: ManagedBuffer<TxContextRef> = managed_buffer!(b"Test");
}
#[test]
fn use_managed_buffer_new_from_bytes() {
let test = ManagedBuffer::<TxContextRef>::new_from_bytes(b"Test");
}
Versions used:
[dependencies.elrond-wasm]
version = "0.27.4"
[dev-dependencies.elrond-wasm-debug]
version = "0.27.4"