r0gue-io / pop-cli

An all-in-one tool for Polkadot development.
GNU General Public License v3.0
57 stars 17 forks source link

feat: `dry-run` flag to estimate gas #203

Closed AlexD10S closed 5 days ago

AlexD10S commented 2 weeks ago

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 https://github.com/r0gue-io/pop-cli/issues/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: https://github.com/r0gue-io/pop-cli/pull/111 Integration tests are required to test the call and up contracts, but is our of scope of this PR.

codecov[bot] commented 2 weeks ago

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%) :arrow_up:
crates/pop-cli/src/commands/call/contract.rs 0.00% <0.00%> (ø)
crates/pop-contracts/src/call.rs 69.84% <67.08%> (+69.84%) :arrow_up:

... and 3 files with indirect coverage changes

AlexD10S commented 1 week ago

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.

https://github.com/r0gue-io/pop-cli/issues/218