diff --git a/dart-warp b/dart-warp index c681599..be84e1e 160000 --- a/dart-warp +++ b/dart-warp @@ -1 +1 @@ -Subproject commit c681599d673f48057789a3f579bac4320b7b03ed +Subproject commit be84e1ea3b8aa2dab11511e6d3d121137f0ab625 diff --git a/warp-macros/src/lib.rs b/warp-macros/src/lib.rs index 68a8b16..8d9b702 100644 --- a/warp-macros/src/lib.rs +++ b/warp-macros/src/lib.rs @@ -131,6 +131,9 @@ pub fn c_export(_attr: TokenStream, item: TokenStream) -> TokenStream { let ident = ¶m.ident; let name = ident.to_string(); match name.as_str() { + "coin" => { + continue; + } "network" => { has_network = true; continue; @@ -216,14 +219,14 @@ pub fn c_export(_attr: TokenStream, item: TokenStream) -> TokenStream { let network = if has_network { quote! { - let network = &coin.network.clone(); + let network = &coin_def.network.clone(); } } else { quote! {} }; let url = if has_url { quote! { - let url = coin.url.clone(); + let url = coin_def.config.lwd_url.clone().unwrap(); } } else { quote! {} @@ -231,12 +234,12 @@ pub fn c_export(_attr: TokenStream, item: TokenStream) -> TokenStream { let connection = if has_connection { if mut_connection { quote! { - let mut connection = coin.connection()?; + let mut connection = coin_def.connection()?; let connection: &mut rusqlite::Connection = &mut connection; } } else { quote! { - let connection = &coin.connection()?; + let connection = &coin_def.connection()?; } } } else { @@ -244,7 +247,7 @@ pub fn c_export(_attr: TokenStream, item: TokenStream) -> TokenStream { }; let client = if has_client { quote! { - let mut client = coin.connect_lwd().await?; + let mut client = coin_def.connect_lwd().await?; let client = &mut client; } } else { @@ -272,7 +275,7 @@ pub fn c_export(_attr: TokenStream, item: TokenStream) -> TokenStream { #[tokio::main] pub async extern "C" fn #wrapper(coin: u8, #(#wrapped_fnargs),*) -> CResult<#c_result_type> { let res = async { - let coin = { + let coin_def = { let c = COINS[coin as usize].lock(); c.clone() }; @@ -294,7 +297,7 @@ pub fn c_export(_attr: TokenStream, item: TokenStream) -> TokenStream { #[no_mangle] pub extern "C" fn #wrapper(coin: u8, #(#wrapped_fnargs),*) -> CResult<#c_result_type> { let res = || { - let coin = { + let coin_def = { let c = COINS[coin as usize].lock(); c.clone() }; diff --git a/zcash-warp b/zcash-warp index 036f153..aafdeb0 160000 --- a/zcash-warp +++ b/zcash-warp @@ -1 +1 @@ -Subproject commit 036f1531663ec5a1ee2bc92e4e831fb192b69f71 +Subproject commit aafdeb088f39796c127877c245cd351dde8c88b9