Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Trace filtering fix #2760

Merged
merged 4 commits into from
Oct 20, 2016
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions ethcore/src/types/trace_types/filter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,13 @@ impl From<Vec<Address>> for AddressesFilter {
impl AddressesFilter {
/// Returns true if address matches one of the searched addresses.
pub fn matches(&self, address: &Address) -> bool {
self.matches_all() || self.list.contains(address)
}
self.matches_all() || self.stricly_matches(address)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

extra space here

Copy link
Contributor

Choose a reason for hiding this comment

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

actually the issue here is that this whole line is using spaces instead of tabs for indentation.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep just saw that


/// Returns true if address matches at least one of the searched addresses.
pub fn stricly_matches(&self, address: &Address) -> bool {
Copy link
Contributor

Choose a reason for hiding this comment

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

strictly*

Copy link
Contributor Author

@ngotchac ngotchac Oct 20, 2016

Choose a reason for hiding this comment

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

Arh...

self.list.contains(address)
}

/// Returns true if this address filter matches everything.
pub fn matches_all(&self) -> bool {
Expand Down Expand Up @@ -127,7 +132,7 @@ impl Filter {
};

action || match trace.result {
Res::Create(ref create) => self.to_address.matches(&create.address),
Res::Create(ref create) => self.to_address.stricly_matches(&create.address),
Copy link
Collaborator

@tomusdrw tomusdrw Oct 20, 2016

Choose a reason for hiding this comment

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

Couldn't we replace L124 with self.to_address.matches(&create.address) and remove this ||? (strictly_matches would not be required at all)

Copy link
Contributor Author

@ngotchac ngotchac Oct 20, 2016

Choose a reason for hiding this comment

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

Yes that would be totally equivalent.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

However the address field is in the result part of the trace, not in the action

_ => false
}
}
Expand Down