Documentation
¶
Index ¶
- Constants
- Variables
- func AccountCapabilitiesExists(invocationContext interpreter.InvocationContext, ...) interpreter.Value
- func AccountCapabilitiesForEachController(invocationContext interpreter.InvocationContext, address common.Address, ...) interpreter.Value
- func AccountCapabilitiesGet(invocationContext interpreter.InvocationContext, ...) interpreter.Value
- func AccountCapabilitiesPublish(invocationContext interpreter.InvocationContext, ...) interpreter.Value
- func AccountCapabilitiesUnpublish(invocationContext interpreter.InvocationContext, ...) interpreter.Value
- func AccountContractsBorrow(invocationContext interpreter.InvocationContext, address common.Address, ...) interpreter.Value
- func AccountContractsGet(context interpreter.InvocationContext, addressValue interpreter.AddressValue, ...) interpreter.Value
- func AccountInboxClaim(context interpreter.InvocationContext, providerValue interpreter.AddressValue, ...) interpreter.Value
- func AccountInboxPublish(context interpreter.InvocationContext, providerValue interpreter.AddressValue, ...) interpreter.Value
- func AccountInboxUnpublish(context interpreter.InvocationContext, providerValue interpreter.AddressValue, ...) interpreter.Value
- func AccountKeysAdd(context interpreter.AccountKeyCreationContext, ...) interpreter.Value
- func AccountKeysForEach(invocationContext interpreter.InvocationContext, address common.Address, ...) interpreter.Value
- func AccountKeysGet(context interpreter.AccountKeyCreationContext, address common.Address, ...) interpreter.Value
- func AccountKeysRevoke(context interpreter.InvocationContext, addressValue interpreter.AddressValue, ...) interpreter.Value
- func AccountStorageCapabilitiesForeachController(invocationContext interpreter.InvocationContext, ...) interpreter.Value
- func AccountStorageCapabilitiesGetController(invocationContext interpreter.InvocationContext, ...) interpreter.Value
- func AccountStorageCapabilitiesGetControllers(invocationContext interpreter.InvocationContext, ...) interpreter.Value
- func AccountStorageCapabilitiesIssue(arguments []interpreter.Value, invocationContext interpreter.InvocationContext, ...) interpreter.Value
- func AccountStorageCapabilitiesIssueWithType(invocationContext interpreter.InvocationContext, ...) interpreter.Value
- func Assert(result interpreter.BoolValue, message string) interpreter.Value
- func BLSAggregatePublicKeys(context interpreter.InvocationContext, publicKeysValue *interpreter.ArrayValue, ...) interpreter.Value
- func BLSAggregateSignatures(context interpreter.InvocationContext, signaturesValue *interpreter.ArrayValue, ...) interpreter.Value
- func BorrowCapabilityController(context interpreter.BorrowCapabilityControllerContext, ...) interpreter.ReferenceValue
- func CheckCapabilityController(context interpreter.CheckCapabilityControllerContext, ...) interpreter.BoolValue
- func CodeToHashValue(context interpreter.ArrayCreationContext, code []byte) *interpreter.ArrayValue
- func GetCheckedCapabilityControllerReference(context interpreter.GetCapabilityControllerReferenceContext, ...) interpreter.ReferenceValue
- func IssueAccountCapabilityController(context interpreter.CapabilityControllerContext, ...) interpreter.UInt64Value
- func IssueStorageCapabilityController(context interpreter.CapabilityControllerContext, ...) interpreter.UInt64Value
- func Log(context interpreter.ValueStringContext, logger Logger, value interpreter.Value) interpreter.Value
- func NativeAccountConstructor(creator AccountCreator) interpreter.NativeFunction
- func NativeBLSAggregatePublicKeysFunction(aggregator BLSPublicKeyAggregator) interpreter.NativeFunction
- func NativeBLSAggregateSignaturesFunction(aggregator BLSSignatureAggregator) interpreter.NativeFunction
- func NativeGetAccountFunction(handler AccountHandler) interpreter.NativeFunction
- func NativeGetAuthAccountFunction(handler AccountHandler) interpreter.NativeFunction
- func NativeGetBlockFunction(provider BlockAtHeightProvider) interpreter.NativeFunction
- func NativeGetCurrentBlockFunction(provider CurrentBlockProvider) interpreter.NativeFunction
- func NativeHashAlgorithmHashFunction(hasher Hasher, constantHashAlgoValue interpreter.MemberAccessibleValue) interpreter.NativeFunction
- func NativeHashAlgorithmHashWithTagFunction(hasher Hasher, constantHashAlgoValue interpreter.MemberAccessibleValue) interpreter.NativeFunction
- func NativeLogFunction(logger Logger) interpreter.NativeFunction
- func NativePublicKeyConstructorFunction(publicKeyValidator PublicKeyValidator) interpreter.NativeFunction
- func NativePublicKeyVerifyPoPFunction(constantPublicKeyValue *interpreter.CompositeValue, verifier BLSPoPVerifier) interpreter.NativeFunction
- func NativePublicKeyVerifySignatureFunction(constantPublicKeyValue *interpreter.CompositeValue, ...) interpreter.NativeFunction
- func NativeRevertibleRandomFunction(generator RandomGenerator) interpreter.NativeFunction
- func NewAccount(context interpreter.MemberAccessibleContext, ...) interpreter.Value
- func NewAccountKeyValue(context interpreter.AccountKeyCreationContext, accountKey *AccountKey, ...) interpreter.Value
- func NewAccountReferenceValue(context interpreter.AccountCreationContext, handler AccountHandler, ...) interpreter.Value
- func NewAccountValue(context interpreter.AccountCreationContext, handler AccountHandler, ...) interpreter.Value
- func NewBlockValue(context interpreter.ArrayCreationContext, block Block) interpreter.Value
- func NewHashAlgorithmCase(rawValue interpreter.UInt8Value, hasher Hasher) (interpreter.MemberAccessibleValue, error)
- func NewHashAlgorithmFromValue(context interpreter.MemberAccessibleContext, value interpreter.Value) sema.HashAlgorithm
- func NewInclusiveRange(invocationContext interpreter.InvocationContext, ...) interpreter.Value
- func NewPublicKeyFromFields(context interpreter.PublicKeyCreationContext, ...) *interpreter.CompositeValue
- func NewPublicKeyValue(context interpreter.PublicKeyCreationContext, publicKey *PublicKey) *interpreter.CompositeValue
- func NewSignatureAlgorithmCase(rawValue interpreter.UInt8Value) interpreter.MemberAccessibleValue
- func NewTestInterpreterContractValueHandler(testFramework TestFramework) interpreter.ContractValueHandlerFunc
- func PanicWithError(message interpreter.Value) interpreter.Value
- func PublicKeyFunctions(inter *interpreter.Interpreter, publicKeyValue *interpreter.CompositeValue, ...) *interpreter.FunctionOrderedMap
- func PublicKeyVerifyPoP(context interpreter.InvocationContext, ...) interpreter.Value
- func PublicKeyVerifySignature(context interpreter.InvocationContext, ...) interpreter.Value
- func RLPDecodeList(input *interpreter.ArrayValue, context interpreter.InvocationContext) interpreter.Value
- func RLPDecodeString(input *interpreter.ArrayValue, context interpreter.InvocationContext) interpreter.Value
- func RevertibleRandom(generator RandomGenerator, memoryGauge common.MemoryGauge, ...) interpreter.Value
- func SetCapabilityControllerTag(storageWriter interpreter.StorageWriter, address common.Address, ...)
- func TestCheckerContractValueHandler(checker *sema.Checker, declaration *ast.CompositeDeclaration, ...) sema.ValueDeclaration
- type Account
- type AccountContractAdditionAndNamesHandler
- type AccountContractAdditionHandler
- type AccountContractNamesProvider
- type AccountContractProvider
- type AccountContractRemovalHandler
- type AccountContractsHandler
- type AccountCreator
- type AccountHandler
- type AccountIDGenerator
- type AccountKey
- type AccountKeyAdditionHandler
- type AccountKeyProvider
- type AccountKeyRevocationHandler
- type AccountKeysHandler
- type AccountStorageHandler
- type AssertionError
- type AuthorizationMismatchError
- type AvailableBalanceProvider
- type BLSContractHandler
- type BLSPoPVerifier
- type BLSPublicKeyAggregator
- type BLSSignatureAggregator
- type BalanceProvider
- type Block
- type BlockAtHeightProvider
- type BlockHash
- type Blockchain
- type CadenceV042ToV1ContractUpdateValidator
- type CapabilityControllerHandler
- type CapabilityControllerIssueHandler
- type CapabilityControllersMutatedDuringIterationError
- type CompositeValueFunctionsHandler
- type CompositeValueFunctionsHandlers
- type ConformanceMismatchError
- type ContractAdditionTracker
- type ContractNotFoundError
- type ContractRemovalError
- type ContractUpdateError
- type ContractUpdateValidator
- type CurrentBlockProvider
- type DeployedContractConstructorInvocation
- type EnumCaseMismatchError
- type EventEmitter
- type ExtraneousFieldError
- type FieldMismatchError
- type FlowLocation
- func (l FlowLocation) Description() string
- func (l FlowLocation) ID() string
- func (l FlowLocation) MarshalJSON() ([]byte, error)
- func (l FlowLocation) QualifiedIdentifier(typeID common.TypeID) string
- func (l FlowLocation) String() string
- func (l FlowLocation) TypeID(memoryGauge common.MemoryGauge, qualifiedIdentifier string) common.TypeID
- type FunctionLogger
- type Hasher
- type InvalidContractArgumentError
- type InvalidContractDeploymentError
- func (e *InvalidContractDeploymentError) ChildErrors() []error
- func (e *InvalidContractDeploymentError) Error() string
- func (*InvalidContractDeploymentError) IsUserError()
- func (e *InvalidContractDeploymentError) SetLocationRange(locationRange interpreter.LocationRange)
- func (e *InvalidContractDeploymentError) Unwrap() error
- type InvalidContractDeploymentOriginError
- type InvalidDeclarationKindChangeError
- type InvalidTypeRemovalPragmaError
- type Logger
- type MissingDeclarationError
- type MissingEnumCasesError
- type NameMismatchError
- type OldProgramError
- type PanicError
- type PublicKey
- type PublicKeyFunctionsHandler
- type PublicKeySignatureVerifier
- type PublicKeyValidator
- type RLPDecodeListError
- type RLPDecodeStringError
- type RandomGenerator
- type ScriptResult
- type SimpleContractAdditionTracker
- type StandardLibraryHandler
- type StandardLibraryType
- type StandardLibraryValue
- func InterpreterDefaultScriptStandardLibraryValues(handler StandardLibraryHandler) []StandardLibraryValue
- func InterpreterDefaultStandardLibraryValues(handler StandardLibraryHandler) []StandardLibraryValue
- func NewBLSContract(gauge common.MemoryGauge, handler BLSContractHandler) StandardLibraryValue
- func NewInterpreterAccountConstructor(creator AccountCreator) StandardLibraryValue
- func NewInterpreterGetAccountFunction(handler AccountHandler) StandardLibraryValue
- func NewInterpreterGetAuthAccountFunction(handler AccountHandler) StandardLibraryValue
- func NewInterpreterGetBlockFunction(provider BlockAtHeightProvider) StandardLibraryValue
- func NewInterpreterGetCurrentBlockFunction(provider CurrentBlockProvider) StandardLibraryValue
- func NewInterpreterHashAlgorithmConstructor(hasher Hasher) StandardLibraryValue
- func NewInterpreterLogFunction(logger Logger) StandardLibraryValue
- func NewInterpreterPublicKeyConstructor(publicKeyValidator PublicKeyValidator) StandardLibraryValue
- func NewInterpreterRevertibleRandomFunction(generator RandomGenerator) StandardLibraryValue
- func NewInterpreterStandardLibraryStaticFunction(name string, functionType *sema.FunctionType, docString string, ...) StandardLibraryValue
- func NewNativeStandardLibraryStaticFunction(name string, functionType *sema.FunctionType, docString string, ...) StandardLibraryValue
- func NewVMAccountConstructor(creator AccountCreator) StandardLibraryValue
- func NewVMGetAccountFunction(handler AccountHandler) StandardLibraryValue
- func NewVMGetAuthAccountFunction(handler AccountHandler) StandardLibraryValue
- func NewVMGetBlockFunction(provider BlockAtHeightProvider) StandardLibraryValue
- func NewVMGetCurrentBlockFunction(provider CurrentBlockProvider) StandardLibraryValue
- func NewVMHashAlgorithmConstructor(hasher Hasher) StandardLibraryValue
- func NewVMLogFunction(logger Logger) StandardLibraryValue
- func NewVMPublicKeyConstructor(publicKeyValidator PublicKeyValidator) StandardLibraryValue
- func NewVMRevertibleRandomFunction(generator RandomGenerator) StandardLibraryValue
- func NewVMStandardLibraryStaticFunction(name string, functionType *sema.FunctionType, docString string, ...) StandardLibraryValue
- func VMDefaultScriptStandardLibraryValues(handler StandardLibraryHandler) []StandardLibraryValue
- func VMDefaultStandardLibraryValues(handler StandardLibraryHandler) []StandardLibraryValue
- func (v StandardLibraryValue) ValueDeclarationArgumentLabels() []string
- func (v StandardLibraryValue) ValueDeclarationDocString() string
- func (v StandardLibraryValue) ValueDeclarationIsConstant() bool
- func (v StandardLibraryValue) ValueDeclarationKind() common.DeclarationKind
- func (v StandardLibraryValue) ValueDeclarationName() string
- func (v StandardLibraryValue) ValueDeclarationPosition() *ast.Position
- func (v StandardLibraryValue) ValueDeclarationType() sema.Type
- func (v StandardLibraryValue) ValueDeclarationValue() interpreter.Value
- type StorageCapacityProvider
- type StorageCommitter
- type StorageUsedProvider
- type TestContractType
- type TestFailedError
- type TestFramework
- type TestFrameworkAddTransactionContext
- type TestFrameworkContractDeploymentContext
- type TestFrameworkEventsContext
- type TestFrameworkScriptExecutionContext
- type TransactionResult
- type TypeComparator
- func (c *TypeComparator) CheckConstantSizedTypeEquality(expected *ast.ConstantSizedType, found ast.Type) error
- func (c *TypeComparator) CheckDictionaryTypeEquality(expected *ast.DictionaryType, found ast.Type) error
- func (c *TypeComparator) CheckFunctionTypeEquality(expected *ast.FunctionType, found ast.Type) error
- func (c *TypeComparator) CheckInstantiationTypeEquality(expected *ast.InstantiationType, found ast.Type) error
- func (c *TypeComparator) CheckIntersectionTypeEquality(expected *ast.IntersectionType, found ast.Type) error
- func (c *TypeComparator) CheckNominalTypeEquality(expected *ast.NominalType, found ast.Type) error
- func (c *TypeComparator) CheckOptionalTypeEquality(expected *ast.OptionalType, found ast.Type) error
- func (c *TypeComparator) CheckReferenceTypeEquality(expected *ast.ReferenceType, found ast.Type) error
- func (c *TypeComparator) CheckVariableSizedTypeEquality(expected *ast.VariableSizedType, found ast.Type) error
- type TypeMismatchError
- type TypeRemovalPragmaRemovalError
- type UnrepresentableEntitlementsUpgrade
- type UpdateValidator
- type UseOfRemovedTypeError
- type VMFunction
- func NewVMAccountAccountCapabilitiesForEachControllerFunction(handler CapabilityControllerHandler) VMFunction
- func NewVMAccountAccountCapabilitiesGetControllerFunction(handler CapabilityControllerHandler) VMFunction
- func NewVMAccountAccountCapabilitiesGetControllersFunction(handler CapabilityControllerHandler) VMFunction
- func NewVMAccountAccountCapabilitiesIssueFunction(handler CapabilityControllerIssueHandler) VMFunction
- func NewVMAccountAccountCapabilitiesIssueWithTypeFunction(handler CapabilityControllerIssueHandler) VMFunction
- func NewVMAccountCapabilitiesGetFunction(controllerHandler CapabilityControllerHandler, borrow bool) VMFunction
- func NewVMAccountCapabilitiesPublishFunction(handler CapabilityControllerHandler) VMFunction
- func NewVMAccountCapabilitiesUnpublishFunction(handler CapabilityControllerHandler) VMFunction
- func NewVMAccountContractsBorrowFunction(handler AccountContractsHandler) VMFunction
- func NewVMAccountContractsGetFunction(provider AccountContractProvider) VMFunction
- func NewVMAccountInboxClaimFunction(handler EventEmitter) VMFunction
- func NewVMAccountInboxPublishFunction(handler EventEmitter) VMFunction
- func NewVMAccountInboxUnpublishFunction(handler EventEmitter) VMFunction
- func NewVMAccountKeysAddFunction(handler AccountKeyAdditionHandler) VMFunction
- func NewVMAccountKeysForEachFunction(provider AccountKeyProvider) VMFunction
- func NewVMAccountKeysGetFunction(provider AccountKeyProvider) VMFunction
- func NewVMAccountKeysRevokeFunction(handler AccountKeyRevocationHandler) VMFunction
- func NewVMAccountStorageCapabilitiesForEachControllerFunction(handler CapabilityControllerHandler) VMFunction
- func NewVMAccountStorageCapabilitiesGetControllerFunction(handler CapabilityControllerHandler) VMFunction
- func NewVMAccountStorageCapabilitiesGetControllersFunction(handler CapabilityControllerHandler) VMFunction
- func NewVMAccountStorageCapabilitiesIssueFunction(handler CapabilityControllerIssueHandler) VMFunction
- func NewVMAccountStorageCapabilitiesIssueWithTypeFunction(handler CapabilityControllerIssueHandler) VMFunction
- func NewVMBLSAggregatePublicKeysFunction(aggregator BLSPublicKeyAggregator) VMFunction
- func NewVMBLSAggregateSignaturesFunction(aggregator BLSSignatureAggregator) VMFunction
- func NewVMHashAlgorithmHashFunction(hasher Hasher) VMFunction
- func NewVMHashAlgorithmHashWithTagFunction(hasher Hasher) VMFunction
- func NewVMPublicKeyVerifyPoPFunction(verifier BLSPoPVerifier) VMFunction
- func NewVMPublicKeyVerifySignatureFunction(verifier PublicKeySignatureVerifier) VMFunction
- func VMFunctions(handler StandardLibraryHandler) []VMFunction
- type VMValue
Constants ¶
const AssertFunctionName = "assert"
const BLSTypeAggregatePublicKeysFunctionDocString = `` /* 295-byte string literal not displayed */
const BLSTypeAggregatePublicKeysFunctionName = "aggregatePublicKeys"
const BLSTypeAggregateSignaturesFunctionDocString = `` /* 493-byte string literal not displayed */
const BLSTypeAggregateSignaturesFunctionName = "aggregateSignatures"
const BLSTypeName = "BLS"
const BlockHashLength = 32
const CryptoContractLocation = common.IdentifierLocation("Crypto")
const FlowLocationPrefix = "flow"
const GetAccountFunctionName = "getAccount"
const GetAuthAccountFunctionName = "getAuthAccount"
const HashSize = 32
const LogFunctionName = "log"
const PanicFunctionName = "panic"
const RLPTypeDecodeListFunctionDocString = `` /* 415-byte string literal not displayed */
const RLPTypeDecodeListFunctionName = "decodeList"
const RLPTypeDecodeStringFunctionDocString = `` /* 313-byte string literal not displayed */
const RLPTypeDecodeStringFunctionName = "decodeString"
const RLPTypeName = "RLP"
const TestContractLocation = common.IdentifierLocation(testContractTypeName)
Variables ¶
var AccountCapabilityControllerDeletedEventType = newFlowEventType( "AccountCapabilityControllerDeleted", CapabilityControllerEventIDParameter, CapabilityControllerEventAddressParameter, )
var AccountCapabilityControllerIssuedEventType = newFlowEventType( "AccountCapabilityControllerIssued", CapabilityControllerEventIDParameter, CapabilityControllerEventAddressParameter, CapabilityControllerEventTypeParameter, )
var AccountContractAddedEventType = newFlowEventType( "AccountContractAdded", AccountEventAddressParameter, AccountEventCodeHashParameter, AccountEventContractParameter, )
var AccountContractRemovedEventType = newFlowEventType( "AccountContractRemoved", AccountEventAddressParameter, AccountEventCodeHashParameter, AccountEventContractParameter, )
var AccountContractUpdatedEventType = newFlowEventType( "AccountContractUpdated", AccountEventAddressParameter, AccountEventCodeHashParameter, AccountEventContractParameter, )
var AccountCreatedEventType = newFlowEventType( "AccountCreated", AccountEventAddressParameter, )
var AccountEventAddressParameter = sema.Parameter{ Identifier: "address", TypeAnnotation: sema.AddressTypeAnnotation, }
var AccountEventCodeHashParameter = sema.Parameter{ Identifier: "codeHash", TypeAnnotation: HashTypeAnnotation, }
var AccountEventContractParameter = sema.Parameter{ Identifier: "contract", TypeAnnotation: sema.StringTypeAnnotation, }
var AccountEventHashAlgorithmParameter = sema.Parameter{ Identifier: "hashAlgorithm", TypeAnnotation: sema.HashAlgorithmTypeAnnotation, }
var AccountEventKeyIndexParameter = sema.Parameter{ Identifier: "keyIndex", TypeAnnotation: sema.IntTypeAnnotation, }
var AccountEventKeyWeightParameter = sema.Parameter{ Identifier: "weight", TypeAnnotation: sema.UFix64TypeAnnotation, }
var AccountEventNameParameter = sema.Parameter{ Identifier: "name", TypeAnnotation: sema.StringTypeAnnotation, }
var AccountEventProviderParameter = sema.Parameter{ Identifier: "provider", TypeAnnotation: sema.AddressTypeAnnotation, }
var AccountEventPublicKeyIndexParameter = sema.Parameter{ Identifier: "publicKey", TypeAnnotation: sema.NewTypeAnnotation( sema.IntType, ), }
var AccountEventPublicKeyParameterAsCompositeType = sema.Parameter{ Identifier: "publicKey", TypeAnnotation: sema.NewTypeAnnotation( sema.PublicKeyType, ), }
var AccountEventRecipientParameter = sema.Parameter{ Identifier: "recipient", TypeAnnotation: sema.AddressTypeAnnotation, }
var AccountEventTypeParameter = sema.Parameter{ Identifier: "type", TypeAnnotation: sema.MetaTypeAnnotation, }
var AccountInboxClaimedEventType = newFlowEventType( "InboxValueClaimed", AccountEventProviderParameter, AccountEventRecipientParameter, AccountEventNameParameter, )
var AccountInboxPublishedEventType = newFlowEventType( "InboxValuePublished", AccountEventProviderParameter, AccountEventRecipientParameter, AccountEventNameParameter, AccountEventTypeParameter, )
var AccountInboxUnpublishedEventType = newFlowEventType( "InboxValueUnpublished", AccountEventProviderParameter, AccountEventNameParameter, )
var AccountKeyAddedFromPublicKeyEventType = newFlowEventType( "AccountKeyAdded", AccountEventAddressParameter, AccountEventPublicKeyParameterAsCompositeType, AccountEventKeyWeightParameter, AccountEventHashAlgorithmParameter, AccountEventKeyIndexParameter, )
var AccountKeyRemovedFromPublicKeyIndexEventType = newFlowEventType( "AccountKeyRemoved", AccountEventAddressParameter, AccountEventPublicKeyIndexParameter, )
var AssertFunctionType = &sema.FunctionType{ Purity: sema.FunctionPurityView, Parameters: []sema.Parameter{ { Label: sema.ArgumentLabelNotRequired, Identifier: "condition", TypeAnnotation: sema.BoolTypeAnnotation, }, { Identifier: "message", TypeAnnotation: sema.StringTypeAnnotation, }, }, ReturnTypeAnnotation: sema.VoidTypeAnnotation, Arity: &sema.Arity{Min: 1, Max: 2}, }
var BLSType = func() *sema.CompositeType { var t = &sema.CompositeType{ Identifier: BLSTypeName, Kind: common.CompositeKindContract, ImportableBuiltin: false, HasComputedMembers: true, } return t }()
var BLSTypeAggregatePublicKeysFunctionType = &sema.FunctionType{ Purity: sema.FunctionPurityView, Parameters: []sema.Parameter{ { Label: sema.ArgumentLabelNotRequired, Identifier: "keys", TypeAnnotation: sema.NewTypeAnnotation(&sema.VariableSizedType{ Type: sema.PublicKeyType, }), }, }, ReturnTypeAnnotation: sema.NewTypeAnnotation( &sema.OptionalType{ Type: sema.PublicKeyType, }, ), }
var BLSTypeAggregateSignaturesFunctionType = &sema.FunctionType{ Purity: sema.FunctionPurityView, Parameters: []sema.Parameter{ { Label: sema.ArgumentLabelNotRequired, Identifier: "signatures", TypeAnnotation: sema.NewTypeAnnotation(&sema.VariableSizedType{ Type: &sema.VariableSizedType{ Type: sema.UInt8Type, }, }), }, }, ReturnTypeAnnotation: sema.NewTypeAnnotation( &sema.OptionalType{ Type: &sema.VariableSizedType{ Type: sema.UInt8Type, }, }, ), }
var BLSTypeStaticType = interpreter.ConvertSemaToStaticType(nil, BLSType)
var BlockIDStaticType = &interpreter.ConstantSizedStaticType{ Type: interpreter.PrimitiveStaticTypeUInt8, Size: 32, }
var CapabilityControllerEventAddressParameter = sema.Parameter{ Identifier: "address", TypeAnnotation: sema.AddressTypeAnnotation, }
var CapabilityControllerEventIDParameter = sema.Parameter{ Identifier: "id", TypeAnnotation: sema.UInt64TypeAnnotation, }
var CapabilityControllerEventTypeParameter = sema.Parameter{ Identifier: "type", TypeAnnotation: sema.MetaTypeAnnotation, }
var CapabilityEventAddressParameter = sema.Parameter{ Identifier: "address", TypeAnnotation: sema.AddressTypeAnnotation, }
var CapabilityEventPathParameter = sema.Parameter{ Identifier: "path", TypeAnnotation: sema.PublicPathTypeAnnotation, }
var CapabilityPublishedEventType = newFlowEventType( "CapabilityPublished", CapabilityEventAddressParameter, CapabilityEventPathParameter, sema.Parameter{ Identifier: "capability", TypeAnnotation: sema.NewTypeAnnotation(&sema.CapabilityType{}), }, )
var CapabilityUnpublishedEventType = newFlowEventType( "CapabilityUnpublished", CapabilityEventAddressParameter, CapabilityEventPathParameter, )
var DefaultStandardLibraryTypes = []StandardLibraryType{ { Type: BLSType, Name: BLSTypeName, Kind: common.DeclarationKindContract, }, { Type: RLPType, Name: RLPTypeName, Kind: common.DeclarationKindContract, }, }
var FlowEventTypes = map[common.TypeID]*sema.CompositeType{}
var GetAccountFunctionType = sema.NewSimpleFunctionType( sema.FunctionPurityView, []sema.Parameter{ { Label: sema.ArgumentLabelNotRequired, Identifier: "address", TypeAnnotation: sema.AddressTypeAnnotation, }, }, sema.AccountReferenceTypeAnnotation, )
var GetAuthAccountFunctionType = func() *sema.FunctionType { typeParam := &sema.TypeParameter{ Name: "T", TypeBound: sema.AccountReferenceType, } return &sema.FunctionType{ Purity: sema.FunctionPurityView, TypeParameters: []*sema.TypeParameter{typeParam}, Parameters: []sema.Parameter{ { Label: sema.ArgumentLabelNotRequired, Identifier: "address", TypeAnnotation: sema.AddressTypeAnnotation, }, }, ReturnTypeAnnotation: sema.NewTypeAnnotation( &sema.GenericType{ TypeParameter: typeParam, }, ), } }()
GetAuthAccountFunctionType represents the type
fun getAuthAccount<T: &Account>(_ address: Address): T
var HashType = &sema.ConstantSizedType{ Size: HashSize, Type: sema.UInt8Type, }
var HashTypeAnnotation = sema.NewTypeAnnotation(HashType)
var InterpreterAssertFunction = NewNativeStandardLibraryStaticFunction( AssertFunctionName, AssertFunctionType, assertFunctionDocString, NativeAssertFunction, false, )
var InterpreterInclusiveRangeConstructor = NewNativeStandardLibraryStaticFunction( "InclusiveRange", inclusiveRangeConstructorFunctionType, inclusiveRangeConstructorFunctionDocString, NativeInclusiveRangeConstructorFunction, false, )
var InterpreterPanicFunction = NewNativeStandardLibraryStaticFunction( PanicFunctionName, PanicFunctionType, panicFunctionDocString, NativePanicFunction, false, )
var InterpreterSignatureAlgorithmConstructor = StandardLibraryValue{ Name: sema.SignatureAlgorithmTypeName, Type: signatureAlgorithmLookupType, Value: interpreterSignatureAlgorithmConstructorValue, Kind: common.DeclarationKindEnum, }
these functions are left as is, since there are differences in the implementations between interpreter and vm
var LogFunctionType = sema.NewSimpleFunctionType( sema.FunctionPurityImpure, []sema.Parameter{ { Label: sema.ArgumentLabelNotRequired, Identifier: "value", TypeAnnotation: sema.AnyStructTypeAnnotation, }, }, sema.VoidTypeAnnotation, )
var NativeAssertFunction = interpreter.NativeFunction( func( _ interpreter.NativeFunctionContext, _ interpreter.TypeArgumentsIterator, _ interpreter.Value, args []interpreter.Value, ) interpreter.Value { result := interpreter.AssertValueOfType[interpreter.BoolValue](args[0]) var message string if len(args) > 1 { messageValue := interpreter.AssertValueOfType[*interpreter.StringValue](args[1]) message = messageValue.Str } return Assert(result, message) }, )
var NativeInclusiveRangeConstructorFunction = interpreter.NativeFunction( func( context interpreter.NativeFunctionContext, _ interpreter.TypeArgumentsIterator, _ interpreter.Value, args []interpreter.Value, ) interpreter.Value { start := interpreter.AssertValueOfType[interpreter.IntegerValue](args[0]) end := interpreter.AssertValueOfType[interpreter.IntegerValue](args[1]) var step interpreter.IntegerValue if len(args) > 2 { step = interpreter.AssertValueOfType[interpreter.IntegerValue](args[2]) } return NewInclusiveRange(context, start, end, step) }, )
var NativePanicFunction = interpreter.NativeFunction( func( _ interpreter.NativeFunctionContext, _ interpreter.TypeArgumentsIterator, _ interpreter.Value, args []interpreter.Value, ) interpreter.Value { message := args[0] return PanicWithError(message) }, )
var NativeRLPDecodeListFunction = interpreter.NativeFunction( func( context interpreter.NativeFunctionContext, _ interpreter.TypeArgumentsIterator, _ interpreter.Value, args []interpreter.Value, ) interpreter.Value { input := interpreter.AssertValueOfType[*interpreter.ArrayValue](args[0]) return RLPDecodeList(input, context) }, )
var NativeRLPDecodeStringFunction = interpreter.NativeFunction( func( context interpreter.NativeFunctionContext, _ interpreter.TypeArgumentsIterator, _ interpreter.Value, args []interpreter.Value, ) interpreter.Value { input := interpreter.AssertValueOfType[*interpreter.ArrayValue](args[0]) return RLPDecodeString(input, context) }, )
Native RLP functions
var PanicFunctionType = sema.NewSimpleFunctionType( sema.FunctionPurityView, []sema.Parameter{ { Label: sema.ArgumentLabelNotRequired, Identifier: "message", TypeAnnotation: sema.StringTypeAnnotation, }, }, sema.NeverTypeAnnotation, )
var RLPContract = StandardLibraryValue{ Name: RLPTypeName, Type: RLPType, Value: rlpContractValue, Kind: common.DeclarationKindContract, }
var RLPType = func() *sema.CompositeType { var t = &sema.CompositeType{ Identifier: RLPTypeName, Kind: common.CompositeKindContract, ImportableBuiltin: false, HasComputedMembers: true, } return t }()
var RLPTypeDecodeListFunctionType = &sema.FunctionType{ Purity: sema.FunctionPurityView, Parameters: []sema.Parameter{ { Label: sema.ArgumentLabelNotRequired, Identifier: "input", TypeAnnotation: sema.NewTypeAnnotation(&sema.VariableSizedType{ Type: sema.UInt8Type, }), }, }, ReturnTypeAnnotation: sema.NewTypeAnnotation( &sema.VariableSizedType{ Type: &sema.VariableSizedType{ Type: sema.UInt8Type, }, }, ), }
var RLPTypeDecodeStringFunctionType = &sema.FunctionType{ Purity: sema.FunctionPurityView, Parameters: []sema.Parameter{ { Label: sema.ArgumentLabelNotRequired, Identifier: "input", TypeAnnotation: sema.NewTypeAnnotation(&sema.VariableSizedType{ Type: sema.UInt8Type, }), }, }, ReturnTypeAnnotation: sema.NewTypeAnnotation( &sema.VariableSizedType{ Type: sema.UInt8Type, }, ), }
var RLPTypeStaticType = interpreter.ConvertSemaToStaticType(nil, RLPType)
var StorageCapabilityControllerDeletedEventType = newFlowEventType( "StorageCapabilityControllerDeleted", CapabilityControllerEventIDParameter, CapabilityControllerEventAddressParameter, )
var StorageCapabilityControllerIssuedEventType = newFlowEventType( "StorageCapabilityControllerIssued", CapabilityControllerEventIDParameter, CapabilityControllerEventAddressParameter, CapabilityControllerEventTypeParameter, sema.Parameter{ Identifier: "path", TypeAnnotation: sema.StoragePathTypeAnnotation, }, )
var StorageCapabilityControllerTargetChangedEventType = newFlowEventType( "StorageCapabilityControllerTargetChanged", CapabilityControllerEventIDParameter, CapabilityControllerEventAddressParameter, sema.Parameter{ Identifier: "path", TypeAnnotation: sema.StoragePathTypeAnnotation, }, )
var VMAccountCapabilitiesExistsFunction = VMFunction{ BaseType: sema.Account_CapabilitiesType, FunctionValue: vm.NewNativeFunctionValue( sema.Account_CapabilitiesTypeExistsFunctionName, sema.Account_CapabilitiesTypeExistsFunctionType, nativeAccountCapabilitiesExistsFunction(nil), ), }
var VMAssertFunction = NewNativeStandardLibraryStaticFunction( AssertFunctionName, AssertFunctionType, assertFunctionDocString, NativeAssertFunction, true, )
var VMInclusiveRangeConstructor = NewNativeStandardLibraryStaticFunction( "InclusiveRange", inclusiveRangeConstructorFunctionType, inclusiveRangeConstructorFunctionDocString, NativeInclusiveRangeConstructorFunction, true, )
var VMPanicFunction = NewNativeStandardLibraryStaticFunction( PanicFunctionName, PanicFunctionType, panicFunctionDocString, NativePanicFunction, true, )
var VMRLPDecodeListFunction = VMFunction{ BaseType: RLPType, FunctionValue: vm.NewNativeFunctionValue( RLPTypeDecodeListFunctionName, RLPTypeDecodeListFunctionType, NativeRLPDecodeListFunction, ), }
var VMRLPDecodeStringFunction = VMFunction{ BaseType: RLPType, FunctionValue: vm.NewNativeFunctionValue( RLPTypeDecodeStringFunctionName, RLPTypeDecodeStringFunctionType, NativeRLPDecodeStringFunction, ), }
var VMSignatureAlgorithmCaseValues = func() []VMValue { values := make([]VMValue, len(sema.SignatureAlgorithms)) for i, signatureAlgorithm := range sema.SignatureAlgorithms { rawValue := interpreter.UInt8Value(signatureAlgorithm.RawValue()) values[i] = VMValue{ Name: commons.TypeQualifiedName( sema.SignatureAlgorithmType, signatureAlgorithm.Name(), ), Value: SignatureAlgorithmCaseValues[rawValue], } } return values }()
var VMSignatureAlgorithmConstructor = StandardLibraryValue{ Name: sema.SignatureAlgorithmTypeName, Type: signatureAlgorithmLookupType, Value: vmSignatureAlgorithmConstructorValue, Kind: common.DeclarationKindEnum, }
var ZeroModuloError = errors.NewDefaultUserError("modulo argument cannot be zero")
var _, SignatureAlgorithmCaseValues = interpreterCryptoAlgorithmEnumValueAndCaseValues(
signatureAlgorithmLookupType,
sema.SignatureAlgorithms,
NewSignatureAlgorithmCase,
)
Functions ¶
func AccountCapabilitiesExists ¶ added in v1.4.0
func AccountCapabilitiesExists( invocationContext interpreter.InvocationContext, pathValue interpreter.PathValue, address common.Address, ) interpreter.Value
func AccountCapabilitiesForEachController ¶ added in v1.7.0
func AccountCapabilitiesForEachController( invocationContext interpreter.InvocationContext, address common.Address, functionValue interpreter.FunctionValue, handler CapabilityControllerHandler, ) interpreter.Value
func AccountCapabilitiesGet ¶ added in v1.4.0
func AccountCapabilitiesGet( invocationContext interpreter.InvocationContext, controllerHandler CapabilityControllerHandler, pathValue interpreter.PathValue, typeParameter sema.Type, borrow bool, addressValue interpreter.AddressValue, ) interpreter.Value
func AccountCapabilitiesPublish ¶ added in v1.4.0
func AccountCapabilitiesPublish( invocationContext interpreter.InvocationContext, handler CapabilityControllerHandler, capabilityValue interpreter.CapabilityValue, pathValue interpreter.PathValue, accountAddressValue interpreter.AddressValue, ) interpreter.Value
func AccountCapabilitiesUnpublish ¶ added in v1.4.0
func AccountCapabilitiesUnpublish( invocationContext interpreter.InvocationContext, handler CapabilityControllerHandler, pathValue interpreter.PathValue, addressValue interpreter.AddressValue, ) interpreter.Value
func AccountContractsBorrow ¶ added in v1.7.0
func AccountContractsBorrow( invocationContext interpreter.InvocationContext, address common.Address, nameValue *interpreter.StringValue, borrowType sema.Type, handler AccountContractsHandler, ) interpreter.Value
func AccountContractsGet ¶ added in v1.7.0
func AccountContractsGet( context interpreter.InvocationContext, addressValue interpreter.AddressValue, nameValue *interpreter.StringValue, provider AccountContractProvider, ) interpreter.Value
func AccountInboxClaim ¶ added in v1.7.0
func AccountInboxClaim( context interpreter.InvocationContext, providerValue interpreter.AddressValue, recipientValue interpreter.AddressValue, nameValue *interpreter.StringValue, borrowType sema.Type, handler EventEmitter, ) interpreter.Value
func AccountInboxPublish ¶ added in v1.7.0
func AccountInboxPublish( context interpreter.InvocationContext, providerValue interpreter.AddressValue, recipientValue interpreter.AddressValue, nameValue *interpreter.StringValue, value interpreter.CapabilityValue, handler EventEmitter, ) interpreter.Value
func AccountInboxUnpublish ¶ added in v1.7.0
func AccountInboxUnpublish( context interpreter.InvocationContext, providerValue interpreter.AddressValue, borrowType sema.Type, nameValue *interpreter.StringValue, handler EventEmitter, ) interpreter.Value
func AccountKeysAdd ¶ added in v1.7.0
func AccountKeysAdd( context interpreter.AccountKeyCreationContext, addressValue interpreter.AddressValue, publicKeyValue interpreter.MemberAccessibleValue, hashAlgoValue interpreter.Value, weightValue interpreter.UFix64Value, handler AccountKeyAdditionHandler, ) interpreter.Value
func AccountKeysForEach ¶ added in v1.7.0
func AccountKeysForEach( invocationContext interpreter.InvocationContext, address common.Address, fnValue interpreter.FunctionValue, provider AccountKeyProvider, ) interpreter.Value
func AccountKeysGet ¶ added in v1.7.0
func AccountKeysGet( context interpreter.AccountKeyCreationContext, address common.Address, indexValue interpreter.IntValue, provider AccountKeyProvider, ) interpreter.Value
func AccountKeysRevoke ¶ added in v1.7.0
func AccountKeysRevoke( context interpreter.InvocationContext, addressValue interpreter.AddressValue, indexValue interpreter.IntValue, handler AccountKeyRevocationHandler, ) interpreter.Value
func AccountStorageCapabilitiesForeachController ¶ added in v1.4.0
func AccountStorageCapabilitiesForeachController( invocationContext interpreter.InvocationContext, handler CapabilityControllerHandler, functionValue interpreter.FunctionValue, address common.Address, targetPathValue interpreter.PathValue, ) interpreter.Value
func AccountStorageCapabilitiesGetController ¶ added in v1.4.0
func AccountStorageCapabilitiesGetController( invocationContext interpreter.InvocationContext, handler CapabilityControllerHandler, capabilityIDValue interpreter.UInt64Value, address common.Address, ) interpreter.Value
func AccountStorageCapabilitiesGetControllers ¶ added in v1.4.0
func AccountStorageCapabilitiesGetControllers( invocationContext interpreter.InvocationContext, handler CapabilityControllerHandler, targetPathValue interpreter.PathValue, address common.Address, ) interpreter.Value
func AccountStorageCapabilitiesIssue ¶ added in v1.4.0
func AccountStorageCapabilitiesIssue( arguments []interpreter.Value, invocationContext interpreter.InvocationContext, handler CapabilityControllerIssueHandler, address common.Address, typeParameter sema.Type, ) interpreter.Value
func AccountStorageCapabilitiesIssueWithType ¶ added in v1.4.0
func AccountStorageCapabilitiesIssueWithType( invocationContext interpreter.InvocationContext, handler CapabilityControllerIssueHandler, typeValue interpreter.TypeValue, address common.Address, targetPathValue interpreter.PathValue, ) interpreter.Value
func Assert ¶ added in v1.5.0
func Assert(result interpreter.BoolValue, message string) interpreter.Value
func BLSAggregatePublicKeys ¶ added in v1.7.0
func BLSAggregatePublicKeys( context interpreter.InvocationContext, publicKeysValue *interpreter.ArrayValue, aggregator BLSPublicKeyAggregator, ) interpreter.Value
func BLSAggregateSignatures ¶ added in v1.7.0
func BLSAggregateSignatures( context interpreter.InvocationContext, signaturesValue *interpreter.ArrayValue, aggregator BLSSignatureAggregator, ) interpreter.Value
func BorrowCapabilityController ¶
func BorrowCapabilityController( context interpreter.BorrowCapabilityControllerContext, capabilityAddress interpreter.AddressValue, capabilityID interpreter.UInt64Value, wantedBorrowType *sema.ReferenceType, capabilityBorrowType *sema.ReferenceType, handler CapabilityControllerHandler, ) interpreter.ReferenceValue
func CheckCapabilityController ¶
func CheckCapabilityController( context interpreter.CheckCapabilityControllerContext, capabilityAddress interpreter.AddressValue, capabilityID interpreter.UInt64Value, wantedBorrowType *sema.ReferenceType, capabilityBorrowType *sema.ReferenceType, handler CapabilityControllerHandler, ) interpreter.BoolValue
func CodeToHashValue ¶
func CodeToHashValue(context interpreter.ArrayCreationContext, code []byte) *interpreter.ArrayValue
func GetCheckedCapabilityControllerReference ¶
func GetCheckedCapabilityControllerReference( context interpreter.GetCapabilityControllerReferenceContext, capabilityAddressValue interpreter.AddressValue, capabilityIDValue interpreter.UInt64Value, wantedBorrowType *sema.ReferenceType, capabilityBorrowType *sema.ReferenceType, handler CapabilityControllerHandler, ) interpreter.ReferenceValue
func IssueAccountCapabilityController ¶
func IssueAccountCapabilityController( context interpreter.CapabilityControllerContext, handler CapabilityControllerIssueHandler, address common.Address, borrowStaticType *interpreter.ReferenceStaticType, ) interpreter.UInt64Value
func IssueStorageCapabilityController ¶
func IssueStorageCapabilityController( context interpreter.CapabilityControllerContext, handler CapabilityControllerIssueHandler, address common.Address, borrowStaticType *interpreter.ReferenceStaticType, targetPathValue interpreter.PathValue, ) interpreter.UInt64Value
func Log ¶ added in v1.4.0
func Log( context interpreter.ValueStringContext, logger Logger, value interpreter.Value, ) interpreter.Value
func NativeAccountConstructor ¶ added in v1.8.0
func NativeAccountConstructor(creator AccountCreator) interpreter.NativeFunction
func NativeBLSAggregatePublicKeysFunction ¶ added in v1.8.0
func NativeBLSAggregatePublicKeysFunction( aggregator BLSPublicKeyAggregator, ) interpreter.NativeFunction
func NativeBLSAggregateSignaturesFunction ¶ added in v1.8.0
func NativeBLSAggregateSignaturesFunction( aggregator BLSSignatureAggregator, ) interpreter.NativeFunction
func NativeGetAccountFunction ¶ added in v1.8.0
func NativeGetAccountFunction(handler AccountHandler) interpreter.NativeFunction
func NativeGetAuthAccountFunction ¶ added in v1.8.0
func NativeGetAuthAccountFunction(handler AccountHandler) interpreter.NativeFunction
func NativeGetBlockFunction ¶ added in v1.8.0
func NativeGetBlockFunction(provider BlockAtHeightProvider) interpreter.NativeFunction
func NativeGetCurrentBlockFunction ¶ added in v1.8.0
func NativeGetCurrentBlockFunction(provider CurrentBlockProvider) interpreter.NativeFunction
func NativeHashAlgorithmHashFunction ¶ added in v1.8.0
func NativeHashAlgorithmHashFunction( hasher Hasher, constantHashAlgoValue interpreter.MemberAccessibleValue, ) interpreter.NativeFunction
func NativeHashAlgorithmHashWithTagFunction ¶ added in v1.8.0
func NativeHashAlgorithmHashWithTagFunction( hasher Hasher, constantHashAlgoValue interpreter.MemberAccessibleValue, ) interpreter.NativeFunction
func NativeLogFunction ¶ added in v1.8.0
func NativeLogFunction(logger Logger) interpreter.NativeFunction
func NativePublicKeyConstructorFunction ¶ added in v1.8.0
func NativePublicKeyConstructorFunction( publicKeyValidator PublicKeyValidator, ) interpreter.NativeFunction
func NativePublicKeyVerifyPoPFunction ¶ added in v1.8.0
func NativePublicKeyVerifyPoPFunction( constantPublicKeyValue *interpreter.CompositeValue, verifier BLSPoPVerifier, ) interpreter.NativeFunction
func NativePublicKeyVerifySignatureFunction ¶ added in v1.8.0
func NativePublicKeyVerifySignatureFunction( constantPublicKeyValue *interpreter.CompositeValue, verifier PublicKeySignatureVerifier, ) interpreter.NativeFunction
func NativeRevertibleRandomFunction ¶ added in v1.8.0
func NativeRevertibleRandomFunction(generator RandomGenerator) interpreter.NativeFunction
func NewAccount ¶ added in v1.7.0
func NewAccount( context interpreter.MemberAccessibleContext, payer interpreter.MemberAccessibleValue, creator AccountCreator, ) interpreter.Value
func NewAccountKeyValue ¶
func NewAccountKeyValue( context interpreter.AccountKeyCreationContext, accountKey *AccountKey, hasher Hasher, ) interpreter.Value
func NewAccountReferenceValue ¶
func NewAccountReferenceValue( context interpreter.AccountCreationContext, handler AccountHandler, addressValue interpreter.AddressValue, authorization interpreter.Authorization, ) interpreter.Value
func NewAccountValue ¶
func NewAccountValue( context interpreter.AccountCreationContext, handler AccountHandler, addressValue interpreter.AddressValue, ) interpreter.Value
func NewBlockValue ¶
func NewBlockValue( context interpreter.ArrayCreationContext, block Block, ) interpreter.Value
func NewHashAlgorithmCase ¶
func NewHashAlgorithmCase( rawValue interpreter.UInt8Value, hasher Hasher, ) ( interpreter.MemberAccessibleValue, error, )
func NewHashAlgorithmFromValue ¶
func NewHashAlgorithmFromValue( context interpreter.MemberAccessibleContext, value interpreter.Value, ) sema.HashAlgorithm
func NewInclusiveRange ¶ added in v1.7.0
func NewInclusiveRange( invocationContext interpreter.InvocationContext, start interpreter.IntegerValue, end interpreter.IntegerValue, step interpreter.IntegerValue, ) interpreter.Value
func NewPublicKeyFromFields ¶
func NewPublicKeyFromFields( context interpreter.PublicKeyCreationContext, publicKey *interpreter.ArrayValue, signAlgo *interpreter.SimpleCompositeValue, publicKeyValidator PublicKeyValidator, ) *interpreter.CompositeValue
func NewPublicKeyValue ¶
func NewPublicKeyValue( context interpreter.PublicKeyCreationContext, publicKey *PublicKey, ) *interpreter.CompositeValue
func NewSignatureAlgorithmCase ¶
func NewSignatureAlgorithmCase(rawValue interpreter.UInt8Value) interpreter.MemberAccessibleValue
func NewTestInterpreterContractValueHandler ¶
func NewTestInterpreterContractValueHandler( testFramework TestFramework, ) interpreter.ContractValueHandlerFunc
func PanicWithError ¶ added in v1.4.0
func PanicWithError(message interpreter.Value) interpreter.Value
func PublicKeyFunctions ¶
func PublicKeyFunctions( inter *interpreter.Interpreter, publicKeyValue *interpreter.CompositeValue, handler PublicKeyFunctionsHandler, ) *interpreter.FunctionOrderedMap
func PublicKeyVerifyPoP ¶ added in v1.7.0
func PublicKeyVerifyPoP( context interpreter.InvocationContext, publicKeyValue *interpreter.CompositeValue, signatureValue *interpreter.ArrayValue, verifier BLSPoPVerifier, ) interpreter.Value
func PublicKeyVerifySignature ¶ added in v1.7.0
func PublicKeyVerifySignature( context interpreter.InvocationContext, publicKeyValue *interpreter.CompositeValue, signatureValue *interpreter.ArrayValue, signedDataValue *interpreter.ArrayValue, domainSeparationTagValue *interpreter.StringValue, hashAlgorithmValue *interpreter.SimpleCompositeValue, verifier PublicKeySignatureVerifier, ) interpreter.Value
func RLPDecodeList ¶ added in v1.7.0
func RLPDecodeList( input *interpreter.ArrayValue, context interpreter.InvocationContext, ) interpreter.Value
func RLPDecodeString ¶ added in v1.7.0
func RLPDecodeString( input *interpreter.ArrayValue, context interpreter.InvocationContext, ) interpreter.Value
func RevertibleRandom ¶
func RevertibleRandom( generator RandomGenerator, memoryGauge common.MemoryGauge, returnIntegerType sema.Type, moduloValue interpreter.Value, ) interpreter.Value
func SetCapabilityControllerTag ¶ added in v1.4.0
func SetCapabilityControllerTag( storageWriter interpreter.StorageWriter, address common.Address, capabilityID uint64, tagValue *interpreter.StringValue, )
func TestCheckerContractValueHandler ¶
func TestCheckerContractValueHandler( checker *sema.Checker, declaration *ast.CompositeDeclaration, compositeType *sema.CompositeType, ) sema.ValueDeclaration
Types ¶
type AccountContractAdditionAndNamesHandler ¶
type AccountContractAdditionAndNamesHandler interface {
AccountContractAdditionHandler
AccountContractNamesProvider
}
type AccountContractAdditionHandler ¶
type AccountContractAdditionHandler interface {
EventEmitter
AccountContractProvider
ContractAdditionTracker
ParseAndCheckProgram(
code []byte,
location common.Location,
getAndSetProgram bool,
) (*interpreter.Program, error)
// UpdateAccountContractCode updates the code associated with an account contract.
UpdateAccountContractCode(location common.AddressLocation, code []byte) error
RecordContractUpdate(
location common.AddressLocation,
value *interpreter.CompositeValue,
)
ContractUpdateRecorded(location common.AddressLocation) bool
LoadContractValue(
location common.AddressLocation,
program *interpreter.Program,
name string,
invocation DeployedContractConstructorInvocation,
) (
*interpreter.CompositeValue,
error,
)
TemporarilyRecordCode(location common.AddressLocation, code []byte)
}
type AccountContractProvider ¶
type AccountContractProvider interface {
// GetAccountContractCode returns the code associated with an account contract.
GetAccountContractCode(location common.AddressLocation) ([]byte, error)
}
type AccountContractRemovalHandler ¶
type AccountContractRemovalHandler interface {
EventEmitter
AccountContractProvider
RemoveAccountContractCode(location common.AddressLocation) error
RecordContractRemoval(location common.AddressLocation)
}
type AccountContractsHandler ¶
type AccountContractsHandler interface {
AccountContractProvider
AccountContractAdditionAndNamesHandler
AccountContractRemovalHandler
}
type AccountCreator ¶
type AccountCreator interface {
StorageCommitter
EventEmitter
AccountHandler
// CreateAccount creates a new account.
CreateAccount(payer common.Address) (address common.Address, err error)
}
type AccountHandler ¶
type AccountHandler interface {
AccountIDGenerator
BalanceProvider
AvailableBalanceProvider
AccountStorageHandler
AccountKeysHandler
AccountContractsHandler
}
type AccountIDGenerator ¶
type AccountKey ¶
type AccountKeyAdditionHandler ¶
type AccountKeyAdditionHandler interface {
EventEmitter
PublicKeyValidator
PublicKeySignatureVerifier
BLSPoPVerifier
Hasher
// AddAccountKey appends a key to an account.
AddAccountKey(address common.Address, key *PublicKey, algo sema.HashAlgorithm, weight int) (*AccountKey, error)
}
type AccountKeyProvider ¶
type AccountKeyProvider interface {
PublicKeyValidator
PublicKeySignatureVerifier
BLSPoPVerifier
Hasher
// GetAccountKey retrieves a key from an account by index.
GetAccountKey(address common.Address, index uint32) (*AccountKey, error)
AccountKeysCount(address common.Address) (uint32, error)
}
type AccountKeyRevocationHandler ¶
type AccountKeyRevocationHandler interface {
EventEmitter
Hasher
PublicKeyValidator
PublicKeySignatureVerifier
BLSPoPVerifier
// RevokeAccountKey removes a key from an account by index.
RevokeAccountKey(address common.Address, index uint32) (*AccountKey, error)
}
type AccountKeysHandler ¶
type AccountKeysHandler interface {
AccountKeyProvider
AccountKeyAdditionHandler
AccountKeyRevocationHandler
}
type AccountStorageHandler ¶
type AccountStorageHandler interface {
StorageUsedProvider
StorageCapacityProvider
}
type AssertionError ¶
type AssertionError struct {
interpreter.LocationRange
Message string
}
func (*AssertionError) Error ¶
func (e *AssertionError) Error() string
func (*AssertionError) IsUserError ¶
func (*AssertionError) IsUserError()
func (*AssertionError) SetLocationRange ¶ added in v1.8.0
func (e *AssertionError) SetLocationRange(locationRange interpreter.LocationRange)
type AuthorizationMismatchError ¶
type AuthorizationMismatchError struct {
ExpectedAuthorization sema.Access
FoundAuthorization sema.Access
ast.Range
}
AuthorizationMismatchError is reported during a contract upgrade, when a field value is given authorization that is more powerful than that which the migration would grant it
func (*AuthorizationMismatchError) Error ¶
func (e *AuthorizationMismatchError) Error() string
func (*AuthorizationMismatchError) IsUserError ¶
func (*AuthorizationMismatchError) IsUserError()
type BLSContractHandler ¶
type BLSContractHandler interface {
PublicKeyValidator
PublicKeySignatureVerifier
BLSPoPVerifier
BLSPublicKeyAggregator
BLSSignatureAggregator
}
type BLSPoPVerifier ¶
type BLSPublicKeyAggregator ¶
type BLSPublicKeyAggregator interface {
PublicKeySignatureVerifier
BLSPoPVerifier
// BLSAggregatePublicKeys aggregate multiple BLS public keys into one.
BLSAggregatePublicKeys(publicKeys []*PublicKey) (*PublicKey, error)
}
type BLSSignatureAggregator ¶
type BalanceProvider ¶
type BlockAtHeightProvider ¶
type BlockHash ¶
type BlockHash [BlockHashLength]byte
type Blockchain ¶
type Blockchain interface {
RunScript(
context TestFrameworkScriptExecutionContext,
code string, arguments []interpreter.Value,
) *ScriptResult
CreateAccount() (*Account, error)
GetAccount(interpreter.AddressValue) (*Account, error)
AddTransaction(
context TestFrameworkAddTransactionContext,
code string,
authorizers []common.Address,
signers []*Account,
arguments []interpreter.Value,
) error
ExecuteNextTransaction() *TransactionResult
CommitBlock() error
DeployContract(
context TestFrameworkContractDeploymentContext,
name string,
path string,
arguments []interpreter.Value,
) error
Logs() []string
ServiceAccount() (*Account, error)
Events(
context TestFrameworkEventsContext,
eventType interpreter.StaticType,
) interpreter.Value
Reset(uint64)
MoveTime(int64)
CreateSnapshot(string) error
LoadSnapshot(string) error
}
type CadenceV042ToV1ContractUpdateValidator ¶
type CadenceV042ToV1ContractUpdateValidator struct {
*TypeComparator
// contains filtered or unexported fields
}
func NewCadenceV042ToV1ContractUpdateValidator ¶
func NewCadenceV042ToV1ContractUpdateValidator( location common.Location, contractName string, provider AccountContractNamesProvider, oldProgram *ast.Program, newProgram *interpreter.Program, newElaborations map[common.Location]*sema.Elaboration, ) *CadenceV042ToV1ContractUpdateValidator
NewCadenceV042ToV1ContractUpdateValidator initializes and returns a validator, without performing any validation. Invoke the `Validate()` method of the validator returned, to start validating the contract.
func (*CadenceV042ToV1ContractUpdateValidator) Location ¶
func (validator *CadenceV042ToV1ContractUpdateValidator) Location() common.Location
func (*CadenceV042ToV1ContractUpdateValidator) Validate ¶
func (validator *CadenceV042ToV1ContractUpdateValidator) Validate() error
Validate validates the contract update, and returns an error if it is an invalid update.
func (*CadenceV042ToV1ContractUpdateValidator) WithUserDefinedTypeChangeChecker ¶
func (validator *CadenceV042ToV1ContractUpdateValidator) WithUserDefinedTypeChangeChecker( typeChangeCheckFunc func(oldTypeID common.TypeID, newTypeID common.TypeID) (checked, valid bool), ) *CadenceV042ToV1ContractUpdateValidator
type CapabilityControllerHandler ¶
type CapabilityControllerHandler interface {
EventEmitter
}
type CapabilityControllerIssueHandler ¶
type CapabilityControllerIssueHandler interface {
EventEmitter
AccountIDGenerator
}
type CapabilityControllersMutatedDuringIterationError ¶
type CapabilityControllersMutatedDuringIterationError struct {
interpreter.LocationRange
}
CapabilityControllersMutatedDuringIterationError
func (*CapabilityControllersMutatedDuringIterationError) Error ¶
func (*CapabilityControllersMutatedDuringIterationError) Error() string
func (*CapabilityControllersMutatedDuringIterationError) IsUserError ¶
func (*CapabilityControllersMutatedDuringIterationError) IsUserError()
func (*CapabilityControllersMutatedDuringIterationError) SetLocationRange ¶ added in v1.8.0
func (e *CapabilityControllersMutatedDuringIterationError) SetLocationRange(locationRange interpreter.LocationRange)
type CompositeValueFunctionsHandler ¶
type CompositeValueFunctionsHandler func( inter *interpreter.Interpreter, compositeValue *interpreter.CompositeValue, ) *interpreter.FunctionOrderedMap
type CompositeValueFunctionsHandlers ¶
type CompositeValueFunctionsHandlers map[common.TypeID]CompositeValueFunctionsHandler
func DefaultStandardLibraryCompositeValueFunctionHandlers ¶
func DefaultStandardLibraryCompositeValueFunctionHandlers( handler StandardLibraryHandler, ) CompositeValueFunctionsHandlers
type ConformanceMismatchError ¶
ConformanceMismatchError is reported during a contract update, when the enum conformance of the new program does not match the existing one.
func (*ConformanceMismatchError) Error ¶
func (e *ConformanceMismatchError) Error() string
func (*ConformanceMismatchError) IsUserError ¶
func (*ConformanceMismatchError) IsUserError()
type ContractAdditionTracker ¶ added in v1.4.0
type ContractAdditionTracker interface {
// StartContractAddition starts adding a contract.
StartContractAddition(location common.AddressLocation)
// EndContractAddition ends adding the contract
EndContractAddition(location common.AddressLocation)
// IsContractBeingAdded checks whether a contract is being added in the current execution.
IsContractBeingAdded(location common.AddressLocation) bool
}
type ContractNotFoundError ¶
ContractNotFoundError is reported during a contract update, if no contract can be found in the program.
func (*ContractNotFoundError) Error ¶
func (e *ContractNotFoundError) Error() string
func (*ContractNotFoundError) IsUserError ¶
func (*ContractNotFoundError) IsUserError()
type ContractRemovalError ¶
type ContractRemovalError struct {
interpreter.LocationRange
Name string
}
ContractRemovalError
func (*ContractRemovalError) Error ¶
func (e *ContractRemovalError) Error() string
func (*ContractRemovalError) IsUserError ¶
func (*ContractRemovalError) IsUserError()
func (*ContractRemovalError) SetLocationRange ¶ added in v1.8.0
func (e *ContractRemovalError) SetLocationRange(locationRange interpreter.LocationRange)
type ContractUpdateError ¶
ContractUpdateError is reported upon any invalid update to a contract or contract interface. It contains all the errors reported during the update validation.
func (*ContractUpdateError) ChildErrors ¶
func (e *ContractUpdateError) ChildErrors() []error
func (*ContractUpdateError) Error ¶
func (e *ContractUpdateError) Error() string
func (*ContractUpdateError) ImportLocation ¶
func (e *ContractUpdateError) ImportLocation() common.Location
func (*ContractUpdateError) IsUserError ¶
func (*ContractUpdateError) IsUserError()
func (*ContractUpdateError) Unwrap ¶
func (e *ContractUpdateError) Unwrap() []error
type ContractUpdateValidator ¶
type ContractUpdateValidator struct {
*TypeComparator
// contains filtered or unexported fields
}
func NewContractUpdateValidator ¶
func NewContractUpdateValidator( location common.Location, contractName string, accountContractNamesProvider AccountContractNamesProvider, oldProgram *ast.Program, newProgram *ast.Program, ) *ContractUpdateValidator
NewContractUpdateValidator initializes and returns a validator, without performing any validation. Invoke the `Validate()` method of the validator returned, to start validating the contract.
func (*ContractUpdateValidator) Location ¶
func (validator *ContractUpdateValidator) Location() common.Location
func (*ContractUpdateValidator) Validate ¶
func (validator *ContractUpdateValidator) Validate() error
Validate validates the contract update, and returns an error if it is an invalid update.
type CurrentBlockProvider ¶
type CurrentBlockProvider interface {
BlockAtHeightProvider
// GetCurrentBlockHeight returns the current block height.
GetCurrentBlockHeight() (uint64, error)
}
type DeployedContractConstructorInvocation ¶
type DeployedContractConstructorInvocation struct {
ContractType *sema.CompositeType
ConstructorArguments []interpreter.Value
Address common.Address
}
type EnumCaseMismatchError ¶
EnumCaseMismatchError is reported during an enum update, when an updated enum case does not match the existing enum case.
func (*EnumCaseMismatchError) Error ¶
func (e *EnumCaseMismatchError) Error() string
func (*EnumCaseMismatchError) IsUserError ¶
func (*EnumCaseMismatchError) IsUserError()
type EventEmitter ¶
type EventEmitter interface {
EmitEvent(
context interpreter.ValueExportContext,
eventType *sema.CompositeType,
eventFields []interpreter.Value,
)
}
type ExtraneousFieldError ¶
ExtraneousFieldError is reported during a contract update, when an updated composite declaration has more fields than the existing declaration.
func (*ExtraneousFieldError) Error ¶
func (e *ExtraneousFieldError) Error() string
func (*ExtraneousFieldError) IsUserError ¶
func (*ExtraneousFieldError) IsUserError()
type FieldMismatchError ¶
FieldMismatchError is reported during a contract update, when a type of a field does not match the existing type of the same field.
func (*FieldMismatchError) Error ¶
func (e *FieldMismatchError) Error() string
func (*FieldMismatchError) IsUserError ¶
func (*FieldMismatchError) IsUserError()
func (*FieldMismatchError) SecondaryError ¶
func (e *FieldMismatchError) SecondaryError() string
type FlowLocation ¶
type FlowLocation struct{}
func (FlowLocation) Description ¶
func (l FlowLocation) Description() string
func (FlowLocation) ID ¶
func (l FlowLocation) ID() string
func (FlowLocation) MarshalJSON ¶
func (l FlowLocation) MarshalJSON() ([]byte, error)
func (FlowLocation) QualifiedIdentifier ¶
func (l FlowLocation) QualifiedIdentifier(typeID common.TypeID) string
func (FlowLocation) String ¶
func (l FlowLocation) String() string
func (FlowLocation) TypeID ¶
func (l FlowLocation) TypeID(memoryGauge common.MemoryGauge, qualifiedIdentifier string) common.TypeID
type FunctionLogger ¶ added in v1.7.0
func (FunctionLogger) ProgramLog ¶ added in v1.7.0
func (f FunctionLogger) ProgramLog(message string) error
type InvalidContractArgumentError ¶
func (*InvalidContractArgumentError) Error ¶
func (e *InvalidContractArgumentError) Error() string
func (*InvalidContractArgumentError) IsUserError ¶
func (*InvalidContractArgumentError) IsUserError()
type InvalidContractDeploymentError ¶
type InvalidContractDeploymentError struct {
Err error
interpreter.LocationRange
}
InvalidContractDeploymentError
func (*InvalidContractDeploymentError) ChildErrors ¶
func (e *InvalidContractDeploymentError) ChildErrors() []error
func (*InvalidContractDeploymentError) Error ¶
func (e *InvalidContractDeploymentError) Error() string
func (*InvalidContractDeploymentError) IsUserError ¶
func (*InvalidContractDeploymentError) IsUserError()
func (*InvalidContractDeploymentError) SetLocationRange ¶ added in v1.8.0
func (e *InvalidContractDeploymentError) SetLocationRange(locationRange interpreter.LocationRange)
func (*InvalidContractDeploymentError) Unwrap ¶
func (e *InvalidContractDeploymentError) Unwrap() error
type InvalidContractDeploymentOriginError ¶
type InvalidContractDeploymentOriginError struct {
interpreter.LocationRange
}
InvalidContractDeploymentOriginError
func (*InvalidContractDeploymentOriginError) Error ¶
func (*InvalidContractDeploymentOriginError) Error() string
func (*InvalidContractDeploymentOriginError) IsUserError ¶
func (*InvalidContractDeploymentOriginError) IsUserError()
func (*InvalidContractDeploymentOriginError) SetLocationRange ¶ added in v1.8.0
func (e *InvalidContractDeploymentOriginError) SetLocationRange(locationRange interpreter.LocationRange)
type InvalidDeclarationKindChangeError ¶
type InvalidDeclarationKindChangeError struct {
Name string
OldKind common.DeclarationKind
NewKind common.DeclarationKind
ast.Range
}
InvalidDeclarationKindChangeError is reported during a contract update, when an attempt is made to convert an existing contract to a contract interface, or vise versa.
func (*InvalidDeclarationKindChangeError) Error ¶
func (e *InvalidDeclarationKindChangeError) Error() string
func (*InvalidDeclarationKindChangeError) IsUserError ¶
func (*InvalidDeclarationKindChangeError) IsUserError()
type InvalidTypeRemovalPragmaError ¶
type InvalidTypeRemovalPragmaError struct {
Expression ast.Expression
ast.Range
}
InvalidTypeRemovalPragmaError is reported during a contract update if a malformed #removedType pragma is encountered
func (*InvalidTypeRemovalPragmaError) Error ¶
func (e *InvalidTypeRemovalPragmaError) Error() string
func (*InvalidTypeRemovalPragmaError) IsUserError ¶
func (*InvalidTypeRemovalPragmaError) IsUserError()
type MissingDeclarationError ¶
type MissingDeclarationError struct {
Name string
Kind common.DeclarationKind
ast.Range
}
MissingDeclarationError is reported during a contract update, if an existing declaration is removed.
func (*MissingDeclarationError) Error ¶
func (e *MissingDeclarationError) Error() string
func (*MissingDeclarationError) IsUserError ¶
func (*MissingDeclarationError) IsUserError()
type MissingEnumCasesError ¶
MissingEnumCasesError is reported during an enum update, if any enum cases are removed from an existing enum.
func (*MissingEnumCasesError) Error ¶
func (e *MissingEnumCasesError) Error() string
func (*MissingEnumCasesError) IsUserError ¶
func (*MissingEnumCasesError) IsUserError()
type NameMismatchError ¶
NameMismatchError is reported during a contract update, when an a composite declaration has a different name than the existing declaration.
func (*NameMismatchError) Error ¶
func (e *NameMismatchError) Error() string
func (*NameMismatchError) IsUserError ¶
func (*NameMismatchError) IsUserError()
type OldProgramError ¶
func (*OldProgramError) ChildErrors ¶
func (e *OldProgramError) ChildErrors() []error
func (*OldProgramError) Error ¶
func (e *OldProgramError) Error() string
func (*OldProgramError) ImportLocation ¶
func (e *OldProgramError) ImportLocation() common.Location
func (*OldProgramError) IsUserError ¶
func (e *OldProgramError) IsUserError()
func (*OldProgramError) Unwrap ¶
func (e *OldProgramError) Unwrap() error
type PanicError ¶
type PanicError struct {
interpreter.LocationRange
Message string
}
func (*PanicError) Error ¶
func (e *PanicError) Error() string
func (*PanicError) IsUserError ¶
func (*PanicError) IsUserError()
func (*PanicError) SetLocationRange ¶ added in v1.7.0
func (e *PanicError) SetLocationRange(locationRange interpreter.LocationRange)
type PublicKey ¶
type PublicKey struct {
PublicKey []byte
SignAlgo sema.SignatureAlgorithm
}
func NewPublicKeyFromValue ¶
func NewPublicKeyFromValue( context interpreter.PublicKeyCreationContext, publicKey interpreter.MemberAccessibleValue, ) ( *PublicKey, error, )
type PublicKeyFunctionsHandler ¶
type PublicKeyFunctionsHandler interface {
PublicKeySignatureVerifier
BLSPoPVerifier
}
type PublicKeySignatureVerifier ¶
type PublicKeySignatureVerifier interface {
// VerifySignature returns true if the given signature was produced by signing the given tag + data
// using the given public key, signature algorithm, and hash algorithm.
VerifySignature(
signature []byte,
tag string,
signedData []byte,
publicKey []byte,
signatureAlgorithm sema.SignatureAlgorithm,
hashAlgorithm sema.HashAlgorithm,
) (bool, error)
}
type PublicKeyValidator ¶
type RLPDecodeListError ¶
type RLPDecodeListError struct {
interpreter.LocationRange
Msg string
}
func (*RLPDecodeListError) Error ¶
func (e *RLPDecodeListError) Error() string
func (*RLPDecodeListError) IsUserError ¶
func (*RLPDecodeListError) IsUserError()
func (*RLPDecodeListError) SetLocationRange ¶ added in v1.8.0
func (e *RLPDecodeListError) SetLocationRange(locationRange interpreter.LocationRange)
type RLPDecodeStringError ¶
type RLPDecodeStringError struct {
interpreter.LocationRange
Msg string
}
func (*RLPDecodeStringError) Error ¶
func (e *RLPDecodeStringError) Error() string
func (*RLPDecodeStringError) IsUserError ¶
func (*RLPDecodeStringError) IsUserError()
func (*RLPDecodeStringError) SetLocationRange ¶ added in v1.8.0
func (e *RLPDecodeStringError) SetLocationRange(locationRange interpreter.LocationRange)
type RandomGenerator ¶
type ScriptResult ¶
type ScriptResult struct {
Value interpreter.Value
Error error
}
type SimpleContractAdditionTracker ¶ added in v1.4.0
type SimpleContractAdditionTracker struct {
// contains filtered or unexported fields
}
func NewSimpleContractAdditionTracker ¶ added in v1.4.0
func NewSimpleContractAdditionTracker() *SimpleContractAdditionTracker
func (*SimpleContractAdditionTracker) EndContractAddition ¶ added in v1.4.0
func (t *SimpleContractAdditionTracker) EndContractAddition(location common.AddressLocation)
func (*SimpleContractAdditionTracker) IsContractBeingAdded ¶ added in v1.4.0
func (t *SimpleContractAdditionTracker) IsContractBeingAdded(location common.AddressLocation) bool
func (*SimpleContractAdditionTracker) StartContractAddition ¶ added in v1.4.0
func (t *SimpleContractAdditionTracker) StartContractAddition(location common.AddressLocation)
type StandardLibraryHandler ¶
type StandardLibraryHandler interface {
Logger
RandomGenerator
BlockAtHeightProvider
CurrentBlockProvider
AccountCreator
PublicKeyValidator
PublicKeySignatureVerifier
BLSPoPVerifier
BLSPublicKeyAggregator
BLSSignatureAggregator
Hasher
}
type StandardLibraryType ¶
type StandardLibraryType struct {
Type sema.Type
Name string
Kind common.DeclarationKind
}
func (StandardLibraryType) TypeDeclarationKind ¶
func (t StandardLibraryType) TypeDeclarationKind() common.DeclarationKind
func (StandardLibraryType) TypeDeclarationName ¶
func (t StandardLibraryType) TypeDeclarationName() string
func (StandardLibraryType) TypeDeclarationPosition ¶
func (StandardLibraryType) TypeDeclarationPosition() *ast.Position
func (StandardLibraryType) TypeDeclarationType ¶
func (t StandardLibraryType) TypeDeclarationType() sema.Type
type StandardLibraryValue ¶
type StandardLibraryValue struct {
Type sema.Type
Value interpreter.Value
Position *ast.Position
Name string
DocString string
ArgumentLabels []string
Kind common.DeclarationKind
}
func InterpreterDefaultScriptStandardLibraryValues ¶ added in v1.7.0
func InterpreterDefaultScriptStandardLibraryValues(handler StandardLibraryHandler) []StandardLibraryValue
func InterpreterDefaultStandardLibraryValues ¶ added in v1.7.0
func InterpreterDefaultStandardLibraryValues(handler StandardLibraryHandler) []StandardLibraryValue
func NewBLSContract ¶
func NewBLSContract( gauge common.MemoryGauge, handler BLSContractHandler, ) StandardLibraryValue
func NewInterpreterAccountConstructor ¶ added in v1.7.0
func NewInterpreterAccountConstructor(creator AccountCreator) StandardLibraryValue
func NewInterpreterGetAccountFunction ¶ added in v1.7.0
func NewInterpreterGetAccountFunction(handler AccountHandler) StandardLibraryValue
func NewInterpreterGetAuthAccountFunction ¶ added in v1.7.0
func NewInterpreterGetAuthAccountFunction(handler AccountHandler) StandardLibraryValue
func NewInterpreterGetBlockFunction ¶ added in v1.7.0
func NewInterpreterGetBlockFunction(provider BlockAtHeightProvider) StandardLibraryValue
func NewInterpreterGetCurrentBlockFunction ¶ added in v1.7.0
func NewInterpreterGetCurrentBlockFunction(provider CurrentBlockProvider) StandardLibraryValue
func NewInterpreterHashAlgorithmConstructor ¶ added in v1.7.0
func NewInterpreterHashAlgorithmConstructor(hasher Hasher) StandardLibraryValue
these functions are left as is, since there are differences in the implementations between interpreter and vm
func NewInterpreterLogFunction ¶ added in v1.7.0
func NewInterpreterLogFunction(logger Logger) StandardLibraryValue
func NewInterpreterPublicKeyConstructor ¶ added in v1.7.0
func NewInterpreterPublicKeyConstructor( publicKeyValidator PublicKeyValidator, ) StandardLibraryValue
func NewInterpreterRevertibleRandomFunction ¶ added in v1.7.0
func NewInterpreterRevertibleRandomFunction(generator RandomGenerator) StandardLibraryValue
func NewInterpreterStandardLibraryStaticFunction ¶ added in v1.7.0
func NewInterpreterStandardLibraryStaticFunction( name string, functionType *sema.FunctionType, docString string, function interpreter.NativeFunction, ) StandardLibraryValue
These functions are helpers for testing. NewInterpreterStandardLibraryStaticFunction should only be used for creating static functions.
func NewNativeStandardLibraryStaticFunction ¶ added in v1.8.0
func NewNativeStandardLibraryStaticFunction( name string, functionType *sema.FunctionType, docString string, function interpreter.NativeFunction, isVM bool, ) StandardLibraryValue
func NewVMAccountConstructor ¶ added in v1.7.0
func NewVMAccountConstructor(creator AccountCreator) StandardLibraryValue
func NewVMGetAccountFunction ¶ added in v1.7.0
func NewVMGetAccountFunction(handler AccountHandler) StandardLibraryValue
func NewVMGetAuthAccountFunction ¶ added in v1.7.0
func NewVMGetAuthAccountFunction(handler AccountHandler) StandardLibraryValue
func NewVMGetBlockFunction ¶ added in v1.7.0
func NewVMGetBlockFunction(provider BlockAtHeightProvider) StandardLibraryValue
func NewVMGetCurrentBlockFunction ¶ added in v1.7.0
func NewVMGetCurrentBlockFunction(provider CurrentBlockProvider) StandardLibraryValue
func NewVMHashAlgorithmConstructor ¶ added in v1.7.0
func NewVMHashAlgorithmConstructor(hasher Hasher) StandardLibraryValue
func NewVMLogFunction ¶ added in v1.7.0
func NewVMLogFunction(logger Logger) StandardLibraryValue
func NewVMPublicKeyConstructor ¶ added in v1.7.0
func NewVMPublicKeyConstructor( publicKeyValidator PublicKeyValidator, ) StandardLibraryValue
func NewVMRevertibleRandomFunction ¶ added in v1.7.0
func NewVMRevertibleRandomFunction(generator RandomGenerator) StandardLibraryValue
func NewVMStandardLibraryStaticFunction ¶ added in v1.7.0
func NewVMStandardLibraryStaticFunction( name string, functionType *sema.FunctionType, docString string, function interpreter.NativeFunction, ) StandardLibraryValue
NewVMStandardLibraryStaticFunction should only be used for creating static functions.
func VMDefaultScriptStandardLibraryValues ¶ added in v1.7.0
func VMDefaultScriptStandardLibraryValues(handler StandardLibraryHandler) []StandardLibraryValue
func VMDefaultStandardLibraryValues ¶ added in v1.7.0
func VMDefaultStandardLibraryValues(handler StandardLibraryHandler) []StandardLibraryValue
func (StandardLibraryValue) ValueDeclarationArgumentLabels ¶
func (v StandardLibraryValue) ValueDeclarationArgumentLabels() []string
func (StandardLibraryValue) ValueDeclarationDocString ¶
func (v StandardLibraryValue) ValueDeclarationDocString() string
func (StandardLibraryValue) ValueDeclarationIsConstant ¶
func (v StandardLibraryValue) ValueDeclarationIsConstant() bool
func (StandardLibraryValue) ValueDeclarationKind ¶
func (v StandardLibraryValue) ValueDeclarationKind() common.DeclarationKind
func (StandardLibraryValue) ValueDeclarationName ¶
func (v StandardLibraryValue) ValueDeclarationName() string
func (StandardLibraryValue) ValueDeclarationPosition ¶
func (v StandardLibraryValue) ValueDeclarationPosition() *ast.Position
func (StandardLibraryValue) ValueDeclarationType ¶
func (v StandardLibraryValue) ValueDeclarationType() sema.Type
func (StandardLibraryValue) ValueDeclarationValue ¶
func (v StandardLibraryValue) ValueDeclarationValue() interpreter.Value
type StorageCapacityProvider ¶
type StorageCapacityProvider interface {
StorageCommitter
// GetStorageCapacity gets storage capacity in bytes on the address.
GetStorageCapacity(address common.Address) (uint64, error)
}
type StorageCommitter ¶
type StorageCommitter interface {
CommitStorageTemporarily(context interpreter.ValueTransferContext) error
}
type StorageUsedProvider ¶
type StorageUsedProvider interface {
StorageCommitter
// GetStorageUsed gets storage used in bytes by the address at the moment of the function call.
GetStorageUsed(address common.Address) (uint64, error)
}
type TestContractType ¶
type TestContractType struct {
Checker *sema.Checker
CompositeType *sema.CompositeType
InitializerTypes []sema.Type
// contains filtered or unexported fields
}
func GetTestContractType ¶
func GetTestContractType() *TestContractType
func (*TestContractType) NewTestContract ¶
func (t *TestContractType) NewTestContract( inter *interpreter.Interpreter, testFramework TestFramework, constructor interpreter.FunctionValue, ) ( *interpreter.CompositeValue, error, )
type TestFailedError ¶
type TestFailedError struct {
Err error
}
func (TestFailedError) Error ¶
func (e TestFailedError) Error() string
func (TestFailedError) IsUserError ¶
func (TestFailedError) IsUserError()
func (TestFailedError) Unwrap ¶
func (e TestFailedError) Unwrap() error
type TestFramework ¶
type TestFramework interface {
EmulatorBackend() Blockchain
ReadFile(string) (string, error)
}
type TestFrameworkAddTransactionContext ¶ added in v1.4.0
type TestFrameworkAddTransactionContext interface {
interpreter.ValueExportContext
}
type TestFrameworkContractDeploymentContext ¶ added in v1.4.0
type TestFrameworkContractDeploymentContext interface {
interpreter.ValueExportContext
}
type TestFrameworkEventsContext ¶ added in v1.4.0
type TestFrameworkEventsContext interface {
common.MemoryGauge
interpreter.ArrayCreationContext
interpreter.ArrayCreationContext
interpreter.MemberAccessibleContext
}
type TestFrameworkScriptExecutionContext ¶ added in v1.4.0
type TestFrameworkScriptExecutionContext interface {
interpreter.ValueExportContext
}
type TransactionResult ¶
type TransactionResult struct {
Error error
}
type TypeComparator ¶
type TypeComparator struct {
RootDeclIdentifier *ast.Identifier
// contains filtered or unexported fields
}
func (*TypeComparator) CheckConstantSizedTypeEquality ¶
func (c *TypeComparator) CheckConstantSizedTypeEquality(expected *ast.ConstantSizedType, found ast.Type) error
func (*TypeComparator) CheckDictionaryTypeEquality ¶
func (c *TypeComparator) CheckDictionaryTypeEquality(expected *ast.DictionaryType, found ast.Type) error
func (*TypeComparator) CheckFunctionTypeEquality ¶
func (c *TypeComparator) CheckFunctionTypeEquality(expected *ast.FunctionType, found ast.Type) error
func (*TypeComparator) CheckInstantiationTypeEquality ¶
func (c *TypeComparator) CheckInstantiationTypeEquality(expected *ast.InstantiationType, found ast.Type) error
func (*TypeComparator) CheckIntersectionTypeEquality ¶
func (c *TypeComparator) CheckIntersectionTypeEquality(expected *ast.IntersectionType, found ast.Type) error
func (*TypeComparator) CheckNominalTypeEquality ¶
func (c *TypeComparator) CheckNominalTypeEquality(expected *ast.NominalType, found ast.Type) error
func (*TypeComparator) CheckOptionalTypeEquality ¶
func (c *TypeComparator) CheckOptionalTypeEquality(expected *ast.OptionalType, found ast.Type) error
func (*TypeComparator) CheckReferenceTypeEquality ¶
func (c *TypeComparator) CheckReferenceTypeEquality(expected *ast.ReferenceType, found ast.Type) error
func (*TypeComparator) CheckVariableSizedTypeEquality ¶
func (c *TypeComparator) CheckVariableSizedTypeEquality(expected *ast.VariableSizedType, found ast.Type) error
type TypeMismatchError ¶
TypeMismatchError is reported during a contract update, when a type of the new program does not match the existing type.
func (*TypeMismatchError) Error ¶
func (e *TypeMismatchError) Error() string
func (*TypeMismatchError) IsUserError ¶
func (*TypeMismatchError) IsUserError()
type TypeRemovalPragmaRemovalError ¶
type TypeRemovalPragmaRemovalError struct {
RemovedType string
}
TypeRemovalPragmaRemovalError is reported during a contract update if a #removedType pragma is removed
func (*TypeRemovalPragmaRemovalError) Error ¶
func (e *TypeRemovalPragmaRemovalError) Error() string
func (*TypeRemovalPragmaRemovalError) IsUserError ¶
func (*TypeRemovalPragmaRemovalError) IsUserError()
type UnrepresentableEntitlementsUpgrade ¶
type UnrepresentableEntitlementsUpgrade struct {
Type sema.Type
InvalidAuthorization sema.Access
ast.Range
}
UnrepresentableEntitlementsUpgrade is reported during a contract upgrade, when a composite or interface type is given access modifiers on its field that would cause the migration to produce an unrepresentable entitlement set for references to that type
func (*UnrepresentableEntitlementsUpgrade) Error ¶
func (e *UnrepresentableEntitlementsUpgrade) Error() string
func (*UnrepresentableEntitlementsUpgrade) IsUserError ¶
func (*UnrepresentableEntitlementsUpgrade) IsUserError()
func (*UnrepresentableEntitlementsUpgrade) SecondaryError ¶
func (e *UnrepresentableEntitlementsUpgrade) SecondaryError() string
type UpdateValidator ¶
type UpdateValidator interface {
ast.TypeEqualityChecker
Validate() error
Location() common.Location
// contains filtered or unexported methods
}
type UseOfRemovedTypeError ¶
type UseOfRemovedTypeError struct {
Declaration ast.Declaration
ast.Range
}
UseOfRemovedTypeError is reported during a contract update if a type is encountered that is also in a #removedType pragma
func (*UseOfRemovedTypeError) Error ¶
func (e *UseOfRemovedTypeError) Error() string
func (*UseOfRemovedTypeError) IsUserError ¶
func (*UseOfRemovedTypeError) IsUserError()
type VMFunction ¶ added in v1.7.0
type VMFunction struct {
BaseType sema.Type
FunctionValue *vm.NativeFunctionValue
}
func NewVMAccountAccountCapabilitiesForEachControllerFunction ¶ added in v1.7.0
func NewVMAccountAccountCapabilitiesForEachControllerFunction( handler CapabilityControllerHandler, ) VMFunction
func NewVMAccountAccountCapabilitiesGetControllerFunction ¶ added in v1.7.0
func NewVMAccountAccountCapabilitiesGetControllerFunction( handler CapabilityControllerHandler, ) VMFunction
func NewVMAccountAccountCapabilitiesGetControllersFunction ¶ added in v1.7.0
func NewVMAccountAccountCapabilitiesGetControllersFunction( handler CapabilityControllerHandler, ) VMFunction
func NewVMAccountAccountCapabilitiesIssueFunction ¶ added in v1.7.0
func NewVMAccountAccountCapabilitiesIssueFunction( handler CapabilityControllerIssueHandler, ) VMFunction
func NewVMAccountAccountCapabilitiesIssueWithTypeFunction ¶ added in v1.7.0
func NewVMAccountAccountCapabilitiesIssueWithTypeFunction( handler CapabilityControllerIssueHandler, ) VMFunction
func NewVMAccountCapabilitiesGetFunction ¶ added in v1.7.0
func NewVMAccountCapabilitiesGetFunction( controllerHandler CapabilityControllerHandler, borrow bool, ) VMFunction
func NewVMAccountCapabilitiesPublishFunction ¶ added in v1.7.0
func NewVMAccountCapabilitiesPublishFunction( handler CapabilityControllerHandler, ) VMFunction
func NewVMAccountCapabilitiesUnpublishFunction ¶ added in v1.7.0
func NewVMAccountCapabilitiesUnpublishFunction( handler CapabilityControllerHandler, ) VMFunction
func NewVMAccountContractsBorrowFunction ¶ added in v1.7.0
func NewVMAccountContractsBorrowFunction(handler AccountContractsHandler) VMFunction
func NewVMAccountContractsGetFunction ¶ added in v1.7.0
func NewVMAccountContractsGetFunction(provider AccountContractProvider) VMFunction
func NewVMAccountInboxClaimFunction ¶ added in v1.7.0
func NewVMAccountInboxClaimFunction( handler EventEmitter, ) VMFunction
func NewVMAccountInboxPublishFunction ¶ added in v1.7.0
func NewVMAccountInboxPublishFunction( handler EventEmitter, ) VMFunction
func NewVMAccountInboxUnpublishFunction ¶ added in v1.7.0
func NewVMAccountInboxUnpublishFunction( handler EventEmitter, ) VMFunction
func NewVMAccountKeysAddFunction ¶ added in v1.7.0
func NewVMAccountKeysAddFunction( handler AccountKeyAdditionHandler, ) VMFunction
func NewVMAccountKeysForEachFunction ¶ added in v1.7.0
func NewVMAccountKeysForEachFunction( provider AccountKeyProvider, ) VMFunction
func NewVMAccountKeysGetFunction ¶ added in v1.7.0
func NewVMAccountKeysGetFunction( provider AccountKeyProvider, ) VMFunction
func NewVMAccountKeysRevokeFunction ¶ added in v1.7.0
func NewVMAccountKeysRevokeFunction( handler AccountKeyRevocationHandler, ) VMFunction
func NewVMAccountStorageCapabilitiesForEachControllerFunction ¶ added in v1.7.0
func NewVMAccountStorageCapabilitiesForEachControllerFunction( handler CapabilityControllerHandler, ) VMFunction
func NewVMAccountStorageCapabilitiesGetControllerFunction ¶ added in v1.7.0
func NewVMAccountStorageCapabilitiesGetControllerFunction( handler CapabilityControllerHandler, ) VMFunction
func NewVMAccountStorageCapabilitiesGetControllersFunction ¶ added in v1.7.0
func NewVMAccountStorageCapabilitiesGetControllersFunction( handler CapabilityControllerHandler, ) VMFunction
func NewVMAccountStorageCapabilitiesIssueFunction ¶ added in v1.7.0
func NewVMAccountStorageCapabilitiesIssueFunction( handler CapabilityControllerIssueHandler, ) VMFunction
func NewVMAccountStorageCapabilitiesIssueWithTypeFunction ¶ added in v1.7.0
func NewVMAccountStorageCapabilitiesIssueWithTypeFunction( handler CapabilityControllerIssueHandler, ) VMFunction
func NewVMBLSAggregatePublicKeysFunction ¶ added in v1.7.0
func NewVMBLSAggregatePublicKeysFunction( aggregator BLSPublicKeyAggregator, ) VMFunction
func NewVMBLSAggregateSignaturesFunction ¶ added in v1.7.0
func NewVMBLSAggregateSignaturesFunction( aggregator BLSSignatureAggregator, ) VMFunction
func NewVMHashAlgorithmHashFunction ¶ added in v1.7.0
func NewVMHashAlgorithmHashFunction( hasher Hasher, ) VMFunction
func NewVMHashAlgorithmHashWithTagFunction ¶ added in v1.7.0
func NewVMHashAlgorithmHashWithTagFunction( hasher Hasher, ) VMFunction
func NewVMPublicKeyVerifyPoPFunction ¶ added in v1.7.0
func NewVMPublicKeyVerifyPoPFunction(verifier BLSPoPVerifier) VMFunction
func NewVMPublicKeyVerifySignatureFunction ¶ added in v1.7.0
func NewVMPublicKeyVerifySignatureFunction(verifier PublicKeySignatureVerifier) VMFunction
func VMFunctions ¶ added in v1.7.0
func VMFunctions(handler StandardLibraryHandler) []VMFunction
Source Files
¶
- account.go
- assert.go
- block.go
- bls.gen.go
- bls.go
- builtin.go
- cadence_v0.42_to_v1_contract_upgrade_validator.go
- contract_update_validation.go
- crypto.go
- flow.go
- functions.go
- hashalgorithm.go
- log.go
- panic.go
- publickey.go
- random.go
- range.go
- rlp.gen.go
- rlp.go
- signaturealgorithm.go
- test-framework.go
- test.go
- test_contract.go
- test_emulatorbackend.go
- type-comparator.go
- types.go
- value.go