Skip to content

Commit

Permalink
metatransaction context refactor (#730)
Browse files Browse the repository at this point in the history
  • Loading branch information
janezpodhostnik committed May 27, 2021
1 parent 5433e1d commit bfc9d2e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions fvm/fvm.go
Expand Up @@ -87,12 +87,14 @@ func (vm *VirtualMachine) GetAccount(ctx Context, address flow.Address, v state.
//
// Errors that occur in a meta transaction are propagated as a single error that can be
// captured by the Cadence runtime and eventually disambiguated by the parent context.
func (vm *VirtualMachine) invokeMetaTransaction(ctx Context, tx *TransactionProcedure, sth *state.StateHolder, programs *programs.Programs) (errors.Error, error) {
func (vm *VirtualMachine) invokeMetaTransaction(parentCtx Context, tx *TransactionProcedure, sth *state.StateHolder, programs *programs.Programs) (errors.Error, error) {
invocator := NewTransactionInvocator(zerolog.Nop())

// do not deduct fees or check storage in meta transactions
ctx.TransactionFeesEnabled = false
ctx.LimitAccountStorage = false
ctx := NewContextFromParent(parentCtx,
WithAccountStorageLimit(false),
WithTransactionFeesEnabled(false),
)

err := invocator.Process(vm, &ctx, tx, sth, programs)
txErr, fatalErr := errors.SplitErrorTypes(err)
Expand Down

0 comments on commit bfc9d2e

Please sign in to comment.