[Chore] Sui gRPC client migration#1028
Conversation
|
|
can you fix the tests? and we will need a changeset for a new version. |
Rebasing from |
adc8557 to
d2a5c25
Compare
There was a problem hiding this comment.
Pull request overview
This PR migrates the Sui integration from the block-vision HTTP RPC client interface to the chainlink-sui gRPC-backed PTB client, updating providers, adapters, and tests to use the new client and generating new mocks for the updated interfaces.
Changes:
- Switch Sui
Chain.Clientand providers to usechainlink-sui/relayer/client(SuiPTBClient) and add a helper to derive a gRPC target from an HTTP RPC URL. - Update MCMS chain-access adapter and Sui tests to work with the new client interfaces.
- Regenerate Sui mocks via mockery and update Go module dependencies accordingly.
Reviewed changes
Copilot reviewed 10 out of 15 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| go.mod | Adds go-cache, bumps/adjusts deps for the new Sui client + related modules. |
| go.sum | Updates checksums for dependency changes. |
| datastore/catalog/remote/main_test.go | Adjusts catalog testcontainer setup/cleanup usage. |
| chain/sui/sui_chain.go | Changes Sui chain client type to the new PTB client. |
| chain/sui/sui_chain_test.go | Updates balance read test to use the new PTB client API/return types. |
| chain/sui/provider/rpc_provider.go | Creates the PTB client (gRPC) instead of the old HTTP RPC client. |
| chain/sui/provider/ctf_provider.go | Creates the PTB client for CTF-based Sui nodes. |
| chain/sui/client.go | Adds NewPTBClientFromNodeURL + URL→gRPC-target conversion helper. |
| chain/mcms/adapters/chain_access.go | Updates SuiClient return type to BindingsClient. |
| chain/mcms/adapters/chain_access_test.go | Updates tests to use the new Sui mocks (and removes one assertion). |
| chain/sui/mocks/sui_signer.go | New generated mock for Sui signer. |
| chain/sui/mocks/sui_ptb_client.go | New generated mock for the PTB client (adds go-cache dep). |
| chain/sui/mocks/bindings_client.go | New generated mock for bindings client interface. |
| .mockery.yml | Updates mockery targets from block-vision interfaces to chainlink-sui interfaces. |
Files not reviewed (3)
- chain/sui/mocks/bindings_client.go: Language not supported
- chain/sui/mocks/sui_ptb_client.go: Language not supported
- chain/sui/mocks/sui_signer.go: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 11 out of 16 changed files in this pull request and generated 3 comments.
Files not reviewed (3)
- chain/sui/mocks/bindings_client.go: Language not supported
- chain/sui/mocks/sui_ptb_client.go: Language not supported
- chain/sui/mocks/sui_signer.go: Language not supported
| @@ -223,7 +224,11 @@ func (p *CTFChainProvider) startContainer( | |||
| url = result.url | |||
| fauceturl = fmt.Sprintf("http://%s:%s", "127.0.0.1", result.faucetPort) | |||
There was a problem hiding this comment.
will this kind of faucet URL still work after RPC shuts down?
There was a problem hiding this comment.
the faucet runs as a separate service which isn't the same as the RPC node, they don't mention it in their migration guide: https://sdk.mystenlabs.com/sui/migrations/sui-2.0
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 11 out of 16 changed files in this pull request and generated 1 comment.
Files not reviewed (3)
- chain/sui/mocks/bindings_client.go: Generated file
- chain/sui/mocks/sui_ptb_client.go: Generated file
- chain/sui/mocks/sui_signer.go: Generated file
| suiClient, ok := a.SuiClient(999) | ||
| require.False(t, ok) | ||
| require.Nil(t, suiClient) |
|




This PR includes the following changes:
ISuiAPIreference (old version of the Sui SDK) in favor of using a client interface exported bychainlink-sui/relayer/client.