Skip to content

Commit

Permalink
added method to set network host
Browse files Browse the repository at this point in the history
  • Loading branch information
bjartek committed Apr 30, 2024
1 parent a6de969 commit a252eba
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ type OverflowBuilder struct {
PrintOptions *[]OverflowPrinterOption
GlobalEventFilter OverflowEventFilter
Path string
NetworkHost string
Network string
ScriptFolderName string
ServiceSuffix string
Expand Down Expand Up @@ -183,6 +184,9 @@ func (o *OverflowBuilder) StartResult() *OverflowState {
overflow.Error = err
return overflow
}
if o.NetworkHost != "" {
network.Host = o.NetworkHost
}
overflow.Network = *network

logger := output.NewStdoutLogger(o.LogLevel)
Expand Down Expand Up @@ -503,6 +507,13 @@ func WithEmulatorOption(opt ...emulator.Option) OverflowOption {
}
}

// Set custom network host if different from the one in flow.json since we cannot env substs there
func WithNetworkHost(host string) OverflowOption {
return func(o *OverflowBuilder) {
o.NetworkHost = host
}
}

func WithUnderflowOptions(opt underflow.Options) OverflowOption {
return func(o *OverflowBuilder) {
o.UnderflowOptions = opt
Expand Down

0 comments on commit a252eba

Please sign in to comment.