Skip to content

Commit a492016

Browse files
committed
Clean up emulator dead code
1 parent 5c83d67 commit a492016

File tree

5 files changed

+0
-66
lines changed

5 files changed

+0
-66
lines changed

fvm/context.go

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -226,31 +226,6 @@ func WithExtensiveTracing() Option {
226226
}
227227
}
228228

229-
// TODO(patrick): rm after https://github.com/onflow/flow-emulator/pull/306
230-
// is merged and integrated.
231-
//
232-
// WithTransactionProcessors sets the transaction processors for a
233-
// virtual machine context.
234-
func WithTransactionProcessors(processors ...interface{}) Option {
235-
return func(ctx Context) Context {
236-
executeBody := false
237-
for _, p := range processors {
238-
switch p.(type) {
239-
case *TransactionInvoker:
240-
executeBody = true
241-
default:
242-
panic("Unexpected transaction processor")
243-
}
244-
}
245-
246-
ctx.AuthorizationChecksEnabled = false
247-
ctx.SequenceNumberCheckAndIncrementEnabled = false
248-
ctx.AccountKeyWeightThreshold = 0
249-
ctx.TransactionBodyExecutionEnabled = executeBody
250-
return ctx
251-
}
252-
}
253-
254229
// WithServiceAccount enables or disables calls to the Flow service account.
255230
func WithServiceAccount(enabled bool) Option {
256231
return func(ctx Context) Context {
@@ -269,13 +244,6 @@ func WithContractRemovalRestricted(enabled bool) Option {
269244
}
270245
}
271246

272-
// @Depricated please use WithContractDeploymentRestricted instead of this
273-
// this has been kept to reduce breaking change on the emulator, but would be
274-
// removed at some point.
275-
func WithRestrictedDeployment(restricted bool) Option {
276-
return WithContractDeploymentRestricted(restricted)
277-
}
278-
279247
// WithRestrictedContractDeployment enables or disables restricted contract deployment for a
280248
// virtual machine context. Warning! this would be overridden with the flag stored on chain.
281249
// this is just a fallback value

fvm/derived/table.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@ import (
1010
"github.com/onflow/flow-go/fvm/storage/logical"
1111
)
1212

13-
// TODO(patrick): rm once emulator is updated
14-
const EndOfBlockExecutionTime = logical.EndOfBlockExecutionTime
15-
1613
// ValueComputer is used by DerivedDataTable's GetOrCompute to compute the
1714
// derived value when the value is not in DerivedDataTable (i.e., "cache miss").
1815
type ValueComputer[TKey any, TVal any] interface {

fvm/environment/facade_env.go

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -141,24 +141,6 @@ func newFacadeEnvironment(
141141
return env
142142
}
143143

144-
// TODO(patrick): remove once emulator is updated.
145-
func NewScriptEnvironment(
146-
ctx context.Context,
147-
tracer tracing.TracerSpan,
148-
params EnvironmentParams,
149-
nestedTxn state.NestedTransaction,
150-
derivedTxn derived.DerivedTransactionCommitter,
151-
) *facadeEnvironment {
152-
return NewScriptEnv(
153-
ctx,
154-
tracer,
155-
params,
156-
storage.SerialTransaction{
157-
NestedTransaction: nestedTxn,
158-
DerivedTransactionCommitter: derivedTxn,
159-
})
160-
}
161-
162144
// This is mainly used by command line tools, the emulator, and cadence tools
163145
// testing.
164146
func NewScriptEnvironmentFromStorageSnapshot(

fvm/fvm.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,6 @@ type ProcedureOutput struct {
3838

3939
// Output only by script.
4040
Value cadence.Value
41-
42-
// TODO(patrick): rm after updating emulator to use ComputationUsed
43-
GasUsed uint64
4441
}
4542

4643
func (output *ProcedureOutput) PopulateEnvironmentValues(
@@ -53,8 +50,6 @@ func (output *ProcedureOutput) PopulateEnvironmentValues(
5350
return fmt.Errorf("error getting computation used: %w", err)
5451
}
5552
output.ComputationUsed = computationUsed
56-
// TODO(patrick): rm after updating emulator to use ComputationUsed
57-
output.GasUsed = computationUsed
5853

5954
memoryUsed, err := env.MemoryUsed()
6055
if err != nil {

fvm/transactionInvoker.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,6 @@ import (
1919
"github.com/onflow/flow-go/module/trace"
2020
)
2121

22-
// TODO(patrick): rm once emulator is updated.
23-
type TransactionInvoker struct {
24-
}
25-
26-
func NewTransactionInvoker() *TransactionInvoker {
27-
return &TransactionInvoker{}
28-
}
29-
3022
type TransactionExecutorParams struct {
3123
AuthorizationChecksEnabled bool
3224

0 commit comments

Comments
 (0)