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 (#1131)
  • Loading branch information
Tofel committed Sep 12, 2024
1 parent e356557 commit a5e921a
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 a5e921a

Please sign in to comment.