Documentation
¶
Index ¶
- Constants
- Variables
- func AddCDCExtension(name string) string
- func AddToGitIgnore(filename string, loader flowkit.ReaderWriter) error
- func CheckNetwork(network config.Network) error
- func CreateTabWriter(b *bytes.Buffer) *tabwriter.Writer
- func Exit(code int, msg string)
- func GetAccountByContractName(state *flowkit.State, contractName string, network config.Network) (*accounts.Account, error)
- func GetAddressByContractName(state *flowkit.State, contractName string, network config.Network) (flow.Address, error)
- func GetAddressNetwork(address flowsdk.Address) (flowsdk.ChainID, error)
- func MessageWithEmojiPrefix(emoji string, message string) string
- func NormalizeLineEndings(s string) string
- func Pluralize(word string, count int) string
- func PrintEmoji(emoji string) string
- func StripCDCExtension(name string) string
- func TestMocks(t *testing.T) (*mocks.MockServices, *flowkit.State, flowkit.ReaderWriter)
- func ValidateECDSAP256Pub(key string) error
- type CheckerEnvironment
- func (CheckerEnvironment) AccountKeysCount(_ common.Address) (uint32, error)
- func (CheckerEnvironment) AddAccountKey(_ common.Address, _ *stdlib.PublicKey, _ sema.HashAlgorithm, _ int) (*stdlib.AccountKey, error)
- func (CheckerEnvironment) AddEncodedAccountKey(_ common.Address, _ []byte) error
- func (CheckerEnvironment) BLSAggregatePublicKeys(_ []*stdlib.PublicKey) (*stdlib.PublicKey, error)
- func (CheckerEnvironment) BLSAggregateSignatures(_ [][]byte) ([]byte, error)
- func (CheckerEnvironment) BLSVerifyPOP(_ *stdlib.PublicKey, _ []byte) (bool, error)
- func (e CheckerEnvironment) CommitStorage(inter *interpreter.Interpreter) error
- func (CheckerEnvironment) CommitStorageTemporarily(_ *interpreter.Interpreter) error
- func (e CheckerEnvironment) Configure(runtimeInterface runtime.Interface, codesAndPrograms runtime.CodesAndPrograms, ...)
- func (CheckerEnvironment) ContractUpdateRecorded(_ common.AddressLocation) bool
- func (CheckerEnvironment) CreateAccount(_ common.Address) (address common.Address, err error)
- func (e CheckerEnvironment) DeclareType(typeDeclaration stdlib.StandardLibraryType, location common.Location)
- func (e CheckerEnvironment) DeclareValue(valueDeclaration stdlib.StandardLibraryValue, location common.Location)
- func (e CheckerEnvironment) DecodeArgument(argument []byte, argumentType cadence.Type) (cadence.Value, error)
- func (CheckerEnvironment) EmitEvent(_ *interpreter.Interpreter, _ interpreter.LocationRange, _ *sema.CompositeType, ...)
- func (CheckerEnvironment) EndContractAddition(_ common.AddressLocation)
- func (e CheckerEnvironment) GenerateAccountID(_ common.Address) (uint64, error)
- func (CheckerEnvironment) GetAccountAvailableBalance(_ common.Address) (uint64, error)
- func (CheckerEnvironment) GetAccountBalance(_ common.Address) (uint64, error)
- func (CheckerEnvironment) GetAccountContractCode(_ common.AddressLocation) ([]byte, error)
- func (CheckerEnvironment) GetAccountContractNames(_ common.Address) ([]string, error)
- func (CheckerEnvironment) GetAccountKey(_ common.Address, _ uint32) (*stdlib.AccountKey, error)
- func (e CheckerEnvironment) GetBaseTypeActivation(location common.Location) (baseTypeActivation *sema.VariableActivation)
- func (e CheckerEnvironment) GetBaseValueActivation(location common.Location) (baseValueActivation *sema.VariableActivation)
- func (CheckerEnvironment) GetBlockAtHeight(_ uint64) (stdlib.Block, bool, error)
- func (CheckerEnvironment) GetCurrentBlockHeight() (uint64, error)
- func (CheckerEnvironment) GetStorageCapacity(_ common.Address) (uint64, error)
- func (CheckerEnvironment) GetStorageUsed(_ common.Address) (uint64, error)
- func (CheckerEnvironment) Hash(_ []byte, _ string, _ sema.HashAlgorithm) ([]byte, error)
- func (e CheckerEnvironment) Interpret(location common.Location, program *interpreter.Program, ...) (interpreter.Value, *interpreter.Interpreter, error)
- func (CheckerEnvironment) InterpretContract(_ common.AddressLocation, _ *interpreter.Program, _ string, ...) (*interpreter.CompositeValue, error)
- func (CheckerEnvironment) IsContractBeingAdded(_ common.AddressLocation) bool
- func (e CheckerEnvironment) NewAccountValue(inter *interpreter.Interpreter, address interpreter.AddressValue) interpreter.Value
- func (CheckerEnvironment) ParseAndCheckProgram(_ []byte, _ common.Location, _ bool) (*interpreter.Program, error)
- func (CheckerEnvironment) ProgramLog(_ string, _ interpreter.LocationRange) error
- func (e CheckerEnvironment) ReadRandom(_ []byte) error
- func (CheckerEnvironment) RecordContractRemoval(_ common.AddressLocation)
- func (CheckerEnvironment) RecordContractUpdate(_ common.AddressLocation, _ *interpreter.CompositeValue)
- func (CheckerEnvironment) RemoveAccountContractCode(_ common.AddressLocation) error
- func (CheckerEnvironment) RevokeAccountKey(_ common.Address, _ uint32) (*stdlib.AccountKey, error)
- func (CheckerEnvironment) RevokeEncodedAccountKey(_ common.Address, _ int) ([]byte, error)
- func (CheckerEnvironment) SetCompositeValueFunctionsHandler(_ common.TypeID, _ stdlib.CompositeValueFunctionsHandler)
- func (e CheckerEnvironment) SetupFVM(chainId flow.ChainID)
- func (CheckerEnvironment) StartContractAddition(_ common.AddressLocation)
- func (CheckerEnvironment) TemporarilyRecordCode(_ common.AddressLocation, _ []byte)
- func (CheckerEnvironment) UnsafeRandom() (uint64, error)
- func (CheckerEnvironment) UpdateAccountContractCode(_ common.AddressLocation, _ []byte) error
- func (CheckerEnvironment) ValidatePublicKey(_ *stdlib.PublicKey) error
- func (CheckerEnvironment) VerifySignature(_ []byte, _ string, _ []byte, _ []byte, _ sema.SignatureAlgorithm, ...) (bool, error)
Constants ¶
View Source
const EnvPrefix = "FLOW"
Variables ¶
View Source
var NoLogger = output.NewStdoutLogger(output.NoneLog)
View Source
var TestID = flow.HexToID("24993fc99f81641c45c0afa307e683b4f08d407d90041aa9439f487acb33d633")
Functions ¶
func AddCDCExtension ¶ added in v1.20.0
func AddToGitIgnore ¶
AddToGitIgnore adds a new line to the .gitignore if one doesn't exist it creates it.
func CheckNetwork ¶
func GetAddressNetwork ¶
GetAddressNetwork returns the chain ID for an address.
func MessageWithEmojiPrefix ¶ added in v1.18.0
func NormalizeLineEndings ¶ added in v1.19.0
func PrintEmoji ¶ added in v1.18.0
func StripCDCExtension ¶ added in v1.20.0
func TestMocks ¶
func TestMocks(t *testing.T) (*mocks.MockServices, *flowkit.State, flowkit.ReaderWriter)
TestMocks creates mock flowkit services, an empty state and a mock reader writer
func ValidateECDSAP256Pub ¶
ValidateECDSAP256Pub attempt to decode the hex string representation of a ECDSA P256 public key
Types ¶
type CheckerEnvironment ¶
type CheckerEnvironment struct {
// contains filtered or unexported fields
}
func NewCheckerEnvironment ¶
func NewCheckerEnvironment() *CheckerEnvironment
func NewScriptCheckerEnvironment ¶
func NewScriptCheckerEnvironment() *CheckerEnvironment
func (CheckerEnvironment) AccountKeysCount ¶
func (CheckerEnvironment) AccountKeysCount(_ common.Address) (uint32, error)
func (CheckerEnvironment) AddAccountKey ¶
func (CheckerEnvironment) AddAccountKey( _ common.Address, _ *stdlib.PublicKey, _ sema.HashAlgorithm, _ int, ) ( *stdlib.AccountKey, error, )
func (CheckerEnvironment) AddEncodedAccountKey ¶
func (CheckerEnvironment) AddEncodedAccountKey(_ common.Address, _ []byte) error
func (CheckerEnvironment) BLSAggregatePublicKeys ¶
func (CheckerEnvironment) BLSAggregateSignatures ¶
func (CheckerEnvironment) BLSAggregateSignatures(_ [][]byte) ([]byte, error)
func (CheckerEnvironment) BLSVerifyPOP ¶
func (CheckerEnvironment) CommitStorage ¶
func (e CheckerEnvironment) CommitStorage(inter *interpreter.Interpreter) error
func (CheckerEnvironment) CommitStorageTemporarily ¶
func (CheckerEnvironment) CommitStorageTemporarily(_ *interpreter.Interpreter) error
func (CheckerEnvironment) Configure ¶
func (e CheckerEnvironment) Configure( runtimeInterface runtime.Interface, codesAndPrograms runtime.CodesAndPrograms, storage *runtime.Storage, coverageReport *runtime.CoverageReport, )
func (CheckerEnvironment) ContractUpdateRecorded ¶
func (CheckerEnvironment) ContractUpdateRecorded(_ common.AddressLocation) bool
func (CheckerEnvironment) CreateAccount ¶
func (CheckerEnvironment) DeclareType ¶
func (e CheckerEnvironment) DeclareType(typeDeclaration stdlib.StandardLibraryType, location common.Location)
func (CheckerEnvironment) DeclareValue ¶
func (e CheckerEnvironment) DeclareValue(valueDeclaration stdlib.StandardLibraryValue, location common.Location)
func (CheckerEnvironment) DecodeArgument ¶
func (CheckerEnvironment) EmitEvent ¶
func (CheckerEnvironment) EmitEvent( _ *interpreter.Interpreter, _ interpreter.LocationRange, _ *sema.CompositeType, _ []interpreter.Value, )
func (CheckerEnvironment) EndContractAddition ¶
func (CheckerEnvironment) EndContractAddition(_ common.AddressLocation)
func (CheckerEnvironment) GenerateAccountID ¶
func (e CheckerEnvironment) GenerateAccountID(_ common.Address) (uint64, error)
func (CheckerEnvironment) GetAccountAvailableBalance ¶
func (CheckerEnvironment) GetAccountAvailableBalance(_ common.Address) (uint64, error)
func (CheckerEnvironment) GetAccountBalance ¶
func (CheckerEnvironment) GetAccountBalance(_ common.Address) (uint64, error)
func (CheckerEnvironment) GetAccountContractCode ¶
func (CheckerEnvironment) GetAccountContractCode(_ common.AddressLocation) ([]byte, error)
func (CheckerEnvironment) GetAccountContractNames ¶
func (CheckerEnvironment) GetAccountContractNames(_ common.Address) ([]string, error)
func (CheckerEnvironment) GetAccountKey ¶
func (CheckerEnvironment) GetAccountKey(_ common.Address, _ uint32) (*stdlib.AccountKey, error)
func (CheckerEnvironment) GetBaseTypeActivation ¶
func (e CheckerEnvironment) GetBaseTypeActivation(location common.Location) (baseTypeActivation *sema.VariableActivation)
func (CheckerEnvironment) GetBaseValueActivation ¶
func (e CheckerEnvironment) GetBaseValueActivation(location common.Location) (baseValueActivation *sema.VariableActivation)
func (CheckerEnvironment) GetBlockAtHeight ¶
func (CheckerEnvironment) GetCurrentBlockHeight ¶
func (CheckerEnvironment) GetCurrentBlockHeight() (uint64, error)
func (CheckerEnvironment) GetStorageCapacity ¶
func (CheckerEnvironment) GetStorageCapacity(_ common.Address) (uint64, error)
func (CheckerEnvironment) GetStorageUsed ¶
func (CheckerEnvironment) GetStorageUsed(_ common.Address) (uint64, error)
func (CheckerEnvironment) Hash ¶
func (CheckerEnvironment) Hash(_ []byte, _ string, _ sema.HashAlgorithm) ([]byte, error)
func (CheckerEnvironment) Interpret ¶
func (e CheckerEnvironment) Interpret( location common.Location, program *interpreter.Program, f runtime.InterpretFunc, ) ( interpreter.Value, *interpreter.Interpreter, error, )
func (CheckerEnvironment) InterpretContract ¶
func (CheckerEnvironment) InterpretContract( _ common.AddressLocation, _ *interpreter.Program, _ string, _ stdlib.DeployedContractConstructorInvocation, ) (*interpreter.CompositeValue, error)
func (CheckerEnvironment) IsContractBeingAdded ¶
func (CheckerEnvironment) IsContractBeingAdded(_ common.AddressLocation) bool
func (CheckerEnvironment) NewAccountValue ¶
func (e CheckerEnvironment) NewAccountValue(inter *interpreter.Interpreter, address interpreter.AddressValue) interpreter.Value
func (CheckerEnvironment) ParseAndCheckProgram ¶
func (CheckerEnvironment) ParseAndCheckProgram(_ []byte, _ common.Location, _ bool) (*interpreter.Program, error)
func (CheckerEnvironment) ProgramLog ¶
func (CheckerEnvironment) ProgramLog(_ string, _ interpreter.LocationRange) error
* The following methods are not implemented, as they are not used in the type-checking process. * They are only used in the execution process.
func (CheckerEnvironment) ReadRandom ¶
func (e CheckerEnvironment) ReadRandom(_ []byte) error
func (CheckerEnvironment) RecordContractRemoval ¶
func (CheckerEnvironment) RecordContractRemoval(_ common.AddressLocation)
func (CheckerEnvironment) RecordContractUpdate ¶
func (CheckerEnvironment) RecordContractUpdate(_ common.AddressLocation, _ *interpreter.CompositeValue)
func (CheckerEnvironment) RemoveAccountContractCode ¶
func (CheckerEnvironment) RemoveAccountContractCode(_ common.AddressLocation) error
func (CheckerEnvironment) RevokeAccountKey ¶
func (CheckerEnvironment) RevokeAccountKey(_ common.Address, _ uint32) (*stdlib.AccountKey, error)
func (CheckerEnvironment) RevokeEncodedAccountKey ¶
func (CheckerEnvironment) SetCompositeValueFunctionsHandler ¶
func (CheckerEnvironment) SetCompositeValueFunctionsHandler(_ common.TypeID, _ stdlib.CompositeValueFunctionsHandler)
func (CheckerEnvironment) SetupFVM ¶
func (e CheckerEnvironment) SetupFVM(chainId flow.ChainID)
func (CheckerEnvironment) StartContractAddition ¶
func (CheckerEnvironment) StartContractAddition(_ common.AddressLocation)
func (CheckerEnvironment) TemporarilyRecordCode ¶
func (CheckerEnvironment) TemporarilyRecordCode(_ common.AddressLocation, _ []byte)
func (CheckerEnvironment) UnsafeRandom ¶
func (CheckerEnvironment) UnsafeRandom() (uint64, error)
func (CheckerEnvironment) UpdateAccountContractCode ¶
func (CheckerEnvironment) UpdateAccountContractCode(_ common.AddressLocation, _ []byte) error
func (CheckerEnvironment) ValidatePublicKey ¶
func (CheckerEnvironment) ValidatePublicKey(_ *stdlib.PublicKey) error
func (CheckerEnvironment) VerifySignature ¶
func (CheckerEnvironment) VerifySignature( _ []byte, _ string, _ []byte, _ []byte, _ sema.SignatureAlgorithm, _ sema.HashAlgorithm, ) (bool, error)
Click to show internal directories.
Click to hide internal directories.