Conversation
There was a problem hiding this comment.
Pull request overview
This PR refactors the wallet integration to simplify the contract instantiation flow by removing the need to pass a contract address parameter. The contract address is now always extracted from the ContractInstantiated event after successful submission, rather than being optionally provided by the wallet.
Key changes:
- Simplified
instantiate_contract_signedto extract contract address from events only - Removed
SubmitRequeststruct in favor of directStringpayload - Updated all wallet integration callers to use the simplified API
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| crates/pop-contracts/src/up.rs | Removed maybe_contract_address parameter and parse_h160_account import; contract address now always extracted from ContractInstantiated event |
| crates/pop-cli/src/wallet_integration.rs | Removed SubmitRequest struct and contract_address field from StateHandler; simplified submit handler to accept String directly |
| crates/pop-cli/src/common/wallet.rs | Updated request_signature to return Option<String> instead of SubmitRequest; removed unused import |
| crates/pop-cli/src/commands/up/contract.rs | Updated to use simplified request_signature and instantiate_contract_signed APIs |
| crates/pop-cli/src/commands/call/contract.rs | Updated to use simplified request_signature API |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report❌ Patch coverage is @@ Coverage Diff @@
## main #813 +/- ##
==========================================
+ Coverage 75.61% 75.63% +0.02%
==========================================
Files 115 115
Lines 26833 26813 -20
Branches 26833 26813 -20
==========================================
- Hits 20289 20281 -8
+ Misses 4374 4362 -12
Partials 2170 2170
🚀 New features to boost your workflow:
|
|
@AlexD10S if using a polkadot-sdk version older than 2509 pallet-revive won't have that commit, isn't it? |
How did you see the 2509? PassetHub I believe has the 2507 and it has the |
That PR is from June this year, so it was a mere deduction. |
Ah, I see your point. Since pop-cli already assumes this event exists when deploying a contract, this PR simply mirrors that behavior in the wallet-integration-portal. I think it’s reasonable to assume the chain will have this event. |
We previously added a patch to manually calculate the smart contract address in the wallet signing portal when the
Instantiatedevent didn't exist. Receiving the address inpop-cli.The event was reintroduced in paritytech/polkadot-sdk#8789
Since the address can now be obtained directly from the events in
pop-cli, the manual calculation is no longer necessary in the wallet signing portal and can be removed.Is basically removing undoing this commit where this was introduced: 3b7e059
The changes in the wallet signing portal that needs to be reviewed too are in: r0gue-io/pop-wallet-signing-portal#12