Skip to content

Commit

Permalink
chore: Update after rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
kulikthebird committed Apr 22, 2024
1 parent 50578d7 commit dfdad2e
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions sylvia-derive/src/multitest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,14 @@ impl<'a> ContractMtHelpers<'a> {
};
let api = quote! { < #contract_name as #sylvia ::types::ContractApi> };

let contract_ident = get_ident_from_type(contract_name);
let contract: Type = if !generic_params.is_empty() {
parse_quote! { #contract_ident ::< #(#generic_params,)* > }
} else {
parse_quote! { #contract_ident }
};
let trait_name = Ident::new(&format!("{}Proxy", contract_ident), contract_ident.span());

let exec_methods = exec_variants.variants().map(|variant| {
variant.emit_mt_method_definition(&custom_msg, &mt_app, error_type, &api)
});
Expand Down Expand Up @@ -172,10 +180,7 @@ impl<'a> ContractMtHelpers<'a> {

let impl_contract = self.emit_impl_contract();
let code_id = self.emit_code_id();
let instantiate_proxy = self.emit_instantiate_proxy();

let contract = get_ident_from_type(contract_name);
let trait_name = Ident::new(&format!("{}Proxy", contract), contract.span());
let instantiate_proxy = self.emit_instantiate_proxy(&contract);

quote! {
pub mod mt {
Expand Down Expand Up @@ -349,7 +354,7 @@ impl<'a> ContractMtHelpers<'a> {
}
}

fn emit_instantiate_proxy(&self) -> TokenStream {
fn emit_instantiate_proxy(&self, contract: &Type) -> TokenStream {
let sylvia = crate_module();
let Self {
error_type,
Expand Down

0 comments on commit dfdad2e

Please sign in to comment.