Skip to content

Commit

Permalink
solcall macro
Browse files Browse the repository at this point in the history
  • Loading branch information
shawnharmsen authored and prestwich committed Jun 24, 2023
1 parent f217936 commit 439af07
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions crates/sol-macro/src/expand/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,13 @@ pub(super) fn expand(cx: &ExpCtxt<'_>, error: &ItemError) -> Result<TokenStream>

#[automatically_derived]
impl ::alloy_sol_types::SolError for #name {
type Tuple<'a> = UnderlyingSolTuple<'a>;
type Token<'a> = <Self::Tuple<'a> as ::alloy_sol_types::SolType>::TokenType<'a>;
type Parameters<'a> = UnderlyingSolTuple<'a>;
type Token<'a> = <Self::Parameters<'a> as ::alloy_sol_types::SolType>::TokenType<'a>;

const SIGNATURE: &'static str = #signature;
const SELECTOR: [u8; 4] = #selector;

fn new<'a>(tuple: <Self::Tuple<'a> as ::alloy_sol_types::SolType>::RustType) -> Self {
fn new<'a>(tuple: <Self::Parameters<'a> as ::alloy_sol_types::SolType>::RustType) -> Self {
tuple.into()
}

Expand Down
6 changes: 3 additions & 3 deletions crates/sol-macro/src/expand/function.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@ fn expand_call(cx: &ExpCtxt<'_>, function: &ItemFunction) -> Result<TokenStream>

#[automatically_derived]
impl ::alloy_sol_types::SolCall for #call_name {
type Tuple<'a> = #call_tuple;
type Token<'a> = <Self::Tuple<'a> as ::alloy_sol_types::SolType>::TokenType<'a>;
type Arguments<'a> = #call_tuple;
type Token<'a> = <Self::Arguments<'a> as ::alloy_sol_types::SolType>::TokenType<'a>;

type Return = #return_name;

Expand All @@ -136,7 +136,7 @@ fn expand_call(cx: &ExpCtxt<'_>, function: &ItemFunction) -> Result<TokenStream>
const SIGNATURE: &'static str = #signature;
const SELECTOR: [u8; 4] = #selector;

fn new<'a>(tuple: <Self::Tuple<'a> as ::alloy_sol_types::SolType>::RustType) -> Self {
fn new<'a>(tuple: <Self::Arguments<'a> as ::alloy_sol_types::SolType>::RustType) -> Self {
tuple.into()
}

Expand Down

0 comments on commit 439af07

Please sign in to comment.