-
Notifications
You must be signed in to change notification settings - Fork 2
Signer multichain #167
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
Signer multichain #167
Conversation
| ) | ||
|
|
||
| // SignTx constructs a transaction for the specified operation | ||
| func SignTx(ctx context.Context, wallet *primary.Wallet, params SignTxParams) (tx.SignTxResult, error) { |
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.
So we can have one sign function that can be used across all chains, and have said function consumed by all implementations of wallet interface
| // BuildTxOutput represents a generic interface for transaction results | ||
| type BuildTxOutput interface { | ||
| // GetTxType returns the transaction type identifier | ||
| GetTxType() string | ||
| // GetChainType returns which chain this transaction is for | ||
| GetChainType() string | ||
| // GetTx returns the actual transaction (interface{} to support different chain types) | ||
| GetTx() interface{} | ||
| // Validate validates the result | ||
| Validate() error | ||
| } |
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.
To support multi chain Build Tx result
| ) | ||
|
|
||
| // BuildTx constructs a transaction for the specified operation | ||
| func BuildTx(ctx context.Context, wallet *primary.Wallet, params BuildTxParams) (tx.BuildTxResult, error) { |
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.
abstracting BuildTx into builder.go so that this function can be used by local wallet and server wallet so we can reuse the same function
|
|
||
| // BuildTx constructs a transaction for the specified operation | ||
| func (w *LocalWallet) BuildTx(ctx context.Context, params BuildTxParams) (tx.BuildTxResult, error) { | ||
| func (w *LocalWallet) BuildTx(ctx context.Context, params wallet.BuildTxParams) (tx.BuildTxResult, error) { |
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.
This function will now be used by all wallet implementations for signing
Creates one Signer function for all chains that can be used by all wallet implementations.
This PR also reorganizes files to be in line with local wallet / server wallet separation