Cardinal-Cryptography / Cardinal-Cryptography/ink-wrapper

Generate `is_XYZ` methods for events.

Open
#40 2 comments 0 reactions 0 assignees View on GitHub
good first issue
Dominant language
Rust
Stars
12
Forks
4
PR merge metrics
No merged PRs in 30d

Description

It's often the case that we want to extract _a_ variant (subset) out of list of events. Right now we have to pattern match, add one clause for `true` and a wildcard for `false`:
```rust
get_events(contract_events)
.filter(|event| {
match event {
pair_contract::event::Event::Mint { .. } => true,
_ => false,
}
})
.collect()
```

with methods like `Event::is_mint` that code will be much terser.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.