Documentation
¶
Index ¶
- Constants
- Variables
- func BorrowCapabilityController(inter *interpreter.Interpreter, locationRange interpreter.LocationRange, ...) interpreter.ReferenceValue
- func CheckCapabilityController(inter *interpreter.Interpreter, locationRange interpreter.LocationRange, ...) interpreter.BoolValue
- func CodeToHashValue(inter *interpreter.Interpreter, code []byte) *interpreter.ArrayValue
- func CryptoChecker() *sema.Checker
- func CryptoContractInitializerTypes() []sema.Type
- func CryptoContractType() *sema.CompositeType
- func GetCheckedCapabilityControllerReference(inter *interpreter.Interpreter, locationRange interpreter.LocationRange, ...) interpreter.ReferenceValue
- func IssueAccountCapabilityController(inter *interpreter.Interpreter, locationRange interpreter.LocationRange, ...) interpreter.UInt64Value
- func IssueStorageCapabilityController(inter *interpreter.Interpreter, locationRange interpreter.LocationRange, ...) interpreter.UInt64Value
- func NewAccountKeyValue(inter *interpreter.Interpreter, locationRange interpreter.LocationRange, ...) interpreter.Value
- func NewAccountReferenceValue(inter *interpreter.Interpreter, handler AccountHandler, ...) interpreter.Value
- func NewAccountValue(inter *interpreter.Interpreter, handler AccountHandler, ...) interpreter.Value
- func NewBlockValue(inter *interpreter.Interpreter, locationRange interpreter.LocationRange, ...) interpreter.Value
- func NewCryptoContract(inter *interpreter.Interpreter, constructor interpreter.FunctionValue, ...) (*interpreter.CompositeValue, error)
- func NewHashAlgorithmCase(rawValue interpreter.UInt8Value, hasher Hasher) (interpreter.MemberAccessibleValue, error)
- func NewHashAlgorithmFromValue(inter *interpreter.Interpreter, locationRange interpreter.LocationRange, ...) sema.HashAlgorithm
- func NewPublicKeyFromFields(inter *interpreter.Interpreter, locationRange interpreter.LocationRange, ...) *interpreter.CompositeValue
- func NewPublicKeyValue(inter *interpreter.Interpreter, locationRange interpreter.LocationRange, ...) *interpreter.CompositeValue
- func NewSignatureAlgorithmCase(rawValue interpreter.UInt8Value) interpreter.MemberAccessibleValue
- func NewTestInterpreterContractValueHandler(testFramework TestFramework) interpreter.ContractValueHandlerFunc
- func PublicKeyFunctions(inter *interpreter.Interpreter, publicKeyValue *interpreter.CompositeValue, ...) *interpreter.FunctionOrderedMap
- func RevertibleRandom(generator RandomGenerator, memoryGauge common.MemoryGauge, ...) interpreter.Value
- 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
- func (validator *CadenceV042ToV1ContractUpdateValidator) Validate() error
- func (validator *CadenceV042ToV1ContractUpdateValidator) WithTypeRemovalEnabled(enabled bool) UpdateValidator
- func (validator *CadenceV042ToV1ContractUpdateValidator) WithUserDefinedTypeChangeChecker(...) *CadenceV042ToV1ContractUpdateValidator
- type CapabilityControllerHandler
- type CapabilityControllerIssueHandler
- type CapabilityControllersMutatedDuringIterationError
- type CompositeValueFunctionsHandler
- type CompositeValueFunctionsHandlers
- type ConformanceMismatchError
- 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 Hasher
- type InvalidContractArgumentError
- type InvalidContractDeploymentError
- 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 StandardLibraryHandler
- type StandardLibraryType
- type StandardLibraryValue
- func DefaultScriptStandardLibraryValues(handler StandardLibraryHandler) []StandardLibraryValue
- func DefaultStandardLibraryValues(handler StandardLibraryHandler) []StandardLibraryValue
- func NewAccountConstructor(creator AccountCreator) StandardLibraryValue
- func NewBLSContract(gauge common.MemoryGauge, handler BLSContractHandler) StandardLibraryValue
- func NewGetAccountFunction(handler AccountHandler) StandardLibraryValue
- func NewGetAuthAccountFunction(handler AccountHandler) StandardLibraryValue
- func NewGetBlockFunction(provider BlockAtHeightProvider) StandardLibraryValue
- func NewGetCurrentBlockFunction(provider CurrentBlockProvider) StandardLibraryValue
- func NewHashAlgorithmConstructor(hasher Hasher) StandardLibraryValue
- func NewLogFunction(logger Logger) StandardLibraryValue
- func NewPublicKeyConstructor(publicKeyValidator PublicKeyValidator) StandardLibraryValue
- func NewRevertibleRandomFunction(generator RandomGenerator) StandardLibraryValue
- func NewStandardLibraryStaticFunction(name string, functionType *sema.FunctionType, docString string, ...) 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 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
Constants ¶
const AccountCapabilityStorageDomain = "acc_cap"
AccountCapabilityStorageDomain is the storage domain which records active account capability controller IDs
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 CapabilityControllerStorageDomain = "cap_con"
CapabilityControllerStorageDomain is the storage domain which stores capability controllers by capability ID
const CapabilityControllerTagStorageDomain = "cap_tag"
CapabilityControllerTagStorageDomain is the storage domain which stores capability controller tags by capability ID
const CryptoCheckerLocation = common.IdentifierLocation("Crypto")
const FlowLocationPrefix = "flow"
const HashSize = 32
const InboxStorageDomain = "inbox"
const PathCapabilityStorageDomain = "path_cap"
PathCapabilityStorageDomain is the storage domain which stores capability ID dictionaries (sets) by storage path identifier
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 AssertFunction = NewStandardLibraryStaticFunction( "assert", assertFunctionType, assertFunctionDocString, func(invocation interpreter.Invocation) interpreter.Value { result, ok := invocation.Arguments[0].(interpreter.BoolValue) if !ok { panic(errors.NewUnreachableError()) } if !result { var message string if len(invocation.Arguments) > 1 { messageValue, ok := invocation.Arguments[1].(*interpreter.StringValue) if !ok { panic(errors.NewUnreachableError()) } message = messageValue.Str } panic(AssertionError{ Message: message, LocationRange: invocation.LocationRange, }) } return interpreter.Void }, )
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 FlowEventTypes = map[common.TypeID]*sema.CompositeType{}
var HashType = &sema.ConstantSizedType{ Size: HashSize, Type: sema.UInt8Type, }
var HashTypeAnnotation = sema.NewTypeAnnotation(HashType)
var InclusiveRangeConstructorFunction = NewStandardLibraryStaticFunction( "InclusiveRange", inclusiveRangeConstructorFunctionType, inclusiveRangeConstructorFunctionDocString, func(invocation interpreter.Invocation) interpreter.Value { start, startOk := invocation.Arguments[0].(interpreter.IntegerValue) end, endOk := invocation.Arguments[1].(interpreter.IntegerValue) if !startOk || !endOk { panic(errors.NewUnreachableError()) } inter := invocation.Interpreter locationRange := invocation.LocationRange startStaticType := start.StaticType(inter) endStaticType := end.StaticType(inter) if !startStaticType.Equal(endStaticType) { panic(interpreter.InclusiveRangeConstructionError{ LocationRange: locationRange, Message: fmt.Sprintf( "start and end are of different types. start: %s and end: %s", startStaticType, endStaticType, ), }) } rangeStaticType := interpreter.NewInclusiveRangeStaticType(invocation.Interpreter, startStaticType) rangeSemaType := sema.NewInclusiveRangeType(invocation.Interpreter, invocation.ArgumentTypes[0]) if len(invocation.Arguments) > 2 { step, ok := invocation.Arguments[2].(interpreter.IntegerValue) if !ok { panic(errors.NewUnreachableError()) } stepStaticType := step.StaticType(inter) if stepStaticType != startStaticType { panic(interpreter.InclusiveRangeConstructionError{ LocationRange: locationRange, Message: fmt.Sprintf( "step must be of the same type as start and end. start/end: %s and step: %s", startStaticType, stepStaticType, ), }) } return interpreter.NewInclusiveRangeValueWithStep( inter, locationRange, start, end, step, rangeStaticType, rangeSemaType, ) } return interpreter.NewInclusiveRangeValue( inter, locationRange, start, end, rangeStaticType, rangeSemaType, ) }, )
var LogFunctionType = sema.NewSimpleFunctionType( sema.FunctionPurityImpure, []sema.Parameter{ { Label: sema.ArgumentLabelNotRequired, Identifier: "value", TypeAnnotation: sema.AnyStructTypeAnnotation, }, }, sema.VoidTypeAnnotation, )
var PanicFunction = NewStandardLibraryStaticFunction( "panic", panicFunctionType, panicFunctionDocString, func(invocation interpreter.Invocation) interpreter.Value { messageValue, ok := invocation.Arguments[0].(*interpreter.StringValue) if !ok { panic(errors.NewUnreachableError()) } message := messageValue.Str panic(PanicError{ Message: message, LocationRange: invocation.LocationRange, }) }, )
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 SignatureAlgorithmConstructor = StandardLibraryValue{ Name: sema.SignatureAlgorithmTypeName, Type: cryptoAlgorithmEnumConstructorType( sema.SignatureAlgorithmType, sema.SignatureAlgorithms, ), Value: signatureAlgorithmConstructorValue, Kind: common.DeclarationKindEnum, }
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 ZeroModuloError = errors.NewDefaultUserError("modulo argument cannot be zero")
var _, SignatureAlgorithmCaseValues = cryptoAlgorithmEnumValueAndCaseValues(
sema.SignatureAlgorithmType,
sema.SignatureAlgorithms,
NewSignatureAlgorithmCase,
)
Functions ¶
func BorrowCapabilityController ¶ added in v0.39.0
func BorrowCapabilityController( inter *interpreter.Interpreter, locationRange interpreter.LocationRange, capabilityAddress interpreter.AddressValue, capabilityID interpreter.UInt64Value, wantedBorrowType *sema.ReferenceType, capabilityBorrowType *sema.ReferenceType, handler CapabilityControllerHandler, ) interpreter.ReferenceValue
func CheckCapabilityController ¶ added in v0.39.0
func CheckCapabilityController( inter *interpreter.Interpreter, locationRange interpreter.LocationRange, capabilityAddress interpreter.AddressValue, capabilityID interpreter.UInt64Value, wantedBorrowType *sema.ReferenceType, capabilityBorrowType *sema.ReferenceType, handler CapabilityControllerHandler, ) interpreter.BoolValue
func CodeToHashValue ¶ added in v0.26.0
func CodeToHashValue(inter *interpreter.Interpreter, code []byte) *interpreter.ArrayValue
func CryptoChecker ¶ added in v0.5.0
func CryptoContractInitializerTypes ¶ added in v0.30.0
func CryptoContractType ¶ added in v0.30.0
func CryptoContractType() *sema.CompositeType
func GetCheckedCapabilityControllerReference ¶ added in v1.0.0
func GetCheckedCapabilityControllerReference( inter *interpreter.Interpreter, locationRange interpreter.LocationRange, capabilityAddressValue interpreter.AddressValue, capabilityIDValue interpreter.UInt64Value, wantedBorrowType *sema.ReferenceType, capabilityBorrowType *sema.ReferenceType, handler CapabilityControllerHandler, ) interpreter.ReferenceValue
func IssueAccountCapabilityController ¶ added in v1.0.0
func IssueAccountCapabilityController( inter *interpreter.Interpreter, locationRange interpreter.LocationRange, handler CapabilityControllerIssueHandler, address common.Address, borrowStaticType *interpreter.ReferenceStaticType, ) interpreter.UInt64Value
func IssueStorageCapabilityController ¶ added in v1.0.0
func IssueStorageCapabilityController( inter *interpreter.Interpreter, locationRange interpreter.LocationRange, handler CapabilityControllerIssueHandler, address common.Address, borrowStaticType *interpreter.ReferenceStaticType, targetPathValue interpreter.PathValue, ) interpreter.UInt64Value
func NewAccountKeyValue ¶ added in v0.26.0
func NewAccountKeyValue( inter *interpreter.Interpreter, locationRange interpreter.LocationRange, accountKey *AccountKey, hasher Hasher, ) interpreter.Value
func NewAccountReferenceValue ¶ added in v1.0.0
func NewAccountReferenceValue( inter *interpreter.Interpreter, handler AccountHandler, addressValue interpreter.AddressValue, authorization interpreter.Authorization, locationRange interpreter.LocationRange, ) interpreter.Value
func NewAccountValue ¶ added in v1.0.0
func NewAccountValue( inter *interpreter.Interpreter, handler AccountHandler, addressValue interpreter.AddressValue, ) interpreter.Value
func NewBlockValue ¶ added in v0.26.0
func NewBlockValue( inter *interpreter.Interpreter, locationRange interpreter.LocationRange, block Block, ) interpreter.Value
func NewCryptoContract ¶ added in v0.5.0
func NewCryptoContract( inter *interpreter.Interpreter, constructor interpreter.FunctionValue, invocationRange ast.Range, ) ( *interpreter.CompositeValue, error, )
func NewHashAlgorithmCase ¶ added in v0.18.0
func NewHashAlgorithmCase( rawValue interpreter.UInt8Value, hasher Hasher, ) ( interpreter.MemberAccessibleValue, error, )
func NewHashAlgorithmFromValue ¶ added in v0.26.0
func NewHashAlgorithmFromValue( inter *interpreter.Interpreter, locationRange interpreter.LocationRange, value interpreter.Value, ) sema.HashAlgorithm
func NewPublicKeyFromFields ¶ added in v0.30.0
func NewPublicKeyFromFields( inter *interpreter.Interpreter, locationRange interpreter.LocationRange, publicKey *interpreter.ArrayValue, signAlgo *interpreter.SimpleCompositeValue, publicKeyValidator PublicKeyValidator, ) *interpreter.CompositeValue
func NewPublicKeyValue ¶ added in v0.26.0
func NewPublicKeyValue( inter *interpreter.Interpreter, locationRange interpreter.LocationRange, publicKey *PublicKey, ) *interpreter.CompositeValue
func NewSignatureAlgorithmCase ¶ added in v0.18.0
func NewSignatureAlgorithmCase(rawValue interpreter.UInt8Value) interpreter.MemberAccessibleValue
func NewTestInterpreterContractValueHandler ¶ added in v0.30.0
func NewTestInterpreterContractValueHandler( testFramework TestFramework, ) interpreter.ContractValueHandlerFunc
func PublicKeyFunctions ¶ added in v1.0.0
func PublicKeyFunctions( inter *interpreter.Interpreter, publicKeyValue *interpreter.CompositeValue, handler PublicKeyFunctionsHandler, ) *interpreter.FunctionOrderedMap
func RevertibleRandom ¶ added in v1.0.0
func RevertibleRandom( generator RandomGenerator, memoryGauge common.MemoryGauge, returnIntegerType sema.Type, moduloValue interpreter.Value, ) interpreter.Value
func TestCheckerContractValueHandler ¶ added in v0.30.0
func TestCheckerContractValueHandler( checker *sema.Checker, declaration *ast.CompositeDeclaration, compositeType *sema.CompositeType, ) sema.ValueDeclaration
Types ¶
type AccountContractAdditionAndNamesHandler ¶ added in v1.0.0
type AccountContractAdditionAndNamesHandler interface {
AccountContractAdditionHandler
AccountContractNamesProvider
}
type AccountContractAdditionHandler ¶ added in v0.26.0
type AccountContractAdditionHandler interface {
EventEmitter
AccountContractProvider
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
InterpretContract(
location common.AddressLocation,
program *interpreter.Program,
name string,
invocation DeployedContractConstructorInvocation,
) (
*interpreter.CompositeValue,
error,
)
TemporarilyRecordCode(location common.AddressLocation, code []byte)
// 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 AccountContractNamesProvider ¶ added in v0.26.0
type AccountContractProvider ¶ added in v0.26.0
type AccountContractProvider interface {
// GetAccountContractCode returns the code associated with an account contract.
GetAccountContractCode(location common.AddressLocation) ([]byte, error)
}
type AccountContractRemovalHandler ¶ added in v0.26.0
type AccountContractRemovalHandler interface {
EventEmitter
AccountContractProvider
RemoveAccountContractCode(location common.AddressLocation) error
RecordContractRemoval(location common.AddressLocation)
}
type AccountContractsHandler ¶ added in v1.0.0
type AccountContractsHandler interface {
AccountContractProvider
AccountContractAdditionAndNamesHandler
AccountContractRemovalHandler
}
type AccountCreator ¶ added in v0.26.0
type AccountCreator interface {
StorageCommitter
EventEmitter
AccountHandler
// CreateAccount creates a new account.
CreateAccount(payer common.Address) (address common.Address, err error)
}
type AccountHandler ¶ added in v1.0.0
type AccountHandler interface {
AccountIDGenerator
BalanceProvider
AvailableBalanceProvider
AccountStorageHandler
AccountKeysHandler
AccountContractsHandler
}
type AccountIDGenerator ¶ added in v0.39.0
type AccountKey ¶ added in v0.26.0
type AccountKeyAdditionHandler ¶ added in v0.26.0
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 ¶ added in v0.26.0
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 ¶ added in v0.26.0
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 ¶ added in v1.0.0
type AccountKeysHandler interface {
AccountKeyProvider
AccountKeyAdditionHandler
AccountKeyRevocationHandler
}
type AccountStorageHandler ¶ added in v1.0.0
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 ¶ added in v0.25.0
func (AssertionError) IsUserError()
type AuthorizationMismatchError ¶ added in v1.0.0
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 ¶ added in v1.0.0
func (e *AuthorizationMismatchError) Error() string
func (*AuthorizationMismatchError) IsUserError ¶ added in v1.0.0
func (*AuthorizationMismatchError) IsUserError()
type AvailableBalanceProvider ¶ added in v0.26.0
type BLSContractHandler ¶ added in v0.30.0
type BLSContractHandler interface {
PublicKeyValidator
PublicKeySignatureVerifier
BLSPoPVerifier
BLSPublicKeyAggregator
BLSSignatureAggregator
}
type BLSPoPVerifier ¶ added in v0.30.0
type BLSPublicKeyAggregator ¶ added in v0.30.0
type BLSPublicKeyAggregator interface {
PublicKeySignatureVerifier
BLSPoPVerifier
// BLSAggregatePublicKeys aggregate multiple BLS public keys into one.
BLSAggregatePublicKeys(publicKeys []*PublicKey) (*PublicKey, error)
}
type BLSSignatureAggregator ¶ added in v0.30.0
type BalanceProvider ¶ added in v0.26.0
type BlockAtHeightProvider ¶ added in v0.26.0
type BlockHash ¶ added in v0.26.0
type BlockHash [BlockHashLength]byte
type Blockchain ¶ added in v0.41.0
type Blockchain interface {
RunScript(
inter *interpreter.Interpreter,
code string, arguments []interpreter.Value,
) *ScriptResult
CreateAccount() (*Account, error)
GetAccount(interpreter.AddressValue) (*Account, error)
AddTransaction(
inter *interpreter.Interpreter,
code string,
authorizers []common.Address,
signers []*Account,
arguments []interpreter.Value,
) error
ExecuteNextTransaction() *TransactionResult
CommitBlock() error
DeployContract(
inter *interpreter.Interpreter,
name string,
path string,
arguments []interpreter.Value,
) error
Logs() []string
ServiceAccount() (*Account, error)
Events(
inter *interpreter.Interpreter,
eventType interpreter.StaticType,
) interpreter.Value
Reset(uint64)
MoveTime(int64)
CreateSnapshot(string) error
LoadSnapshot(string) error
}
type CadenceV042ToV1ContractUpdateValidator ¶ added in v1.0.0
type CadenceV042ToV1ContractUpdateValidator struct {
*TypeComparator
// contains filtered or unexported fields
}
func NewCadenceV042ToV1ContractUpdateValidator ¶ added in v1.0.0
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) Validate ¶ added in v1.0.0
func (validator *CadenceV042ToV1ContractUpdateValidator) Validate() error
Validate validates the contract update, and returns an error if it is an invalid update.
func (*CadenceV042ToV1ContractUpdateValidator) WithTypeRemovalEnabled ¶ added in v1.0.0
func (validator *CadenceV042ToV1ContractUpdateValidator) WithTypeRemovalEnabled( enabled bool, ) UpdateValidator
func (*CadenceV042ToV1ContractUpdateValidator) WithUserDefinedTypeChangeChecker ¶ added in v1.0.0
func (validator *CadenceV042ToV1ContractUpdateValidator) WithUserDefinedTypeChangeChecker( typeChangeCheckFunc func(oldTypeID common.TypeID, newTypeID common.TypeID) (checked, valid bool), ) *CadenceV042ToV1ContractUpdateValidator
type CapabilityControllerHandler ¶ added in v1.0.0
type CapabilityControllerHandler interface {
EventEmitter
}
type CapabilityControllerIssueHandler ¶ added in v1.0.0
type CapabilityControllerIssueHandler interface {
EventEmitter
AccountIDGenerator
}
type CapabilityControllersMutatedDuringIterationError ¶ added in v0.39.0
type CapabilityControllersMutatedDuringIterationError struct {
interpreter.LocationRange
}
CapabilityControllersMutatedDuringIterationError
func (CapabilityControllersMutatedDuringIterationError) Error ¶ added in v0.39.0
func (CapabilityControllersMutatedDuringIterationError) Error() string
func (CapabilityControllersMutatedDuringIterationError) IsUserError ¶ added in v0.39.0
func (CapabilityControllersMutatedDuringIterationError) IsUserError()
type CompositeValueFunctionsHandler ¶ added in v1.0.0
type CompositeValueFunctionsHandler func( inter *interpreter.Interpreter, locationRange interpreter.LocationRange, compositeValue *interpreter.CompositeValue, ) *interpreter.FunctionOrderedMap
type CompositeValueFunctionsHandlers ¶ added in v1.0.0
type CompositeValueFunctionsHandlers map[common.TypeID]CompositeValueFunctionsHandler
func DefaultStandardLibraryCompositeValueFunctionHandlers ¶ added in v1.0.0
func DefaultStandardLibraryCompositeValueFunctionHandlers( handler StandardLibraryHandler, ) CompositeValueFunctionsHandlers
type ConformanceMismatchError ¶ added in v0.26.0
ConformanceMismatchError is reported during a contract update, when the enum conformance of the new program does not match the existing one.
func (*ConformanceMismatchError) Error ¶ added in v0.26.0
func (e *ConformanceMismatchError) Error() string
func (*ConformanceMismatchError) IsUserError ¶ added in v0.26.0
func (*ConformanceMismatchError) IsUserError()
type ContractNotFoundError ¶ added in v0.26.0
ContractNotFoundError is reported during a contract update, if no contract can be found in the program.
func (*ContractNotFoundError) Error ¶ added in v0.26.0
func (e *ContractNotFoundError) Error() string
func (*ContractNotFoundError) IsUserError ¶ added in v0.26.0
func (*ContractNotFoundError) IsUserError()
type ContractRemovalError ¶ added in v0.26.0
type ContractRemovalError struct {
interpreter.LocationRange
Name string
}
ContractRemovalError
func (*ContractRemovalError) Error ¶ added in v0.26.0
func (e *ContractRemovalError) Error() string
func (*ContractRemovalError) IsUserError ¶ added in v0.26.0
func (*ContractRemovalError) IsUserError()
type ContractUpdateError ¶ added in v0.26.0
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 ¶ added in v0.26.0
func (e *ContractUpdateError) ChildErrors() []error
func (*ContractUpdateError) Error ¶ added in v0.26.0
func (e *ContractUpdateError) Error() string
func (*ContractUpdateError) ImportLocation ¶ added in v0.26.0
func (e *ContractUpdateError) ImportLocation() common.Location
func (*ContractUpdateError) IsUserError ¶ added in v0.26.0
func (*ContractUpdateError) IsUserError()
func (*ContractUpdateError) Unwrap ¶ added in v0.42.8
func (e *ContractUpdateError) Unwrap() []error
type ContractUpdateValidator ¶ added in v0.26.0
type ContractUpdateValidator struct {
*TypeComparator
// contains filtered or unexported fields
}
func NewContractUpdateValidator ¶ added in v0.26.0
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) Validate ¶ added in v0.26.0
func (validator *ContractUpdateValidator) Validate() error
Validate validates the contract update, and returns an error if it is an invalid update.
func (*ContractUpdateValidator) WithTypeRemovalEnabled ¶ added in v1.0.0
func (validator *ContractUpdateValidator) WithTypeRemovalEnabled(enabled bool) UpdateValidator
type CurrentBlockProvider ¶ added in v0.26.0
type CurrentBlockProvider interface {
BlockAtHeightProvider
// GetCurrentBlockHeight returns the current block height.
GetCurrentBlockHeight() (uint64, error)
}
type DeployedContractConstructorInvocation ¶ added in v0.26.0
type DeployedContractConstructorInvocation struct {
ContractType *sema.CompositeType
ConstructorArguments []interpreter.Value
ArgumentTypes []sema.Type
ParameterTypes []sema.Type
Address common.Address
}
type EnumCaseMismatchError ¶ added in v0.26.0
EnumCaseMismatchError is reported during an enum update, when an updated enum case does not match the existing enum case.
func (*EnumCaseMismatchError) Error ¶ added in v0.26.0
func (e *EnumCaseMismatchError) Error() string
func (*EnumCaseMismatchError) IsUserError ¶ added in v0.26.0
func (*EnumCaseMismatchError) IsUserError()
type EventEmitter ¶ added in v0.26.0
type EventEmitter interface {
EmitEvent(
inter *interpreter.Interpreter,
locationRange interpreter.LocationRange,
eventType *sema.CompositeType,
values []interpreter.Value,
)
}
type ExtraneousFieldError ¶ added in v0.26.0
ExtraneousFieldError is reported during a contract update, when an updated composite declaration has more fields than the existing declaration.
func (*ExtraneousFieldError) Error ¶ added in v0.26.0
func (e *ExtraneousFieldError) Error() string
func (*ExtraneousFieldError) IsUserError ¶ added in v0.26.0
func (*ExtraneousFieldError) IsUserError()
type FieldMismatchError ¶ added in v0.26.0
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 ¶ added in v0.26.0
func (e *FieldMismatchError) Error() string
func (*FieldMismatchError) IsUserError ¶ added in v0.26.0
func (*FieldMismatchError) IsUserError()
func (*FieldMismatchError) SecondaryError ¶ added in v0.26.0
func (e *FieldMismatchError) SecondaryError() string
type FlowLocation ¶ added in v0.5.0
type FlowLocation struct{}
func (FlowLocation) Description ¶ added in v0.25.0
func (l FlowLocation) Description() string
func (FlowLocation) ID ¶ added in v0.5.0
func (l FlowLocation) ID() string
func (FlowLocation) MarshalJSON ¶ added in v0.12.0
func (l FlowLocation) MarshalJSON() ([]byte, error)
func (FlowLocation) QualifiedIdentifier ¶ added in v0.10.2
func (l FlowLocation) QualifiedIdentifier(typeID common.TypeID) string
func (FlowLocation) String ¶ added in v0.12.0
func (l FlowLocation) String() string
func (FlowLocation) TypeID ¶ added in v0.10.2
func (l FlowLocation) TypeID(memoryGauge common.MemoryGauge, qualifiedIdentifier string) common.TypeID
type InvalidContractArgumentError ¶ added in v0.30.0
func (*InvalidContractArgumentError) Error ¶ added in v0.30.0
func (e *InvalidContractArgumentError) Error() string
func (*InvalidContractArgumentError) IsUserError ¶ added in v0.30.0
func (*InvalidContractArgumentError) IsUserError()
type InvalidContractDeploymentError ¶ added in v0.26.0
type InvalidContractDeploymentError struct {
Err error
interpreter.LocationRange
}
InvalidContractDeploymentError
func (*InvalidContractDeploymentError) ChildErrors ¶ added in v0.26.0
func (e *InvalidContractDeploymentError) ChildErrors() []error
func (*InvalidContractDeploymentError) Error ¶ added in v0.26.0
func (e *InvalidContractDeploymentError) Error() string
func (*InvalidContractDeploymentError) IsUserError ¶ added in v0.26.0
func (*InvalidContractDeploymentError) IsUserError()
func (*InvalidContractDeploymentError) Unwrap ¶ added in v0.26.0
func (e *InvalidContractDeploymentError) Unwrap() error
type InvalidContractDeploymentOriginError ¶ added in v0.26.0
type InvalidContractDeploymentOriginError struct {
interpreter.LocationRange
}
InvalidContractDeploymentOriginError
func (*InvalidContractDeploymentOriginError) Error ¶ added in v0.26.0
func (*InvalidContractDeploymentOriginError) Error() string
func (*InvalidContractDeploymentOriginError) IsUserError ¶ added in v0.26.0
func (*InvalidContractDeploymentOriginError) IsUserError()
type InvalidDeclarationKindChangeError ¶ added in v0.26.0
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 ¶ added in v0.26.0
func (e *InvalidDeclarationKindChangeError) Error() string
func (*InvalidDeclarationKindChangeError) IsUserError ¶ added in v0.26.0
func (*InvalidDeclarationKindChangeError) IsUserError()
type InvalidTypeRemovalPragmaError ¶ added in v1.0.0
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 ¶ added in v1.0.0
func (e *InvalidTypeRemovalPragmaError) Error() string
func (*InvalidTypeRemovalPragmaError) IsUserError ¶ added in v1.0.0
func (*InvalidTypeRemovalPragmaError) IsUserError()
type Logger ¶ added in v0.26.0
type Logger interface {
// ProgramLog logs program logs.
ProgramLog(message string, locationRange interpreter.LocationRange) error
}
type MissingDeclarationError ¶ added in v0.26.0
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 ¶ added in v0.26.0
func (e *MissingDeclarationError) Error() string
func (*MissingDeclarationError) IsUserError ¶ added in v0.26.0
func (*MissingDeclarationError) IsUserError()
type MissingEnumCasesError ¶ added in v0.26.0
MissingEnumCasesError is reported during an enum update, if any enum cases are removed from an existing enum.
func (*MissingEnumCasesError) Error ¶ added in v0.26.0
func (e *MissingEnumCasesError) Error() string
func (*MissingEnumCasesError) IsUserError ¶ added in v0.26.0
func (*MissingEnumCasesError) IsUserError()
type NameMismatchError ¶ added in v1.0.0
NameMismatchError is reported during a contract update, when an a composite declaration has a different name than the existing declaration.
func (*NameMismatchError) Error ¶ added in v1.0.0
func (e *NameMismatchError) Error() string
func (*NameMismatchError) IsUserError ¶ added in v1.0.0
func (*NameMismatchError) IsUserError()
type OldProgramError ¶ added in v1.0.0
func (*OldProgramError) ChildErrors ¶ added in v1.0.0
func (e *OldProgramError) ChildErrors() []error
func (*OldProgramError) Error ¶ added in v1.0.0
func (e *OldProgramError) Error() string
func (*OldProgramError) ImportLocation ¶ added in v1.0.0
func (e *OldProgramError) ImportLocation() common.Location
func (*OldProgramError) IsUserError ¶ added in v1.0.0
func (e *OldProgramError) IsUserError()
func (*OldProgramError) Unwrap ¶ added in v1.0.0
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 ¶ added in v0.25.0
func (PanicError) IsUserError()
type PublicKey ¶ added in v0.26.0
type PublicKey struct {
PublicKey []byte
SignAlgo sema.SignatureAlgorithm
}
func NewPublicKeyFromValue ¶ added in v0.26.0
func NewPublicKeyFromValue( inter *interpreter.Interpreter, locationRange interpreter.LocationRange, publicKey interpreter.MemberAccessibleValue, ) ( *PublicKey, error, )
type PublicKeyFunctionsHandler ¶ added in v1.0.0
type PublicKeyFunctionsHandler interface {
PublicKeySignatureVerifier
BLSPoPVerifier
}
type PublicKeySignatureVerifier ¶ added in v0.30.0
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 ¶ added in v0.30.0
type RLPDecodeListError ¶ added in v0.23.0
type RLPDecodeListError struct {
interpreter.LocationRange
Msg string
}
func (RLPDecodeListError) Error ¶ added in v0.23.0
func (e RLPDecodeListError) Error() string
func (RLPDecodeListError) IsUserError ¶ added in v0.25.0
func (RLPDecodeListError) IsUserError()
type RLPDecodeStringError ¶ added in v0.23.0
type RLPDecodeStringError struct {
interpreter.LocationRange
Msg string
}
func (RLPDecodeStringError) Error ¶ added in v0.23.0
func (e RLPDecodeStringError) Error() string
func (RLPDecodeStringError) IsUserError ¶ added in v0.25.0
func (RLPDecodeStringError) IsUserError()
type RandomGenerator ¶ added in v0.42.3
type ScriptResult ¶ added in v0.27.0
type ScriptResult struct {
Value interpreter.Value
Error error
}
type StandardLibraryHandler ¶ added in v0.27.0
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 ¶ added in v0.12.0
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 DefaultScriptStandardLibraryValues ¶ added in v0.27.0
func DefaultScriptStandardLibraryValues(handler StandardLibraryHandler) []StandardLibraryValue
func DefaultStandardLibraryValues ¶ added in v0.27.0
func DefaultStandardLibraryValues(handler StandardLibraryHandler) []StandardLibraryValue
func NewAccountConstructor ¶ added in v1.0.0
func NewAccountConstructor(creator AccountCreator) StandardLibraryValue
func NewBLSContract ¶ added in v0.30.0
func NewBLSContract( gauge common.MemoryGauge, handler BLSContractHandler, ) StandardLibraryValue
func NewGetAccountFunction ¶ added in v0.26.0
func NewGetAccountFunction(handler AccountHandler) StandardLibraryValue
func NewGetAuthAccountFunction ¶ added in v0.26.0
func NewGetAuthAccountFunction(handler AccountHandler) StandardLibraryValue
func NewGetBlockFunction ¶ added in v0.26.0
func NewGetBlockFunction(provider BlockAtHeightProvider) StandardLibraryValue
func NewGetCurrentBlockFunction ¶ added in v0.26.0
func NewGetCurrentBlockFunction(provider CurrentBlockProvider) StandardLibraryValue
func NewHashAlgorithmConstructor ¶ added in v0.30.0
func NewHashAlgorithmConstructor(hasher Hasher) StandardLibraryValue
func NewLogFunction ¶ added in v0.26.0
func NewLogFunction(logger Logger) StandardLibraryValue
func NewPublicKeyConstructor ¶ added in v0.30.0
func NewPublicKeyConstructor( publicKeyValidator PublicKeyValidator, ) StandardLibraryValue
func NewRevertibleRandomFunction ¶ added in v0.42.3
func NewRevertibleRandomFunction(generator RandomGenerator) StandardLibraryValue
func NewStandardLibraryStaticFunction ¶ added in v1.0.0
func NewStandardLibraryStaticFunction( name string, functionType *sema.FunctionType, docString string, function interpreter.HostFunction, ) StandardLibraryValue
NewStandardLibraryStaticFunction should only be used for creating static functions.
func (StandardLibraryValue) ValueDeclarationArgumentLabels ¶
func (v StandardLibraryValue) ValueDeclarationArgumentLabels() []string
func (StandardLibraryValue) ValueDeclarationDocString ¶ added in v0.17.0
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 ¶ added in v0.12.0
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 ¶ added in v0.12.0
func (v StandardLibraryValue) ValueDeclarationValue() interpreter.Value
type StorageCapacityProvider ¶ added in v0.26.0
type StorageCapacityProvider interface {
StorageCommitter
// GetStorageCapacity gets storage capacity in bytes on the address.
GetStorageCapacity(address common.Address) (uint64, error)
}
type StorageCommitter ¶ added in v0.42.4
type StorageCommitter interface {
CommitStorageTemporarily(inter *interpreter.Interpreter) error
}
type StorageUsedProvider ¶ added in v0.26.0
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 ¶ added in v0.39.0
type TestContractType struct {
Checker *sema.Checker
CompositeType *sema.CompositeType
InitializerTypes []sema.Type
// contains filtered or unexported fields
}
func GetTestContractType ¶ added in v0.39.0
func GetTestContractType() *TestContractType
func (*TestContractType) NewTestContract ¶ added in v0.39.0
func (t *TestContractType) NewTestContract( inter *interpreter.Interpreter, testFramework TestFramework, constructor interpreter.FunctionValue, invocationRange ast.Range, ) ( *interpreter.CompositeValue, error, )
type TestFailedError ¶ added in v0.27.0
type TestFailedError struct {
Err error
}
func (TestFailedError) Error ¶ added in v0.27.0
func (e TestFailedError) Error() string
func (TestFailedError) IsUserError ¶ added in v0.27.0
func (TestFailedError) IsUserError()
func (TestFailedError) Unwrap ¶ added in v0.27.0
func (e TestFailedError) Unwrap() error
type TestFramework ¶ added in v0.27.0
type TestFramework interface {
EmulatorBackend() Blockchain
ReadFile(string) (string, error)
}
type TransactionResult ¶ added in v0.27.0
type TransactionResult struct {
Error error
}
type TypeComparator ¶ added in v0.26.0
type TypeComparator struct {
RootDeclIdentifier *ast.Identifier
// contains filtered or unexported fields
}
func (*TypeComparator) CheckConstantSizedTypeEquality ¶ added in v0.26.0
func (c *TypeComparator) CheckConstantSizedTypeEquality(expected *ast.ConstantSizedType, found ast.Type) error
func (*TypeComparator) CheckDictionaryTypeEquality ¶ added in v0.26.0
func (c *TypeComparator) CheckDictionaryTypeEquality(expected *ast.DictionaryType, found ast.Type) error
func (*TypeComparator) CheckFunctionTypeEquality ¶ added in v0.26.0
func (c *TypeComparator) CheckFunctionTypeEquality(expected *ast.FunctionType, found ast.Type) error
func (*TypeComparator) CheckInstantiationTypeEquality ¶ added in v0.26.0
func (c *TypeComparator) CheckInstantiationTypeEquality(expected *ast.InstantiationType, found ast.Type) error
func (*TypeComparator) CheckIntersectionTypeEquality ¶ added in v1.0.0
func (c *TypeComparator) CheckIntersectionTypeEquality(expected *ast.IntersectionType, found ast.Type) error
func (*TypeComparator) CheckNominalTypeEquality ¶ added in v0.26.0
func (c *TypeComparator) CheckNominalTypeEquality(expected *ast.NominalType, found ast.Type) error
func (*TypeComparator) CheckOptionalTypeEquality ¶ added in v0.26.0
func (c *TypeComparator) CheckOptionalTypeEquality(expected *ast.OptionalType, found ast.Type) error
func (*TypeComparator) CheckReferenceTypeEquality ¶ added in v0.26.0
func (c *TypeComparator) CheckReferenceTypeEquality(expected *ast.ReferenceType, found ast.Type) error
func (*TypeComparator) CheckVariableSizedTypeEquality ¶ added in v0.26.0
func (c *TypeComparator) CheckVariableSizedTypeEquality(expected *ast.VariableSizedType, found ast.Type) error
type TypeMismatchError ¶ added in v0.26.0
TypeMismatchError is reported during a contract update, when a type of the new program does not match the existing type.
func (*TypeMismatchError) Error ¶ added in v0.26.0
func (e *TypeMismatchError) Error() string
func (*TypeMismatchError) IsUserError ¶ added in v0.26.0
func (*TypeMismatchError) IsUserError()
type TypeRemovalPragmaRemovalError ¶ added in v1.0.0
type TypeRemovalPragmaRemovalError struct {
RemovedType string
}
TypeRemovalPragmaRemovalError is reported during a contract update if a #removedType pragma is removed
func (*TypeRemovalPragmaRemovalError) Error ¶ added in v1.0.0
func (e *TypeRemovalPragmaRemovalError) Error() string
func (*TypeRemovalPragmaRemovalError) IsUserError ¶ added in v1.0.0
func (*TypeRemovalPragmaRemovalError) IsUserError()
type UnrepresentableEntitlementsUpgrade ¶ added in v1.0.0
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 ¶ added in v1.0.0
func (e *UnrepresentableEntitlementsUpgrade) Error() string
func (*UnrepresentableEntitlementsUpgrade) IsUserError ¶ added in v1.0.0
func (*UnrepresentableEntitlementsUpgrade) IsUserError()
func (*UnrepresentableEntitlementsUpgrade) SecondaryError ¶ added in v1.0.0
func (e *UnrepresentableEntitlementsUpgrade) SecondaryError() string
type UpdateValidator ¶ added in v1.0.0
type UpdateValidator interface {
ast.TypeEqualityChecker
Validate() error
WithTypeRemovalEnabled(enabled bool) UpdateValidator
// contains filtered or unexported methods
}
type UseOfRemovedTypeError ¶ added in v1.0.0
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 ¶ added in v1.0.0
func (e *UseOfRemovedTypeError) Error() string
func (*UseOfRemovedTypeError) IsUserError ¶ added in v1.0.0
func (*UseOfRemovedTypeError) IsUserError()
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