zint 0.1.12

Zink testing utils
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use zint::EVM;

const ADDITION_BYTECODE: &str = "6000356020350160005260206000f3";
const INPUT: &str = "00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000002";
const RESULT: &str = "0000000000000000000000000000000000000000000000000000000000000003";

#[test]
fn addition() -> anyhow::Result<()> {
    let info = EVM::interp(&hex::decode(ADDITION_BYTECODE)?, &hex::decode(INPUT)?)?;
    assert_eq!(info.ret, hex::decode(RESULT)?);

    Ok(())
}