Skip to content

Conversation

@tanut32039
Copy link
Contributor

Fixed: #XXXX

Implementation details

  • refactor some parts to be compatible for next chain type (ex. xrpl native, sol)

Please ensure the following requirements are met before submitting a pull request:

  • The pull request is targeted against the correct target branch
  • The pull request is linked to an issue with appropriate discussion and an accepted design OR is linked to a spec that describes the work.
  • The pull request includes a description of the implementation/work done in detail.
  • The pull request includes any and all appropriate unit/integration tests
  • You have added a relevant changelog entry to CHANGELOG_UNRELEASED.md
  • You have re-reviewed the files affected by the pull request (e.g. using the Files changed tab in the Github PR explorer)

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request refactors the wallet and key management architecture to support multiple chain types beyond EVM (e.g., XRPL native, Solana). The refactoring makes the codebase more modular and chain-agnostic by extracting common wallet operations into a shared chains package.

Changes:

  • Changed SavePrivateKey interface from accepting *ecdsa.PrivateKey to accepting string for chain-agnostic key handling
  • Moved key management functions (AddKeyByPrivateKey, DeleteKey, ExportPrivateKey, ListKeys, ShowKey, AddRemoteSignerKey) from chain provider implementations to a common chains package
  • Updated all tests and mocks to reflect the new architecture

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
relayer/wallet/wallet.go Changed SavePrivateKey signature to accept string instead of *ecdsa.PrivateKey
relayer/wallet/geth/wallet.go Updated implementation to convert hex string to ECDSA key internally
relayer/wallet/geth/wallet_test.go Updated tests to pass hex-encoded private keys
relayer/chains/keys.go New file containing chain-agnostic key management functions
relayer/chains/signer.go New file containing LoadSigners helper function
relayer/chains/provider.go Removed key management methods from KeyProvider interface
relayer/chains/evm/keys.go Simplified to only handle mnemonic-based key generation
relayer/chains/evm/signer.go Simplified to delegate to chains.LoadSigners
relayer/chains/evm/keys_test.go Updated tests to use new chains package functions
relayer/chains/signer_test.go Moved and updated test, changed package name
relayer/app.go Added getWallet helper and updated to use chains package functions
relayer/app_test.go Updated mock expectations to work with new architecture
internal/relayertest/mocks/wallet.go Updated mock SavePrivateKey signature
internal/relayertest/mocks/chain_provider.go Removed key management methods from mock

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 14 out of 14 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 14 out of 14 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

3 participants