Skip to content

Commit

Permalink
added casttest! for rlp
Browse files Browse the repository at this point in the history
  • Loading branch information
0xvv committed Jun 7, 2022
1 parent cec8173 commit 9ef3007
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions cli/tests/it/cast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,15 @@ casttest!(upload_signatures, |_: TestProject, mut cmd: TestCommand| {
assert!(output.contains("Function decimals(): 0x313ce567"), "{}", output);
assert!(output.contains("Function allowance(address,address): 0xdd62ed3e"), "{}", output);
});

// tests that the `cast to-rlp` and `cast from-rlp` commands work correctly
casttest!(cast_rlp, |_: TestProject, mut cmd: TestCommand| {
cmd.args(["--to-rlp", "[\"0xaa\", [[\"bb\"]], \"0xcc\"]"]);
let out = cmd.stdout_lossy();
assert!(out.contains("0xc881aac3c281bb81cc"), "{}", out);

cmd.cast_fuse();
cmd.args(["--from-rlp", "0xcbc58455556666c0c0c2c1c0"]);
let out = cmd.stdout_lossy();
assert!(out.contains("[[\"0x55556666\"],[],[],[[[]]]]"), "{}", out);
});

0 comments on commit 9ef3007

Please sign in to comment.