-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'relayer/submitter' into fix/txtype [goreleaser] stage #…
- Loading branch information
Showing
3 changed files
with
34 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package relayer | ||
|
||
import "github.com/synapsecns/sanguine/ethergo/submitter" | ||
|
||
// relayerOptions is a struct that holds the options for the relayer. | ||
type relayerOptions struct { | ||
submitter submitter.TransactionSubmitter | ||
} | ||
|
||
// OptionsArgsOption is an option passed into the relayer. | ||
type OptionsArgsOption func(options *relayerOptions) | ||
|
||
// WithSubmitter sets the submitter for the relayer. | ||
func WithSubmitter(txSubmitter submitter.TransactionSubmitter) OptionsArgsOption { | ||
return func(options *relayerOptions) { | ||
options.submitter = txSubmitter | ||
} | ||
} | ||
|
||
func makeOptions(opts []OptionsArgsOption) *relayerOptions { | ||
args := &relayerOptions{} | ||
for _, opt := range opts { | ||
opt(args) | ||
} | ||
return args | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters