Skip to content
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

Make NodeClient satisfy AptosRpcClient interface #124

Merged
merged 2 commits into from
Feb 8, 2025

Conversation

friedemannf
Copy link
Contributor

Description

The AptosRpcClient interface is supposed to be implemented by NodeClient:

// AptosRpcClient is an interface for all functionality on the Client that is Node RPC related. Its main implementation
// is [NodeClient]

But doesn't actually satisfy the interface due to two methods:

  1. NodeAPIHealthCheck
methods are missing: NodeAPIHealthCheck(durationSecs ...uint64) (api. HealthCheckResponse, error)

I wasn't sure if you'd want to break compatibility by renaming the method and added a new method NodeAPIHealthCheck and kept the old one NodeHealthCheck while marking it as deprecated.

  1. BuildSignAndSubmitTransaction
need the method: BuildSignAndSubmitTransaction(sender *Account, payload TransactionPayload, options ...any) (data *api. SubmitTransactionResponse, err error)
have the method: BuildSignAndSubmitTransaction(sender TransactionSigner, payload TransactionPayload, options ...any) (data *api. SubmitTransactionResponse, err error)

NodeClient already accepted the TransactionSigner interface and I lifted its usage to the AptosRpcClient interface. This should not break compatibility as *Account can still be passed.

Test Plan

Ran all tests with go test ./...

Related Links

These interfaces were requested in #94 and added in #97

@friedemannf friedemannf requested review from gregnazario and a team as code owners February 3, 2025 14:11
@gregnazario gregnazario enabled auto-merge (rebase) February 6, 2025 18:01
@gregnazario gregnazario merged commit 5a65e90 into aptos-labs:main Feb 8, 2025
2 checks passed
@friedemannf friedemannf deleted the AptosRpcClient-interface branch February 10, 2025 18:24
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.

2 participants