Skip to content
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

Merged
3 commits merged into from
Nov 26, 2019
Merged

Fix extending EthereumCallFilter #1382

3 commits merged into from
Nov 26, 2019

Conversation

ghost
Copy link

@ghost ghost commented Nov 25, 2019

Comment on lines 331 to 343
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));
}
Copy link
Contributor

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.

Copy link
Contributor

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.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed ;)

Comment on lines 331 to 343
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));
}
Copy link
Contributor

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.

@ghost
Copy link
Author

ghost commented Nov 25, 2019

Okay, let's add a test

@ghost
Copy link
Author

ghost commented Nov 26, 2019

Test added @Jannis

@ghost ghost closed this Nov 26, 2019
@ghost ghost reopened this Nov 26, 2019
Copy link
Contributor

@Jannis Jannis left a 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!

@ghost ghost merged commit f691d29 into master Nov 26, 2019
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant