Skip to content

Commit

Permalink
fix: Fix macro invalid address error
Browse files Browse the repository at this point in the history
  • Loading branch information
luis-herasme committed Jul 23, 2024
1 parent d468c49 commit 0c60adf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
10 changes: 5 additions & 5 deletions ghost-crab-macros/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,11 @@ pub fn block_handler(metadata: TokenStream, input: TokenStream) -> TokenStream {
}

fn network(&self) -> String {
#network
String::from(#network)
}

fn rpc_url(&self) -> String {
#rpc_url
String::from(#rpc_url)
}

fn start_block(&self) -> u64 {
Expand Down Expand Up @@ -162,7 +162,7 @@ fn create_handler(metadata: TokenStream, input: TokenStream, is_template: bool)
network = source.network.clone();
execution_mode = source.execution_mode.clone().unwrap_or(ExecutionMode::Parallel);

let address_literal = Literal::string(&source.address);
let address_literal = Literal::string(&source.address[2..]);

address = quote! {
address!(#address_literal)
Expand Down Expand Up @@ -238,12 +238,12 @@ fn create_handler(metadata: TokenStream, input: TokenStream, is_template: bool)
#address
}

fn network(&self) - String {
fn network(&self) -> String {
String::from(#network)
}

fn rpc_url(&self) -> String {
#rpc_url
String::from(#rpc_url)
}

fn execution_mode(&self) -> ExecutionMode {
Expand Down
1 change: 1 addition & 0 deletions ghost-crab/src/prelude.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ pub use alloy::{
sol_types::{SolEvent, SolEventInterface},
};
pub use async_trait::async_trait;
pub use config::ExecutionMode;
pub use ghost_crab_macros::block_handler;
pub use ghost_crab_macros::event_handler;
pub use ghost_crab_macros::template;
Expand Down

0 comments on commit 0c60adf

Please sign in to comment.