Skip to content

Commit 35af93d

Browse files
committed
removing unuused stuff from main state
1 parent 4a9b777 commit 35af93d

File tree

2 files changed

+2
-43
lines changed

2 files changed

+2
-43
lines changed

setup.go

Lines changed: 2 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,14 @@ import (
1818
"github.com/bjartek/underflow"
1919
"github.com/onflow/cadence/runtime"
2020
"github.com/onflow/flow-emulator/emulator"
21-
"github.com/onflow/flow-go/fvm/blueprints"
22-
fm "github.com/onflow/flow-go/model/flow"
2321
"github.com/onflow/flowkit/v2"
2422
"github.com/onflow/flowkit/v2/config"
2523
"github.com/onflow/flowkit/v2/gateway"
2624
"github.com/onflow/flowkit/v2/output"
2725
"github.com/pkg/errors"
2826
"github.com/rs/zerolog"
29-
"google.golang.org/grpc"
30-
3127
"github.com/spf13/afero"
28+
"google.golang.org/grpc"
3229
)
3330

3431
const emulatorValue = "emulator"
@@ -93,7 +90,6 @@ type OverflowBuilder struct {
9390
PrintOptions *[]OverflowPrinterOption
9491
GlobalEventFilter OverflowEventFilter
9592
Path string
96-
ArchiveNodeUrl string
9793
Network string
9894
ScriptFolderName string
9995
ServiceSuffix string
@@ -165,7 +161,7 @@ func (o *OverflowBuilder) StartResult() *OverflowState {
165161
var err error
166162
state, err = flowkit.Load(o.ConfigFiles, loader)
167163
if err != nil {
168-
overflow.Error = err
164+
overflow.Error = errors.Wrapf(err, "could not find flow configuration")
169165
return overflow
170166
}
171167
overflow.State = state
@@ -177,23 +173,6 @@ func (o *OverflowBuilder) StartResult() *OverflowState {
177173
return overflow.QualifiedIdentifierFromSnakeCase(name)
178174
}
179175
}
180-
181-
// This is different for testnet and mainnet
182-
// TODO: fix this for testnet
183-
184-
chain := fm.Mainnet.Chain()
185-
if o.Network == "testnet" {
186-
chain = fm.Testnet.Chain()
187-
}
188-
189-
systemChunkTx, err := blueprints.SystemChunkTransaction(chain)
190-
if err != nil {
191-
overflow.Error = err
192-
return overflow
193-
}
194-
systemChunkId := systemChunkTx.ID().String()
195-
overflow.SystemChunkTransactionId = systemChunkId
196-
197176
network, err := state.Networks().ByName(o.Network)
198177
if err != nil {
199178
overflow.Error = err
@@ -243,17 +222,6 @@ func (o *OverflowBuilder) StartResult() *OverflowState {
243222
return overflow
244223
}
245224
overflow.Flowkit = flowkit.NewFlowkit(state, *network, gw, logger)
246-
247-
/* TODO: fix archive
248-
if o.ArchiveNodeUrl != "" {
249-
gw, err := gateway.NewGrpcGateway(o.ArchiveNodeUrl)
250-
if err != nil {
251-
overflow.Error = err
252-
return overflow
253-
}
254-
overflow.ArchiveScripts = services.NewScripts(gw, state, logger)
255-
}
256-
*/
257225
}
258226

259227
if o.InitializeAccounts {
@@ -512,12 +480,6 @@ func WithInputResolver(ir underflow.InputResolver) OverflowOption {
512480
}
513481
}
514482

515-
func WithArchiveNodeUrl(url string) OverflowOption {
516-
return func(o *OverflowBuilder) {
517-
o.ArchiveNodeUrl = url
518-
}
519-
}
520-
521483
func WithGrpcDialOption(opt ...grpc.DialOption) OverflowOption {
522484
return func(o *OverflowBuilder) {
523485
o.GrpcDialOptions = append(o.GrpcDialOptions, opt...)

state.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,6 @@ type OverflowState struct {
141141
// the coverage report if any
142142
CoverageReport *runtime.CoverageReport
143143

144-
// the string id of the system chunk transaction
145-
SystemChunkTransactionId string
146-
147144
UnderflowOptions underflow.Options
148145
}
149146

0 commit comments

Comments
 (0)