Skip to content

Commit

Permalink
Add tests for abi type signature
Browse files Browse the repository at this point in the history
  • Loading branch information
Rexagon committed Sep 4, 2023
1 parent 299acd6 commit ee85912
Show file tree
Hide file tree
Showing 3 changed files with 435 additions and 22 deletions.
8 changes: 4 additions & 4 deletions src/abi/traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,17 +140,17 @@ impl<T: WithAbiType> WithAbiType for crate::models::Lazy<T> {

impl WithAbiType for () {
fn abi_type() -> AbiType {
AbiType::Tuple(Vec::new())
AbiType::Tuple(Arc::from([].as_slice()))
}
}

macro_rules! impl_with_abi_type_for_tuple {
($($i:literal: $t:ident),+$(,)?) => {
impl<$($t: WithAbiType),*> WithAbiType for ($($t),+,) {
fn abi_type() -> AbiType {
AbiType::Tuple(vec![
AbiType::Tuple(Arc::from(vec![
$(NamedAbiType::from_index($i, <$t as WithAbiType>::abi_type())),*
])
]))
}
}
};
Expand Down Expand Up @@ -323,7 +323,7 @@ impl_into_plain_abi! {
},
}

/// A type with can be converted into ABI value.
/// A type with can be converted into an ABI value.
pub trait IntoAbi {
/// Returns a corresponding ABI value.
///
Expand Down
Loading

0 comments on commit ee85912

Please sign in to comment.