Skip to content

Commit

Permalink
Keep add_ APIs consistent
Browse files Browse the repository at this point in the history
  • Loading branch information
Jurshsmith committed Mar 12, 2024
1 parent 6a950b5 commit 6a85571
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions chaindexing/src/contracts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,20 +47,15 @@ impl<S: Send + Sync + Clone> Contract<S> {
}
}

pub fn add_address(&mut self, address: &str, chain: &Chain, start_block_number: i64) -> Self {
let mut addresses = self.addresses.clone();

addresses.push(UnsavedContractAddress::new(
pub fn add_address(mut self, address: &str, chain: &Chain, start_block_number: i64) -> Self {
self.addresses.push(UnsavedContractAddress::new(
&self.name,
address,
chain,
start_block_number,
));

Self {
addresses,
..self.clone()
}
self
}

pub fn add_event(
Expand Down

0 comments on commit 6a85571

Please sign in to comment.