Documentation ¶
Index ¶
- Constants
- Variables
- func CodeToHashValue(inter *interpreter.Interpreter, code []byte) *interpreter.ArrayValue
- func NewAccountKeyValue(inter *interpreter.Interpreter, ...) interpreter.Value
- func NewAuthAccountValue(gauge common.MemoryGauge, handler AuthAccountHandler, ...) interpreter.Value
- func NewBlockValue(inter *interpreter.Interpreter, ...) interpreter.Value
- func NewCryptoContract(inter *interpreter.Interpreter, constructor interpreter.FunctionValue, ...) (*interpreter.CompositeValue, error)
- func NewHashAlgorithmCase(rawValue interpreter.UInt8Value) interpreter.MemberAccessibleValue
- func NewHashAlgorithmFromValue(inter *interpreter.Interpreter, ...) sema.HashAlgorithm
- func NewPublicAccountValue(gauge common.MemoryGauge, handler PublicAccountHandler, ...) interpreter.Value
- func NewPublicKeyValue(inter *interpreter.Interpreter, ...) *interpreter.CompositeValue
- func NewSignatureAlgorithmCase(rawValue interpreter.UInt8Value) interpreter.MemberAccessibleValue
- type AccountContractAdditionHandler
- type AccountContractNamesProvider
- type AccountContractProvider
- type AccountContractRemovalHandler
- type AccountCreator
- type AccountEncodedKeyAdditionHandler
- type AccountEncodedKeyRevocationHandler
- type AccountKey
- type AccountKeyAdditionHandler
- type AccountKeyProvider
- type AccountKeyRevocationHandler
- type AssertionError
- type AuthAccountContractsHandler
- type AuthAccountHandler
- type AuthAccountKeysHandler
- type AvailableBalanceProvider
- type BalanceProvider
- type Block
- type BlockAtHeightProvider
- type BlockHash
- 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() common.LocationID
- func (l FlowLocation) MarshalJSON() ([]byte, error)
- func (l FlowLocation) MeteredID(_ common.MemoryGauge) common.LocationID
- 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 InvalidContractDeploymentError
- type InvalidContractDeploymentOriginError
- type InvalidDeclarationKindChangeError
- type Logger
- type MissingDeclarationError
- type MissingEnumCasesError
- type PanicError
- type PublicAccountContractsHandler
- type PublicAccountHandler
- type PublicAccountKeysHandler
- type PublicKey
- type RLPDecodeListError
- type RLPDecodeStringError
- type StandardLibraryType
- type StandardLibraryValue
- func NewAuthAccountConstructor(creator AccountCreator) StandardLibraryValue
- func NewGetAccountFunction(handler PublicAccountHandler) StandardLibraryValue
- func NewGetAuthAccountFunction(handler AuthAccountHandler) StandardLibraryValue
- func NewGetBlockFunction(provider BlockAtHeightProvider) StandardLibraryValue
- func NewGetCurrentBlockFunction(provider CurrentBlockProvider) StandardLibraryValue
- func NewLogFunction(logger Logger) StandardLibraryValue
- func NewStandardLibraryFunction(name string, functionType *sema.FunctionType, docString string, ...) StandardLibraryValue
- func NewUnsafeRandomFunction(generator UnsafeRandomGenerator) 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 (StandardLibraryValue) ValueDeclarationPosition() *ast.Position
- func (v StandardLibraryValue) ValueDeclarationType() sema.Type
- func (v StandardLibraryValue) ValueDeclarationValue() interpreter.Value
- type StorageCapacityProvider
- type StorageUsedProvider
- 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) 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) CheckRestrictedTypeEquality(expected *ast.RestrictedType, found ast.Type) error
- func (c *TypeComparator) CheckVariableSizedTypeEquality(expected *ast.VariableSizedType, found ast.Type) error
- type TypeMismatchError
- type UnsafeRandomGenerator
Constants ¶
const BlockHashLength = 32
const FlowLocationPrefix = "flow"
const HashSize = 32
Variables ¶
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.NewTypeAnnotation(&sema.AddressType{}), }
var AccountEventCodeHashParameter = &sema.Parameter{ Identifier: "codeHash", TypeAnnotation: sema.NewTypeAnnotation(HashType), }
var AccountEventContractParameter = &sema.Parameter{ Identifier: "contract", TypeAnnotation: sema.NewTypeAnnotation(sema.StringType), }
var AccountEventPublicKeyParameter = &sema.Parameter{ Identifier: "publicKey", TypeAnnotation: sema.NewTypeAnnotation( sema.ByteArrayType, ), }
var AccountKeyAddedEventType = newFlowEventType( "AccountKeyAdded", AccountEventAddressParameter, AccountEventPublicKeyParameter, )
var AccountKeyRemovedEventType = newFlowEventType( "AccountKeyRemoved", AccountEventAddressParameter, AccountEventPublicKeyParameter, )
var AssertFunction = NewStandardLibraryFunction( "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.GetLocationRange(), }) } return interpreter.VoidValue{} }, )
var BLSContract = StandardLibraryValue{ Name: "BLS", Type: blsContractType, Value: blsContractValue, Kind: common.DeclarationKindContract, }
var BlockIDStaticType = interpreter.ConstantSizedStaticType{ Type: interpreter.PrimitiveStaticTypeUInt8, Size: 32, }
var BuiltinValues = []StandardLibraryValue{ AssertFunction, PanicFunction, SignatureAlgorithmConstructor, RLPContract, PublicKeyConstructor, HashAlgorithmConstructor, BLSContract, }
var CryptoChecker = func() *sema.Checker { program, err := parser.ParseProgram(contracts.Crypto, nil) if err != nil { panic(err) } location := common.IdentifierLocation("Crypto") var checker *sema.Checker checker, err = sema.NewChecker( program, location, nil, &sema.Config{ AccessCheckMode: sema.AccessCheckModeStrict, }, ) if err != nil { panic(err) } err = checker.Check() if err != nil { panic(err) } return checker }()
var HashAlgorithmConstructor = StandardLibraryValue{ Name: sema.HashAlgorithmTypeName, Type: cryptoAlgorithmEnumConstructorType( sema.HashAlgorithmType, sema.HashAlgorithms, ), Value: hashAlgorithmConstructorValue, Kind: common.DeclarationKindEnum, }
var HashType = &sema.ConstantSizedType{ Size: HashSize, Type: sema.UInt8Type, }
var LogFunctionType = &sema.FunctionType{ Parameters: []*sema.Parameter{ { Label: sema.ArgumentLabelNotRequired, Identifier: "value", TypeAnnotation: sema.NewTypeAnnotation( sema.AnyStructType, ), }, }, ReturnTypeAnnotation: sema.NewTypeAnnotation( sema.VoidType, ), }
var PanicFunction = NewStandardLibraryFunction( "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.GetLocationRange(), }) }, )
var PublicKeyConstructor = NewStandardLibraryFunction( sema.PublicKeyTypeName, publicKeyConstructorFunctionType, publicKeyConstructorFunctionDocString, func(invocation interpreter.Invocation) interpreter.Value { publicKey, ok := invocation.Arguments[0].(*interpreter.ArrayValue) if !ok { panic(errors.NewUnreachableError()) } signAlgo, ok := invocation.Arguments[1].(*interpreter.SimpleCompositeValue) if !ok { panic(errors.NewUnreachableError()) } inter := invocation.Interpreter return interpreter.NewPublicKeyValue( inter, invocation.GetLocationRange, publicKey, signAlgo, inter.Config.PublicKeyValidationHandler, ) }, )
var RLPContract = StandardLibraryValue{ Name: "RLP", Type: rlpContractType, Value: rlpContractValue, Kind: common.DeclarationKindContract, }
var SignatureAlgorithmConstructor = StandardLibraryValue{ Name: sema.SignatureAlgorithmTypeName, Type: cryptoAlgorithmEnumConstructorType( sema.SignatureAlgorithmType, sema.SignatureAlgorithms, ), Value: signatureAlgorithmConstructorValue, Kind: common.DeclarationKindEnum, }
var _, HashAlgorithmCaseValues = cryptoAlgorithmEnumValueAndCaseValues(
sema.HashAlgorithmType,
sema.HashAlgorithms,
NewHashAlgorithmCase,
)
var _, SignatureAlgorithmCaseValues = cryptoAlgorithmEnumValueAndCaseValues(
sema.SignatureAlgorithmType,
sema.SignatureAlgorithms,
NewSignatureAlgorithmCase,
)
Functions ¶
func CodeToHashValue ¶ added in v0.26.0
func CodeToHashValue(inter *interpreter.Interpreter, code []byte) *interpreter.ArrayValue
func NewAccountKeyValue ¶ added in v0.26.0
func NewAccountKeyValue( inter *interpreter.Interpreter, getLocationRange func() interpreter.LocationRange, accountKey *AccountKey, validatePublicKey interpreter.PublicKeyValidationHandlerFunc, ) interpreter.Value
func NewAuthAccountValue ¶ added in v0.26.0
func NewAuthAccountValue( gauge common.MemoryGauge, handler AuthAccountHandler, addressValue interpreter.AddressValue, ) interpreter.Value
func NewBlockValue ¶ added in v0.26.0
func NewBlockValue( inter *interpreter.Interpreter, getLocationRange func() 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) interpreter.MemberAccessibleValue
func NewHashAlgorithmFromValue ¶ added in v0.26.0
func NewHashAlgorithmFromValue( inter *interpreter.Interpreter, getLocationRange func() interpreter.LocationRange, value interpreter.Value, ) sema.HashAlgorithm
func NewPublicAccountValue ¶ added in v0.26.0
func NewPublicAccountValue( gauge common.MemoryGauge, handler PublicAccountHandler, addressValue interpreter.AddressValue, ) interpreter.Value
func NewPublicKeyValue ¶ added in v0.26.0
func NewPublicKeyValue( inter *interpreter.Interpreter, getLocationRange func() interpreter.LocationRange, publicKey *PublicKey, validatePublicKey interpreter.PublicKeyValidationHandlerFunc, ) *interpreter.CompositeValue
func NewSignatureAlgorithmCase ¶ added in v0.18.0
func NewSignatureAlgorithmCase(rawValue interpreter.UInt8Value) interpreter.MemberAccessibleValue
Types ¶
type AccountContractAdditionHandler ¶ added in v0.26.0
type AccountContractAdditionHandler interface { EventEmitter AccountContractProvider ParseAndCheckProgram( code []byte, location common.Location, program bool, ) (*interpreter.Program, error) // UpdateAccountContractCode updates the code associated with an account contract. UpdateAccountContractCode(address common.Address, name string, code []byte) error RecordContractUpdate(address common.Address, name string, value *interpreter.CompositeValue) InterpretContract( location common.AddressLocation, program *interpreter.Program, name string, invocation DeployedContractConstructorInvocation, ) ( *interpreter.CompositeValue, error, ) TemporarilyRecordCode(location common.AddressLocation, code []byte) }
type AccountContractNamesProvider ¶ added in v0.26.0
type AccountContractProvider ¶ added in v0.26.0
type AccountContractRemovalHandler ¶ added in v0.26.0
type AccountContractRemovalHandler interface { EventEmitter AccountContractProvider RemoveAccountContractCode(address common.Address, name string) error RecordContractRemoval(address common.Address, name string) }
type AccountCreator ¶ added in v0.26.0
type AccountCreator interface { EventEmitter AuthAccountHandler // CreateAccount creates a new account. CreateAccount(payer common.Address) (address common.Address, err error) }
type AccountEncodedKeyAdditionHandler ¶ added in v0.26.0
type AccountEncodedKeyAdditionHandler interface { EventEmitter // AddEncodedAccountKey appends an encoded key to an account. AddEncodedAccountKey(address common.Address, key []byte) error }
type AccountEncodedKeyRevocationHandler ¶ added in v0.26.0
type AccountKey ¶ added in v0.26.0
type AccountKeyAdditionHandler ¶ added in v0.26.0
type AccountKeyAdditionHandler interface { EventEmitter // 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 { // GetAccountKey retrieves a key from an account by index. GetAccountKey(address common.Address, index int) (*AccountKey, error) }
type AccountKeyRevocationHandler ¶ added in v0.26.0
type AccountKeyRevocationHandler interface { EventEmitter // RevokeAccountKey removes a key from an account by index. RevokeAccountKey(address common.Address, index int) (*AccountKey, error) }
type AssertionError ¶
type AssertionError struct { Message string interpreter.LocationRange }
func (AssertionError) Error ¶
func (e AssertionError) Error() string
func (AssertionError) IsUserError ¶ added in v0.25.0
func (AssertionError) IsUserError()
type AuthAccountContractsHandler ¶ added in v0.26.0
type AuthAccountContractsHandler interface { AccountContractProvider AccountContractAdditionHandler AccountContractRemovalHandler AccountContractNamesProvider }
type AuthAccountHandler ¶ added in v0.26.0
type AuthAccountKeysHandler ¶ added in v0.26.0
type AuthAccountKeysHandler interface { AccountKeyProvider AccountKeyAdditionHandler AccountKeyRevocationHandler }
type AvailableBalanceProvider ¶ added in v0.26.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 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 { Name string interpreter.LocationRange }
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()
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, 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.
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 { Address common.Address ContractType *sema.CompositeType ConstructorArguments []interpreter.Value ArgumentTypes []sema.Type ParameterTypes []sema.Type }
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, eventType *sema.CompositeType, values []interpreter.Value, getLocationRange func() interpreter.LocationRange, ) }
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() common.LocationID
func (FlowLocation) MarshalJSON ¶ added in v0.12.0
func (l FlowLocation) MarshalJSON() ([]byte, error)
func (FlowLocation) MeteredID ¶ added in v0.24.0
func (l FlowLocation) MeteredID(_ common.MemoryGauge) common.LocationID
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 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 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 PanicError ¶
type PanicError struct { Message string interpreter.LocationRange }
func (PanicError) Error ¶
func (e PanicError) Error() string
func (PanicError) IsUserError ¶ added in v0.25.0
func (PanicError) IsUserError()
type PublicAccountContractsHandler ¶ added in v0.26.0
type PublicAccountContractsHandler interface { AccountContractNamesProvider AccountContractProvider }
type PublicAccountHandler ¶ added in v0.26.0
type PublicAccountHandler interface { BalanceProvider AvailableBalanceProvider StorageUsedProvider StorageCapacityProvider PublicAccountKeysHandler PublicAccountContractsHandler }
type PublicAccountKeysHandler ¶ added in v0.26.0
type PublicAccountKeysHandler interface { AccountKeyProvider }
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, getLocationRange func() interpreter.LocationRange, publicKey interpreter.MemberAccessibleValue, ) ( *PublicKey, error, )
type RLPDecodeListError ¶ added in v0.23.0
type RLPDecodeListError struct { Msg string interpreter.LocationRange }
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 { Msg string interpreter.LocationRange }
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 StandardLibraryType ¶
type StandardLibraryType struct { Name string Type sema.Type 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 { Name string Type sema.Type DocString string Value interpreter.Value Kind common.DeclarationKind ArgumentLabels []string }
func NewAuthAccountConstructor ¶ added in v0.26.0
func NewAuthAccountConstructor(creator AccountCreator) StandardLibraryValue
func NewGetAccountFunction ¶ added in v0.26.0
func NewGetAccountFunction(handler PublicAccountHandler) StandardLibraryValue
func NewGetAuthAccountFunction ¶ added in v0.26.0
func NewGetAuthAccountFunction(handler AuthAccountHandler) 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 NewLogFunction ¶ added in v0.26.0
func NewLogFunction(logger Logger) StandardLibraryValue
func NewStandardLibraryFunction ¶
func NewStandardLibraryFunction( name string, functionType *sema.FunctionType, docString string, function interpreter.HostFunction, ) StandardLibraryValue
func NewUnsafeRandomFunction ¶ added in v0.26.0
func NewUnsafeRandomFunction(generator UnsafeRandomGenerator) StandardLibraryValue
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 (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 { CommitStorageTemporarily(inter *interpreter.Interpreter) error // GetStorageCapacity gets storage capacity in bytes on the address. GetStorageCapacity(address common.Address) (uint64, error) }
type StorageUsedProvider ¶ added in v0.26.0
type StorageUsedProvider interface { CommitStorageTemporarily(inter *interpreter.Interpreter) error // GetStorageUsed gets storage used in bytes by the address at the moment of the function call. GetStorageUsed(address common.Address) (uint64, error) }
type TypeComparator ¶ added in v0.26.0
type TypeComparator struct {
RootDeclIdentifier *ast.Identifier
}
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) 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) CheckRestrictedTypeEquality ¶ added in v0.26.0
func (c *TypeComparator) CheckRestrictedTypeEquality(expected *ast.RestrictedType, 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()