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

feat: dry-run flag to estimate gas #203

Merged
merged 13 commits into from
Jun 26, 2024
Merged

feat: dry-run flag to estimate gas #203

merged 13 commits into from
Jun 26, 2024

Conversation

AlexD10S
Copy link
Collaborator

@AlexD10S AlexD10S commented Jun 11, 2024

For pop up contract and pop call contract adds a new flag --dry-run to perform a dry-run via RPC to estimate the gas usage without submitting a transaction.

Closes #134

This PR also corrects some inaccurate error messages and refactors these errors to use the thiserror crate in the pop_contracts module. This refactor continues the work initiated in the previous PR: #111
Integration tests are required to test the call and up contracts, but is our of scope of this PR.

Copy link

codecov bot commented Jun 11, 2024

Codecov Report

Attention: Patch coverage is 57.98817% with 71 lines in your changes missing coverage. Please review.

Project coverage is 69.86%. Comparing base (e95c42b) to head (a85a974).

@@            Coverage Diff             @@
##             main     #203      +/-   ##
==========================================
+ Coverage   68.55%   69.86%   +1.30%     
==========================================
  Files          44       44              
  Lines        6374     6558     +184     
  Branches     6374     6558     +184     
==========================================
+ Hits         4370     4582     +212     
+ Misses       1337     1251      -86     
- Partials      667      725      +58     
Files Coverage Δ
crates/pop-contracts/src/errors.rs 0.00% <ø> (ø)
crates/pop-cli/src/commands/up/contract.rs 0.00% <0.00%> (ø)
crates/pop-contracts/src/up.rs 63.80% <75.00%> (+63.80%) ⬆️
crates/pop-cli/src/commands/call/contract.rs 0.00% <0.00%> (ø)
crates/pop-contracts/src/call.rs 69.84% <67.08%> (+69.84%) ⬆️

... and 3 files with indirect coverage changes

Copy link
Collaborator

@Daanvdplas Daanvdplas left a comment

Choose a reason for hiding this comment

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

Integration tests are required to test the call and up contracts, but is our of scope of this PR.

Can an issue be created for this.

crates/pop-cli/src/commands/call/contract.rs Outdated Show resolved Hide resolved
crates/pop-cli/src/commands/up/contract.rs Show resolved Hide resolved
crates/pop-contracts/src/call.rs Show resolved Hide resolved
crates/pop-contracts/src/call.rs Outdated Show resolved Hide resolved
crates/pop-contracts/src/call.rs Outdated Show resolved Hide resolved
crates/pop-contracts/src/up.rs Outdated Show resolved Hide resolved
crates/pop-contracts/src/up.rs Outdated Show resolved Hide resolved
crates/pop-contracts/src/up.rs Show resolved Hide resolved
@AlexD10S AlexD10S requested a review from Daanvdplas June 24, 2024 06:26
@AlexD10S
Copy link
Collaborator Author

Integration tests are required to test the call and up contracts, but is our of scope of this PR.

Can an issue be created for this.

#218

Copy link
Contributor

@brunopgalvao brunopgalvao left a comment

Choose a reason for hiding this comment

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

Nice!

crates/pop-cli/src/commands/call/contract.rs Outdated Show resolved Hide resolved
@AlexD10S AlexD10S merged commit f0e2dfc into main Jun 26, 2024
14 of 15 checks passed
@AlexD10S AlexD10S deleted the alex/dry-run-flag branch June 26, 2024 14:47
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.

add --gas and proof-size estimate for pop up contract and pop call contract
3 participants