use neo_devpack_solidity::runtime::execution::ExecutionContext;
use neo_devpack_solidity::runtime::RuntimeConfig;
#[test]
fn size_of_array_and_map() {
let code = vec![
0x11, 0x12, 0x13, 0x13, 0xC0, 0xCA, 0xC8, 0x4A, 0x0C, 0x02, b'a', b'a', 0x11, 0xD0, 0xCA, 0x40, ];
let mut ctx = ExecutionContext::new(&RuntimeConfig::default()).expect("context init");
ctx.initialize(&code, &[]).expect("init");
while !ctx.step().expect("step").halted {}
let expected = (1i64).to_le_bytes().to_vec();
assert_eq!(ctx.return_data(), expected);
}
#[test]
fn size_errors_on_scalar() {
let code = [0x11, 0xCA];
let mut ctx = ExecutionContext::new(&RuntimeConfig::default()).expect("context init");
ctx.initialize(&code, &[]).expect("init");
let err = ctx.step().and_then(|_| ctx.step()).err();
assert!(err.is_some(), "SIZE on scalar should error");
}