Skip to content

Commit

Permalink
fix: throw an error if trying to include a non-event type in the `inc…
Browse files Browse the repository at this point in the history
…lude_events` array
  • Loading branch information
joshstevens19 committed Jul 27, 2024
1 parent 8befab8 commit de92672
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/src/manifest/yaml.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ pub enum ValidateManifestError {
#[error("Could not read or parse ABI for contract {0} with path {1}")]
InvalidABI(String, String),

#[error("Event {0} included in include_events for contract {1} not found in ABI")]
#[error("Event {0} included in include_events for contract {1} but not found in ABI - it must be an event type and match the name exactly")]
EventIncludedNotFoundInABI(String, String),

#[error("Event {0} not found in ABI for contract {1}")]
Expand Down Expand Up @@ -113,7 +113,7 @@ fn validate_manifest(

if let Some(include_events) = &contract.include_events {
for event in include_events {
if !events.iter().any(|e| e.name == *event) {
if !events.iter().any(|e| e.name == *event && e.type_ == "event") {
return Err(ValidateManifestError::EventIncludedNotFoundInABI(
event.clone(),
contract.name.clone(),
Expand Down
2 changes: 2 additions & 0 deletions documentation/docs/pages/docs/changelog.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
### Bug fixes
-------------------------------------------------

fix: throw an error if trying to include a non-event type in the `include_events` array

### Breaking changes
-------------------------------------------------

Expand Down

0 comments on commit de92672

Please sign in to comment.