Skip to content

Commit

Permalink
Download / Sync from file
Browse files Browse the repository at this point in the history
  • Loading branch information
hhanh00 committed Oct 8, 2024
1 parent 0bc4fe6 commit 8bd9846
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 4 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ figment = { version = "0.10.19", features = [ "env", "toml" ] }
tracing = "0.1.40"
tracing-subscriber = { version = "0.3.18", features = [ "env-filter" ] }
tokio = { version = "1.40", features = ["rt-multi-thread"] }
tokio-stream = "0.1.15"
tonic = { version = "0.12", features = ["tls", "tls-native-roots", "tls-webpki-roots"] }
prost = "0.13"
hex = { version = "0.4", features = ["serde"] }
Expand Down
2 changes: 1 addition & 1 deletion dart-warp
13 changes: 12 additions & 1 deletion warp-macros/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ pub fn c_export(_attr: TokenStream, item: TokenStream) -> TokenStream {
let ItemFn { vis, block, .. } = &input;
let mut wrapped_fnargs = vec![];
let mut convs = vec![];
let mut has_coin = false;
let mut has_network = false;
let mut has_connection = false;
let mut mut_connection = false;
Expand All @@ -132,6 +133,7 @@ pub fn c_export(_attr: TokenStream, item: TokenStream) -> TokenStream {
let name = ident.to_string();
match name.as_str() {
"coin" => {
has_coin = true;
continue;
}
"network" => {
Expand Down Expand Up @@ -217,6 +219,14 @@ pub fn c_export(_attr: TokenStream, item: TokenStream) -> TokenStream {
wrapped_fnargs.push(input.clone());
}

let coin = if has_coin {
quote! {
let coin = &coin_def.clone();
}
} else {
quote! {}
};

let network = if has_network {
quote! {
let network = &coin_def.network.clone();
Expand Down Expand Up @@ -279,6 +289,7 @@ pub fn c_export(_attr: TokenStream, item: TokenStream) -> TokenStream {
let c = COINS[coin as usize].lock();
c.clone()
};
#coin
#network
#connection
#url
Expand All @@ -301,6 +312,7 @@ pub fn c_export(_attr: TokenStream, item: TokenStream) -> TokenStream {
let c = COINS[coin as usize].lock();
c.clone()
};
#coin
#network
#connection
#url
Expand All @@ -313,7 +325,6 @@ pub fn c_export(_attr: TokenStream, item: TokenStream) -> TokenStream {
}

#vis fn #ident(#inputs) #output #block

}
};

Expand Down
2 changes: 1 addition & 1 deletion ywallet

0 comments on commit 8bd9846

Please sign in to comment.