-
Notifications
You must be signed in to change notification settings - Fork 904
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix extending EthereumCallFilter #1382
Conversation
for (key, (proposed_start_block, new_sigs)) in | ||
other.contract_addresses_function_signatures.into_iter() | ||
{ | ||
match self.contract_addresses_function_signatures.get_mut(&key) { | ||
Some((existing_start_block, existing_sigs)) => { | ||
*existing_start_block = | ||
cmp::min(proposed_start_block, existing_start_block.clone()); | ||
existing_sigs.extend(new_sigs); | ||
} | ||
None => { | ||
self.contract_addresses_function_signatures | ||
.insert(key, (proposed_start_block, new_sigs)); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should call key
address
in this method. I got confused because I didn't know what key
meant.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code looks good otherwise. It would be nice to have a test for this though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed ;)
for (key, (proposed_start_block, new_sigs)) in | ||
other.contract_addresses_function_signatures.into_iter() | ||
{ | ||
match self.contract_addresses_function_signatures.get_mut(&key) { | ||
Some((existing_start_block, existing_sigs)) => { | ||
*existing_start_block = | ||
cmp::min(proposed_start_block, existing_start_block.clone()); | ||
existing_sigs.extend(new_sigs); | ||
} | ||
None => { | ||
self.contract_addresses_function_signatures | ||
.insert(key, (proposed_start_block, new_sigs)); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code looks good otherwise. It would be nice to have a test for this though.
Okay, let's add a test |
Test added @Jannis |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me!
Addresses graphprotocol/support#42