Skip to content

Commit

Permalink
stuff to figure out
Browse files Browse the repository at this point in the history
  • Loading branch information
cburgdorf committed Jul 2, 2021
1 parent a2d0a06 commit cb6eab6
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
10 changes: 10 additions & 0 deletions crates/test-files/fixtures/solidity/revert_test.sol
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ struct Bag {

error StructError(Bag data);

struct StringBag {
string val0;
}

error StringBagError(StringBag data);

contract Foo {

function revert_me() public pure {
Expand Down Expand Up @@ -50,4 +56,8 @@ contract Foo {
revert StructError(Bag ({ val1: 100, val2: -100, val3: true }));
}

function revert_with_stringbag_error() public pure {
revert StringBagError(StringBag ({ val0:"foo" }));
}

}
5 changes: 5 additions & 0 deletions crates/tests/src/solidity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ use fe_compiler_test_utils::*;
"revert_with_struct_error",
encode_error("StructError((uint256,int256,bool))", &[uint_token(100), int_token(-100), bool_token(true)])
),
// The tuple itself adds another offset but only if the tuple contains a string? 🤔
// case(
// "revert_with_stringbag_error",
// encode_error("StringBagError((string))", &[string_token("foo")])
// ),
)]
fn test_revert_errors(method: &str, reason: Vec<u8>) {
with_executor(&|mut executor| {
Expand Down

0 comments on commit cb6eab6

Please sign in to comment.