-
Notifications
You must be signed in to change notification settings - Fork 0
[Feat] refactor for next chain #67
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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
SavePrivateKeyinterface from accepting*ecdsa.PrivateKeyto acceptingstringfor chain-agnostic key handling - Moved key management functions (AddKeyByPrivateKey, DeleteKey, ExportPrivateKey, ListKeys, ShowKey, AddRemoteSignerKey) from chain provider implementations to a common
chainspackage - 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.
There was a problem hiding this 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.
There was a problem hiding this 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.
Fixed: #XXXX
Implementation details
Please ensure the following requirements are met before submitting a pull request:
CHANGELOG_UNRELEASED.mdFiles changedtab in the Github PR explorer)