Skip to content
This repository has been archived by the owner on Oct 19, 2024. It is now read-only.

Commit

Permalink
test: add type check test for abi array tuples (#1143)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattsse authored Apr 18, 2022
1 parent c1807fa commit 7a098b1
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions ethers-core/src/abi/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -270,4 +270,22 @@ mod tests {
<[u16; 32]>::param_type()
);
}

#[test]
fn abi_type_tuples_work() {
fn assert_abitype<T: AbiType>() {}
fn assert_abiarraytype<T: AbiArrayType>() {}

assert_abitype::<(u64, u64)>();
assert_abiarraytype::<(u64, u64)>();

assert_abitype::<(u8, u8)>();
assert_abiarraytype::<(u8, u8)>();

assert_abitype::<Vec<(u64, u64)>>();
assert_abiarraytype::<Vec<(u64, u64)>>();

assert_abitype::<Vec<(u8, u8)>>();
assert_abiarraytype::<Vec<(u8, u8)>>();
}
}

0 comments on commit 7a098b1

Please sign in to comment.