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

SYS-4144: Adding filter to ethereum-events #424

Conversation

micaelffrancoAV
Copy link
Contributor

Proposed changes

Add filter to ethereum-events.

Type of change/Merge

🚨What type of change is this PR?

Put an x in the boxes that apply

  • Release
    • Increase versions
    • Baseline tests passed
    • Release type:
      • Major release
      • Minor release
      • Patch release

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR.

  • You describe the purpose of the PR, e.g.:
    • What does it do?
    • Highlight what important points reviewers should know about;
    • Indicates if there is something left for follow-up PRs.
  • Documentation updated
  • Business logic tested successfully
  • Verify First, Write Last: In Substrate development, it is important that you always ensure preconditions are met and return errors at the beginning. After these checks have completed, then you may begin the function's computation.

Further comments

@@ -712,6 +715,9 @@ pub mod pallet {
let account_id = ensure_signed(origin)?;
ensure!(&tx_hash != &H256::zero(), Error::<T>::MalformedHash);

let filter = T::EthereumEventsFilter::get_filter();
ensure!(!filter.contains(&event_type), Error::<T>::ErrorAddingEthereumLog);

// TODO [TYPE: weightInfo][PRI: medium]: Return accurate weight
return Self::add_event(event_type, tx_hash, account_id)
Copy link
Contributor

Choose a reason for hiding this comment

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

I think the check should be done in this function to ensure all entry points for events are checked:

  • add_validator_log
  • add_lift_log
  • add_ethereum_log

@micaelffrancoAV micaelffrancoAV merged commit 3a4bd6e into main Jul 11, 2024
5 checks passed
@micaelffrancoAV micaelffrancoAV deleted the SYS-4144_make_events_accepted_by_ethereum-events_configurable branch July 11, 2024 14:00
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.

3 participants