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

fix(rpc): handle nil value in preapply result #16

Merged
merged 1 commit into from
Oct 21, 2024
Merged

fix(rpc): handle nil value in preapply result #16

merged 1 commit into from
Oct 21, 2024

Conversation

Awea
Copy link
Contributor

@Awea Awea commented Oct 21, 2024

Seems that sometimes POST /blocks/head/helpers/preapply/operations returns [%{"contents" => preapplied_operations}] with preapplied_operations == nil, this PR handles this case.

@Awea Awea requested a review from vhf October 21, 2024 08:00
Copy link
Contributor

@vhf vhf left a comment

Choose a reason for hiding this comment

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

Can we find something better to return as error than {:error, [%{"contents" => nil}]} when this happens?

@Awea
Copy link
Contributor Author

Awea commented Oct 21, 2024

Sure what do you think of {:error, :nil_preapply}?

Copy link
Contributor

@vhf vhf left a comment

Choose a reason for hiding this comment

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

LGTM

@Awea Awea merged commit a5ad4e2 into main Oct 21, 2024
1 check passed
@Awea Awea deleted the fix/preapply branch October 21, 2024 13:24
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