feat(zetaclient): PTB building for Sui withdrawAndCall transaction#3793
feat(zetaclient): PTB building for Sui withdrawAndCall transaction#3793ws4charlie merged 59 commits intodevelopfrom
Conversation
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the 📝 WalkthroughWalkthroughThis change set introduces comprehensive support for Sui programmable transaction blocks (PTB) in the ZetaClient, specifically targeting the "withdrawAndCall" pattern. It adds new Move modules for Sui contract testing, expands configuration and deployment logic to handle example contracts, and implements robust Go-side utilities to build, parse, and test PTB transactions. The ZetaClient's signer logic is refactored to construct and broadcast PTB transactions, with appropriate logging and object reference management. Supporting utilities for Sui coin types and PTB arguments are added, and extensive unit tests ensure correctness of the new parsing and transaction-building logic. Mock interfaces and dependencies are updated to accommodate new RPC requirements. Changes
Sequence Diagram(s)sequenceDiagram
participant Test as E2E Test
participant Runner as E2ERunner
participant SuiChain as Sui Blockchain
participant Signer as ZetaClient Signer
Test->>Runner: Deploy Sui Example Contracts
Runner->>SuiChain: Publish Move modules (token, connected)
SuiChain-->>Runner: Return package and object IDs
Test->>Runner: Prepare WithdrawAndCall Test
Runner->>Signer: Build PTB withdrawAndCall transaction
Signer->>SuiChain: Fetch object refs, build PTB
Signer->>SuiChain: Broadcast PTB transaction
SuiChain-->>Signer: Transaction result
Test->>SuiChain: Query recipient balance
SuiChain-->>Test: Return balance
Assessment against linked issues
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #3793 +/- ##
===========================================
+ Coverage 64.38% 64.40% +0.02%
===========================================
Files 463 464 +1
Lines 33356 33667 +311
===========================================
+ Hits 21476 21684 +208
- Misses 10889 10976 +87
- Partials 991 1007 +16
🚀 New features to boost your workflow:
|
… withdraw and call logic to use correct object information
… in the sui signer context
|
!!!WARNING!!! Be very careful about using Only suppress a single rule (or a specific set of rules) within a section of code, while continuing to scan for other problems. To do this, you can list the rule(s) to be suppressed within the #nosec annotation, e.g: /* #nosec G401 */ or //#nosec G201 G202 G203 Pay extra attention to the way |
|
@ws4charlie ready for new review? |
Yeah. The |
lumtis
left a comment
There was a problem hiding this comment.
Solid ✅
Can't approve since I orignally created the PR but it looks good to me
swift1337
left a comment
There was a problem hiding this comment.
Thanks for addressing all comments! Looks solid 📈
The only part that is left IMO is to add a unit test for TestSigner.ProcessCCTX that checks that all RPC calls are valid (similarly to ts.MockMoveCall(...)).
Let's tackle this in a separate issue: #3829
…add more description on PTB gas budget transfer command
Description
Done
withdrawAndCallPTB inspired from https://github.com/zeta-chain/localnet/blob/main/packages/localnet/src/suiWithdrawAndCall.ts.Much more complex to do in Go, we right now use third party library that we might want to fork
withdrawAndCalland E2E testTestSuiWithdrawAndCallRevertWithCallto testwithdrawAndCallrevert.Closes #3740 #3741
Summary by CodeRabbit
New Features
Bug Fixes
Documentation
Tests
Chores