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

feat: error handling for event feeder #133

Open
wants to merge 11 commits into
base: aurras-runtime-lite-dev
Choose a base branch
from

Conversation

Prathiksha-Nataraja
Copy link
Contributor

Pull Request Template

Description

Error handling -> Event Feeder

Please select the options that are relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist:

  • Pull Request follow only a single responsibility.
  • Code follows the style guidelines of this project
  • Performed a self-review of my own code
  • Commented my code, particularly in hard-to-understand areas
  • Made corresponding changes to the documentation
  • Changes generate no new warnings
  • Added tests that prove fix is effective or the feature works
  • New and existing unit tests pass locally with the changes
  • Any dependent changes have been merged and published in downstream modules
  • Checked the code and corrected any misspellings

})
.flat_map(|tendermint_event| {
Self::convert_to_feeder_event(self, tendermint_event, &self.chain_config)
.unwrap()
Copy link
Contributor

Choose a reason for hiding this comment

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

handle error

event_feed/src/main.rs Show resolved Hide resolved

let events = self.events.iter().map(|e| e.0.clone());

let filter = Filter::new().from_block(last_block - 25).events(events);

let mut stream = client.subscribe_logs(&filter).await?;
let mut stream = match client.subscribe_logs(&filter).await {
Copy link
Contributor

Choose a reason for hiding this comment

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

? operator is enough to return the error

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.

2 participants