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

Handle empty state_changes array in contract details #733

Merged
merged 3 commits into from
Dec 2, 2022

Conversation

lukelee-sl
Copy link
Member

Signed-off-by: lukelee-sl luke.lee@swirldslabs.com

Handle the case when the state_changes field returned as an empty array.

Fixes #732

  • Documented (Code comments, README, etc.)
  • Tested (unit, integration, etc.)

Signed-off-by: lukelee-sl <luke.lee@swirldslabs.com>
@lukelee-sl lukelee-sl added the bug Something isn't working label Dec 2, 2022
@lukelee-sl lukelee-sl self-assigned this Dec 2, 2022
@Nana-EC Nana-EC requested a review from a-ridley December 2, 2022 00:32
@Nana-EC Nana-EC added this to the 0.14.0 milestone Dec 2, 2022
@Nana-EC Nana-EC added the P1 label Dec 2, 2022
packages/relay/src/lib/eth.ts Outdated Show resolved Hide resolved
packages/relay/tests/lib/eth.spec.ts Outdated Show resolved Hide resolved
Copy link
Collaborator

@Nana-EC Nana-EC left a comment

Choose a reason for hiding this comment

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

LG, offered a simplification

packages/relay/src/lib/eth.ts Outdated Show resolved Hide resolved
Signed-off-by: lukelee-sl <luke.lee@swirldslabs.com>
@codecov-commenter
Copy link

codecov-commenter commented Dec 2, 2022

Codecov Report

Base: 71.08% // Head: 71.21% // Increases project coverage by +0.13% 🎉

Coverage data is based on head (92b8ac6) compared to base (25ae55f).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #733      +/-   ##
==========================================
+ Coverage   71.08%   71.21%   +0.13%     
==========================================
  Files          16       16              
  Lines        1207     1209       +2     
  Branches      219      220       +1     
==========================================
+ Hits          858      861       +3     
+ Misses        287      286       -1     
  Partials       62       62              
Impacted Files Coverage Δ
packages/relay/src/lib/eth.ts 83.01% <100.00%> (+0.06%) ⬆️
packages/relay/src/lib/errors/JsonRpcError.ts 75.00% <0.00%> (+6.25%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@david-bakin-sl
Copy link
Member

LGTM

Signed-off-by: lukelee-sl <luke.lee@swirldslabs.com>

add utility function for brevity and clarity

Signed-off-by: lukelee-sl <luke.lee@swirldslabs.com>

remove unused import

Signed-off-by: lukelee-sl <luke.lee@swirldslabs.com>
@lukelee-sl lukelee-sl force-pushed the 732-getStorageAt-empty-array branch from 92b8ac6 to 36a62fe Compare December 2, 2022 03:23
@sonarqubecloud
Copy link

sonarqubecloud bot commented Dec 2, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

Copy link
Collaborator

@Nana-EC Nana-EC left a comment

Choose a reason for hiding this comment

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

LGTM

@lukelee-sl lukelee-sl merged commit 69c781b into main Dec 2, 2022
@lukelee-sl lukelee-sl deleted the 732-getStorageAt-empty-array branch December 2, 2022 05:12
lukelee-sl added a commit that referenced this pull request Dec 2, 2022
* Handle empty state_change array in contract details

Signed-off-by: lukelee-sl <luke.lee@swirldslabs.com>

* update errors to use predefined errors

Signed-off-by: lukelee-sl <luke.lee@swirldslabs.com>

* remove redundant null check

Signed-off-by: lukelee-sl <luke.lee@swirldslabs.com>

add utility function for brevity and clarity

Signed-off-by: lukelee-sl <luke.lee@swirldslabs.com>

remove unused import

Signed-off-by: lukelee-sl <luke.lee@swirldslabs.com>

Signed-off-by: lukelee-sl <luke.lee@swirldslabs.com>
lukelee-sl added a commit that referenced this pull request Dec 2, 2022
* Handle empty state_change array in contract details

Signed-off-by: lukelee-sl <luke.lee@swirldslabs.com>

* update errors to use predefined errors

Signed-off-by: lukelee-sl <luke.lee@swirldslabs.com>

* remove redundant null check

Signed-off-by: lukelee-sl <luke.lee@swirldslabs.com>

add utility function for brevity and clarity

Signed-off-by: lukelee-sl <luke.lee@swirldslabs.com>

remove unused import

Signed-off-by: lukelee-sl <luke.lee@swirldslabs.com>

Signed-off-by: lukelee-sl <luke.lee@swirldslabs.com>

Signed-off-by: lukelee-sl <luke.lee@swirldslabs.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working P1
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Failed to send/recv storage err=GetStorage() when testing with Foundry
4 participants