-
Notifications
You must be signed in to change notification settings - Fork 141
/
Copy pathconfig.go
79 lines (76 loc) · 3.8 KB
/
config.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
/*
* Cadence - The resource-oriented smart contract programming language
*
* Copyright Flow Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package interpreter
import (
"github.com/onflow/cadence/common"
)
type Config struct {
MemoryGauge common.MemoryGauge
Storage Storage
// ImportLocationHandler is used to handle imports of locations
ImportLocationHandler ImportLocationHandlerFunc
// OnInvokedFunctionReturn is triggered when an invoked function returned
OnInvokedFunctionReturn OnInvokedFunctionReturnFunc
// OnRecordTrace is triggered when a trace is recorded
OnRecordTrace OnRecordTraceFunc
// OnResourceOwnerChange is triggered when the owner of a resource changes
OnResourceOwnerChange OnResourceOwnerChangeFunc
// OnMeterComputation is triggered when a computation is about to happen
OnMeterComputation OnMeterComputationFunc
// InjectedCompositeFieldsHandler is used to initialize new composite values' fields
InjectedCompositeFieldsHandler InjectedCompositeFieldsHandlerFunc
// ContractValueHandler is used to handle imports of values
ContractValueHandler ContractValueHandlerFunc
// OnEventEmitted is triggered when an event is emitted by the program
OnEventEmitted OnEventEmittedFunc
// OnFunctionInvocation is triggered when a function invocation is about to be executed
OnFunctionInvocation OnFunctionInvocationFunc
// AccountHandler is used to handle accounts
AccountHandler AccountHandlerFunc
// UUIDHandler is used to handle the generation of UUIDs
UUIDHandler UUIDHandlerFunc
// CompositeTypeHandler is used to load composite types
CompositeTypeHandler CompositeTypeHandlerFunc
// InterfaceTypeHandler is used to load interface types
InterfaceTypeHandler InterfaceTypeHandlerFunc
// CompositeValueFunctionsHandler is used to load composite value functions
CompositeValueFunctionsHandler CompositeValueFunctionsHandlerFunc
BaseActivationHandler func(location common.Location) *VariableActivation
Debugger *Debugger
// OnStatement is triggered when a statement is about to be executed
OnStatement OnStatementFunc
// OnLoopIteration is triggered when a loop iteration is about to be executed
OnLoopIteration OnLoopIterationFunc
// TracingEnabled determines if tracing is enabled.
// Tracing reports certain operations, e.g. composite value transfers
TracingEnabled bool
// AtreeStorageValidationEnabled determines if the validation of atree storage is enabled
AtreeStorageValidationEnabled bool
// AtreeValueValidationEnabled determines if the validation of atree values is enabled
AtreeValueValidationEnabled bool
// CapabilityCheckHandler is used to check ID capabilities
CapabilityCheckHandler CapabilityCheckHandlerFunc
// CapabilityBorrowHandler is used to borrow ID capabilities
CapabilityBorrowHandler CapabilityBorrowHandlerFunc
// LegacyContractUpgradeEnabled specifies whether to fall back to the old parser when attempting a contract upgrade
LegacyContractUpgradeEnabled bool
// ValidateAccountCapabilitiesGetHandler is used to handle when a capability of an account is got.
ValidateAccountCapabilitiesGetHandler ValidateAccountCapabilitiesGetHandlerFunc
// ValidateAccountCapabilitiesPublishHandler is used to handle when a capability of an account is got.
ValidateAccountCapabilitiesPublishHandler ValidateAccountCapabilitiesPublishHandlerFunc
}