Skip to content

Add example debugging-strategies #2460

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

Merged
merged 20 commits into from
Mar 31, 2025
Merged

Conversation

cmichi
Copy link
Collaborator

@cmichi cmichi commented Mar 28, 2025

(1) Adds the possibility to set a feature to build a contract with during e2e tests: #[ink_e2e::test(features = ["debug-info"])]. This allows for emitting debug events in the contract, that can be checked for in testing.

(2) Adds a new contract example that illustrates:

  • how to use a debug feature with your contract
  • how to check for contract reverts and decode the error message
  • how to access the tracing API and work with it

@cmichi cmichi requested a review from ascjones as a code owner March 28, 2025 19:13
@cmichi cmichi removed the request for review from ascjones March 28, 2025 19:13
Copy link

github-actions bot commented Mar 29, 2025

🦑 📈 ink! Example Contracts ‒ Changes Report 📉 🦑

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

Contract Upstream Size (kB) PR Size (kB) Diff (kB) Diff (%) Change
call-builder-return-value 35.189 20.549 -14.64 -41.6039 📉
call-runtime 19.273 2.182 -17.091 -88.6785 📉
combined-extension 17.74 2.552 -15.188 -85.6144 📉
complex-storage-structures 32.609 4.792 -27.817 -85.3047 📉
conditional-compilation 14.379 1.45 -12.929 -89.9158 📉
contract-invocation 40.73 8.224 -32.506 -79.8085 📉
contract-invocation/contract1 15.632 1.859 -13.773 -88.1077 📉
contract-invocation/contract2 15.568 1.785 -13.783 -88.5342 📉
contract-invocation/virtual_contract 33.116 4.448 -28.668 -86.5684 📉
contract-invocation/virtual_contract_ver1 15.304 1.855 -13.449 -87.879 📉
contract-invocation/virtual_contract_ver2 15.318 1.867 -13.451 -87.8117 📉
contract-storage 32.029 17.953 -14.076 -43.9477 📉
contract-terminate 15.268 1.41 -13.858 -90.765 📉
contract-transfer 18.909 3.059 -15.85 -83.8225 📉
contract-xcm 56.69 27.206 -29.484 -52.0092 📉
cross-contract-calls 38.828 9.123 -29.705 -76.5041 📉
cross-contract-calls/other-contract 14.435 1.524 -12.911 -89.4423 📉
custom-allocator 16.58 3.014 -13.566 -81.8215 📉
custom-environment 16.516 2.091 -14.425 -87.3395 📉
dns 38.319 7.856 -30.463 -79.4984 📉
e2e-call-runtime 16.349 1.686 -14.663 -89.6874 📉
e2e-runtime-only-backend 17.014 2.253 -14.761 -86.758 📉
erc1155 54.511 19.629 -34.882 -63.9908 📉
erc20 40.069 9.497 -30.572 -76.2984 📉
erc721 42.183 10.976 -31.207 -73.98 📉
events 21.381 6.311 -15.07 -70.4831 📉
flipper 14.503 1.598 -12.905 -88.9816 📉
incrementer 14.61 1.289 -13.321 -91.1773 📉
lang-err/call-builder 37.35 8.647 -28.703 -76.8487 📉
lang-err/call-builder-delegate 31.814 3.361 -28.453 -89.4355 📉
lang-err/constructors-return-value 15.679 2.259 -13.42 -85.5922 📉
lang-err/contract-ref 39.623 7.464 -32.159 -81.1625 📉
lang-err/integration-flipper 14.959 1.811 -13.148 -87.8936 📉
lazyvec 33.695 4.86 -28.835 -85.5765 📉
mapping 39.293 9.536 -29.757 -75.731 📉
mother 26.636 13.737 -12.899 -48.4269 📉
multi-contract-caller 46.772 12.742 -34.03 -72.7572 📉
multi-contract-caller/accumulator 14.459 1.147 -13.312 -92.0672 📉
multi-contract-caller/adder 31.706 3.157 -28.549 -90.0429 📉
multi-contract-caller/subber 31.755 3.165 -28.59 -90.0331 📉
multisig 62.478 24.535 -37.943 -60.7302 📉
own-code-hash 30.636 2.23 -28.406 -92.721 📉
payment-channel 44.936 11.227 -33.709 -75.0156 📉
psp22-extension 23.734 7.44 -16.294 -68.6526 📉
rand-extension 18.82 3.448 -15.372 -81.6791 📉
runtime-call-contract 14.429 1.528 -12.901 -89.4102 📉
sol-cross-contract 21.238 5.475 -15.763 -74.2207 📉
sol-cross-contract/other-contract-sol 16.018 2.49 -13.528 -84.455 📉
sol_encoding 15.918 2.417 -13.501 -84.8159 📉
solidity-calls-flipper 37.39 7.588 -29.802 -79.7058 📉
sr25519-verification 13.979 0.95 -13.029 -93.2041 📉
static-buffer 16.308 2.498 -13.81 -84.6824 📉
storage-types 28.487 16.777 -11.71 -41.1065 📉
trait-dyn-cross-contract-calls 32.092 3.574 -28.518 -88.8633 📉
trait-dyn-cross-contract-calls/contracts/incrementer 14.534 1.588 -12.946 -89.0739 📉
trait-erc20 40.31 9.73 -30.58 -75.8621 📉
trait-incrementer 14.584 1.648 -12.936 -88.6999 📉
upgradeable-contracts/delegator 34.913 6.446 -28.467 -81.537 📉
upgradeable-contracts/delegator/delegatee 30.498 2.59 -27.908 -91.5076 📉
upgradeable-contracts/delegator/delegatee2 30.498 2.589 -27.909 -91.5109 📉
upgradeable-contracts/set-code-hash 15.068 1.498 -13.57 -90.0584 📉
upgradeable-contracts/set-code-hash-migration 15.084 1.498 -13.586 -90.0689 📉
upgradeable-contracts/set-code-hash-migration/migration 15.331 1.778 -13.553 -88.4026 📉
upgradeable-contracts/set-code-hash-migration/updated-incrementer 15.324 1.685 -13.639 -89.0042 📉
upgradeable-contracts/set-code-hash/updated-incrementer 15.051 1.455 -13.596 -90.3329 📉
wildcard-selector 16.579 2.773 -13.806 -83.274 📉

Link to the run | Last update: Mon Mar 31 15:15:33 CEST 2025

@cmichi cmichi merged commit 18249ad into master Mar 31, 2025
@cmichi cmichi deleted the cmichi-add-debugging-strategies-example branch March 31, 2025 13:23
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.

1 participant