This repository has been archived by the owner on Feb 26, 2024. It is now read-only.
fix: correctly handle errors from event decoder #5332
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In some cases, when decoding an event, Ganache UI will throw an error, with the message
Cannot read property 'stack' of undefined
.Specifically, if three conditions are met:
Further details can be seen here: https://github.com/jeffsmale90/ganache-ui-stack-repro
This change fixes the issue, by correctly handling errors from the decoder. This means that if the above conditions are met, the
decodedEvent
promise resolves toundefined
, which causes the caller to render the raw data as "Encoded Event".See #5341 for a similar fix for decoding transactions.
Fixes: #5337
Fixes: #5324
Fixes: #5296
Fixes: #5273
Fixes: #5224
Fixes: #5188
Fixes: #5159
Fixes: #5105
Fixes: #4926
Fixes: #4913
Fixes: #2728
Fixes: #2245
Fixes: #2552
Fixes: #1998
Fixes: #4984
Fixes: #4826
Fixes: #4952
Fixes: #4648
Fixes: #4537
Fixes: #4891
Fixes: #4410
Fixes: #4849
Fixes: #3762
Fixes: #3632
Fixes: #3600
Fixes: #3487
Fixes: #3440
Fixes: #3454
Fixes: #3218
Fixes: #3064
Fixes: #3047
Fixes: #2230
Fixes: #2851
Fixes: #2847
Fixes: #2718
Fixes: #2657
Fixes: #2592
Fixes: #2308
Fixes: #2145
Fixes: #1916
Fixes: #1748
Fixes: #4757
Fixes: #4758
Fixes: #4724
Fixes: #4551
Fixes: #4536
Fixes: #4513
Fixes: #4445
Fixes: #4311
Fixes: #4309
Fixes: #4129
Fixes: #4084
Fixes: #4036
Fixes: #3984
Fixes: #3819
Fixes: #3796
Fixes: #3039
Fixes: #2987
Fixes: #4521
Fixes: #3259
Fixes: #1339
Fixes: #1313