Skip to content

Commit

Permalink
fixed setup of testnt/mainnet account
Browse files Browse the repository at this point in the history
  • Loading branch information
bjartek committed Sep 29, 2022
1 parent cb46536 commit 4cf6688
Showing 1 changed file with 6 additions and 22 deletions.
28 changes: 6 additions & 22 deletions setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ import (
"github.com/onflow/flow-cli/pkg/flowkit/output"
"github.com/onflow/flow-cli/pkg/flowkit/services"
emulator "github.com/onflow/flow-emulator"
"github.com/onflow/flow-go/crypto"
"github.com/onflow/flow-go/crypto/hash"
"github.com/pkg/errors"
"github.com/rs/zerolog"

Expand Down Expand Up @@ -77,7 +75,6 @@ var defaultOverflowBuilder = OverflowBuilder{
PrintOptions: &[]OverflowPrinterOption{},
NewAccountFlowAmount: 10.0,
TransactionFees: true,
UseDefaultFlowJson: false,
}

// OverflowBuilder is the struct used to gather up configuration when building an overflow instance
Expand All @@ -101,7 +98,6 @@ type OverflowBuilder struct {
StopOnError bool
PrintOptions *[]OverflowPrinterOption
NewAccountFlowAmount float64
UseDefaultFlowJson bool
ReaderWriter flowkit.ReaderWriter
}

Expand Down Expand Up @@ -153,18 +149,10 @@ func (o *OverflowBuilder) StartResult() *OverflowState {
}
var state *flowkit.State
var err error
if o.UseDefaultFlowJson {
state, err = flowkit.Init(loader, crypto.ECDSAP256, hash.SHA3_256)
if err != nil {
overflow.Error = err
return overflow
}
} else {
state, err = flowkit.Load(o.ConfigFiles, loader)
if err != nil {
overflow.Error = err
return overflow
}
state, err = flowkit.Load(o.ConfigFiles, loader)
if err != nil {
overflow.Error = err
return overflow
}
overflow.State = state

Expand Down Expand Up @@ -300,7 +288,9 @@ func WithNetwork(network string) OverflowOption {
case "testnet", "mainnet":
o.DeployContracts = false
o.InitializeAccounts = false
o.StopOnError = false
o.InMemory = false
o.PrintOptions = nil
case emulatorValue:
o.InMemory = false
case "testing":
Expand Down Expand Up @@ -457,12 +447,6 @@ func WithoutTransactionFees() OverflowOption {
}
}

func WithDefaultFlowJson() OverflowOption {
return func(o *OverflowBuilder) {
o.UseDefaultFlowJson = true
}
}

func WithEmbedFS(fs embed.FS) OverflowOption {
return func(o *OverflowBuilder) {
wrapper := EmbedWrapper{Embed: fs}
Expand Down

0 comments on commit 4cf6688

Please sign in to comment.