Skip to content

Commit

Permalink
add functional options that allow to set 'from' and 'signerFn' fields…
Browse files Browse the repository at this point in the history
… on transaction options
  • Loading branch information
Tofel committed Sep 10, 2024
1 parent 84ab1ed commit b75540d
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions seth/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -648,6 +648,20 @@ func WithGasTipCap(gasTipCap *big.Int) TransactOpt {
}
}

// WithSignerFn sets signerFn option for bind.TransactOpts
func WithSignerFn(signerFn bind.SignerFn) TransactOpt {
return func(o *bind.TransactOpts) {
o.Signer = signerFn
}
}

// WithFrom sets from option for bind.TransactOpts
func WithFrom(fromAddress common.Address) TransactOpt {
return func(o *bind.TransactOpts) {
o.From = fromAddress
}
}

type ContextErrorKey struct{}

// NewTXOpts returns a new transaction options wrapper,
Expand Down

0 comments on commit b75540d

Please sign in to comment.