Skip to content

[E2E] Rename .call to .call_builder#2078

Merged
cmichi merged 9 commits intomasterfrom
cmichi-rename-call-to-call_builder
Jan 30, 2024
Merged

[E2E] Rename .call to .call_builder#2078
cmichi merged 9 commits intomasterfrom
cmichi-rename-call-to-call_builder

Conversation

@cmichi
Copy link
Collaborator

@cmichi cmichi commented Jan 29, 2024

Summary

I always stumble over this:

let mut call = contract.call::<Flipper>(); let get = call.get(); let get_res = client.call(&ink_e2e::bob(), &get).dry_run().await?;

To me this makes more sense:

let mut call_builder = contract.call_builder::<Flipper>(); let get = call_builder.get(); let get_res = client.call(&ink_e2e::bob(), &get).dry_run().await?;
  • [y] y/n | Does it introduce breaking changes?
  • [n] y/n | Is it dependant on the specific version of cargo-contract or pallet-contracts?

Description

Checklist before requesting a review

  • My code follows the style guidelines of this project
  • I have added an entry to CHANGELOG.md
  • I have commented my code, particularly in hard-to-understand areas
  • I have added tests that prove my fix is effective or that my feature works
  • Any dependent changes have been merged and published in downstream modules
@codecov-commenter
Copy link

codecov-commenter commented Jan 29, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (1ea20a2) 53.73% compared to head (99e4db3) 53.68%.
Report is 5 commits behind head on master.

❗ Current head 99e4db3 differs from pull request most recent head 466db6a. Consider uploading reports for the commit 466db6a to get more accurate results

Additional details and impacted files
@@ Coverage Diff @@ ## master #2078 +/- ## ========================================== - Coverage 53.73% 53.68% -0.06%  ========================================== Files 223 223 Lines 7040 7043 +3 Branches 3120 3121 +1 ========================================== - Hits 3783 3781 -2  - Misses 3257 3262 +5 

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@github-actions
Copy link

github-actions bot commented Jan 29, 2024

🦑 📈 ink! Example Contracts ‒ Changes Report 📉 🦑

These are the results when building the integration-tests/* contracts from this branch with cargo-contract and comparing them to ink! master:

Contract Upstream Size (kB) PR Size (kB) Diff (kB) Diff (%) Change
basic-contract-caller 3.303 3.303 0 0
basic-contract-caller/other-contract 1.583 1.583 0 0
call-builder-return-value 9.169 9.169 0 0
call-runtime 2.061 2.061 0 0
combined-extension 2.12 2.12 0 0
conditional-compilation 1.49 1.49 0 0
contract-storage 7.568 7.568 0 0
contract-terminate 1.329 1.329 0 0
contract-transfer 1.689 1.689 0 0
custom-allocator 7.775 7.775 0 0
custom-environment 2.146 2.146 0 0
dns 7.318 7.318 0 0
e2e-call-runtime 1.296 1.296 0 0
e2e-runtime-only-backend 1.881 1.881 0 0
erc1155 14.237 14.237 0 0
erc20 6.918 6.918 0 0
erc721 9.873 9.873 0 0
events 5.258 5.258 0 0
flipper 1.639 1.639 0 0
incrementer 1.504 1.504 0 0
lang-err-integration-tests/call-builder-delegate 2.638 2.638 0 0
lang-err-integration-tests/call-builder 5.066 5.066 0 0
lang-err-integration-tests/constructors-return-value 1.985 1.985 0 0
lang-err-integration-tests/contract-ref 4.629 4.629 0 0
lang-err-integration-tests/integration-flipper 1.815 1.815 0 0
lazyvec-integration-test 4.616 4.616 0 0
mapping-integration-tests 7.999 7.999 0 0
mother 12.741 12.741 0 0
multi-contract-caller 6.106 6.106 0 0
multi-contract-caller/accumulator 1.378 1.378 0 0
multi-contract-caller/adder 1.968 1.968 0 0
multi-contract-caller/subber 1.988 1.988 0 0
multisig 21.688 21.688 0 0
payment-channel 5.659 5.659 0 0
psp22-extension 7.071 7.071 0 0
rand-extension 2.965 2.965 0 0
sr25519-verification 1.142 1.142 0 0
static-buffer 1.654 1.654 0 0
trait-dyn-cross-contract-calls 2.793 2.793 0 0
trait-dyn-cross-contract-calls/contracts/incrementer 1.545 1.545 0 0
trait-erc20 7.294 7.294 0 0
trait-flipper 1.49 1.49 0 0
trait-incrementer 1.614 1.614 0 0
upgradeable-contracts/delegator 3.151 3.151 0 0
upgradeable-contracts/delegator/delegatee 1.609 1.609 0 0
upgradeable-contracts/set-code-hash 1.743 1.743 0 0
upgradeable-contracts/set-code-hash/updated-incrementer 1.721 1.721 0 0
wildcard-selector 2.846 2.846 0 0

Link to the run | Last update: Tue Jan 30 15:15:25 CET 2024

@cmichi cmichi marked this pull request as ready for review January 29, 2024 18:23
@cmichi cmichi changed the title [E2E] Rename .call to .call_builder. [E2E] Rename .call to .call_builder Jan 29, 2024
Copy link
Contributor

@SkymanOne SkymanOne left a comment

Choose a reason for hiding this comment

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

LGTM. Just need changes mentioned by Andrew

@cmichi cmichi merged commit f878b00 into master Jan 30, 2024
@cmichi cmichi deleted the cmichi-rename-call-to-call_builder branch January 30, 2024 13:12
@SkymanOne SkymanOne mentioned this pull request Feb 8, 2024
@SkymanOne SkymanOne mentioned this pull request Mar 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

5 participants