Skip to content

Improve failure message of contract import unhandled array types - #77

Merged
JonoPrest merged 1 commit into
mainfrom
jp/improve-import-failure-msg
Jul 17, 2024
Merged

JonoPrest merged 1 commit into
mainfrom
jp/improve-import-failure-msg

Conversation

@JonoPrest

Copy link
Copy Markdown
Collaborator

No description provided.

@JonoPrest
JonoPrest requested a review from DZakh July 17, 2024 11:08
Comment on lines +1162 to +1166
EthAbiParamType::Tuple(_) => {
Err(anyhow!("Unhandled contract import type 'array of tuple'"))?
}
EthAbiParamType::Array(_) => {
Err(anyhow!("Unhandled contract import type 'array of array'"))?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

To be more clear about what is failing

Comment on lines +1170 to +1171
let inner_type = Self::from_ethabi_type(abi_type)
.context("Unhandled contract import nested type in array")?;

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This recursion should not fail here actually since we error the unhandled cases above this but just a backup for changing code in future.

Comment on lines -405 to +408
.context("converting eth event param to gql scalar")?,
.context(format!(
"Converting eth event param '{}' to gql scalar",
flattened_event_param.event_param.name
))?,

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Add context of which param fails

@DZakh DZakh left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

👍

@JonoPrest
JonoPrest merged commit 79326da into main Jul 17, 2024
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