-
Notifications
You must be signed in to change notification settings - Fork 58
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
[HotWallet] Add txsender
#124
Conversation
b4b0252
to
fd95f52
Compare
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're left with these 2 interfaces
type TxSender interface {
SendTransaction(ctx context.Context, tx *types.Transaction) (TxID, error)
WaitForTransactionReceipt(ctx context.Context, txID TxID) (*types.Receipt, error)
SenderAddress() common.Address
}
type TxManager interface {
Send(ctx context.Context, tx *types.Transaction) (*types.Receipt, error)
GetNoSendTxOpts() (*bind.TransactOpts, error)
}
which look very very similar to me. Do we still need the txmgr? Unclear to me that they don't serve the same purpose?
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.
which look very very similar to me. Do we still need the txmgr? Unclear to me that they don't serve the same purpose?
I agree that they look very similar from the interface/naming. Maybe we can clarify the naming of the two interfaces, but my understanding is the two have different purposes. txmgr
"manages" transactions in that it would manage the nonces, regas logic in case tx is stalled, etc. while txsender
supports more primitive functionalities like sending a raw transaction. So txmgr
would use txsender
to achieve the high level functionalities
afa395f
to
c73fa2e
Compare
* add txsender * more methods in fireblocks client * [HotWallet] Implement Fireblocks TxSender (#131) * more methods in fireblocks client * add fireblocks txsender
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.
LGTM!
This PR introduces a new interface
txsender
, which supports a few methods:SendTransaction
: signs a raw transaction and broadcasts it to the networkGetTransactionReceipt
: retrieves the receipt if availableSenderAddress
: address of the transaction senderIt also refactors the
TxManager
to usetxsender
instead of signing/sending the transaction itself.This interface will be used to implement remote MPC txsender that uses Fireblocks API.