Conversation
Benchmark Size Comparison (vs main)
OK: All artifacts within 5% regression thresholdRun 22708133635 | a900bbc | 2026-03-05 08:25 UTC |
There was a problem hiding this comment.
Pull request overview
This pull request adds comprehensive end-to-end testing infrastructure and test contracts to the cargo-pvm-contract project. The PR introduces a new e2e testing crate, nine test contracts covering various scenarios, integration tests, and updates to code generation for proper handling of composite types in return values.
Changes:
- Adds
pvm-contract-e2e-testscrate with utilities for running anvil-polkadot nodes, building contracts, and interacting with the blockchain via cast - Introduces nine test contracts (flipper, storage-types, return-values, caller-check, error-handling, events, multi-method, dynamic-types, composite-types) with corresponding Solidity interfaces
- Updates dispatch code generation to correctly handle FixedArray and Tuple types in single return values, and adds special handling for DynBytes encoding
Reviewed changes
Copilot reviewed 34 out of 36 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| crates/pvm-contract-e2e-tests/ | New testing infrastructure with anvil management, contract building, and cast client |
| crates/pvm-contract-e2e-tests/tests/ | Integration and E2E tests for contract functionality and build artifacts |
| examples/test-contracts/src/ | Nine new test contracts demonstrating various contract patterns |
| examples/test-contracts/*.sol | Solidity interface files for test contracts |
| examples/test-contracts/Cargo.toml | Build configuration for test contracts |
| crates/pvm-contract-macros/src/codegen/dispatch.rs | Fixed encoding for FixedArray/Tuple returns and DynBytes special handling |
| Cargo.toml | Added pvm-contract-e2e-tests to workspace |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| }; | ||
|
|
||
| // totalSupply() -> uint256, view | ||
| let f = find_fn("totalSupply"); |
There was a problem hiding this comment.
all these asserts are quite verbose. I would just assert the whole things against a golden json file
| } | ||
|
|
||
| #[test] | ||
| #[ignore] |
There was a problem hiding this comment.
why do we ignore all the tests?
There was a problem hiding this comment.
I assumed that use may not have the anvil-polkadot installed. Removed ignore
| #![cfg_attr(not(feature = "abi-gen"), no_main)] | ||
| #![cfg_attr(not(feature = "abi-gen"), no_std)] |
There was a problem hiding this comment.
nit we should have the template generate that as
#![cfg_attr(not(feature = "abi-gen"), no_main, no_std)]
No description provided.