util

package
v0.0.0-donotuse2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 3, 2024 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const EnvPrefix = "FLOW"

Variables

View Source
var TestID = flow.HexToID("24993fc99f81641c45c0afa307e683b4f08d407d90041aa9439f487acb33d633")

Functions

func AddCDCExtension added in v1.20.0

func AddCDCExtension(name string) string

func AddToGitIgnore

func AddToGitIgnore(filename string, loader flowkit.ReaderWriter) error

AddToGitIgnore adds a new line to the .gitignore if one doesn't exist it creates it.

func CheckNetwork

func CheckNetwork(network config.Network) error

func CreateTabWriter

func CreateTabWriter(b *bytes.Buffer) *tabwriter.Writer

func Exit

func Exit(code int, msg string)

func GetAccountByContractName

func GetAccountByContractName(state *flowkit.State, contractName string, network config.Network) (*accounts.Account, error)

func GetAddressByContractName

func GetAddressByContractName(state *flowkit.State, contractName string, network config.Network) (flow.Address, error)

func GetAddressNetwork

func GetAddressNetwork(address flowsdk.Address) (flowsdk.ChainID, error)

GetAddressNetwork returns the chain ID for an address.

func MessageWithEmojiPrefix added in v1.18.0

func MessageWithEmojiPrefix(emoji string, message string) string

func NormalizeLineEndings added in v1.19.0

func NormalizeLineEndings(s string) string

func Pluralize

func Pluralize(word string, count int) string

func PrintEmoji added in v1.18.0

func PrintEmoji(emoji string) string

func StripCDCExtension added in v1.20.0

func StripCDCExtension(name string) string

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

func ValidateECDSAP256Pub(key string) error

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) AddEncodedAccountKey

func (CheckerEnvironment) AddEncodedAccountKey(_ common.Address, _ []byte) error

func (CheckerEnvironment) BLSAggregatePublicKeys

func (CheckerEnvironment) BLSAggregatePublicKeys(_ []*stdlib.PublicKey) (*stdlib.PublicKey, error)

func (CheckerEnvironment) BLSAggregateSignatures

func (CheckerEnvironment) BLSAggregateSignatures(_ [][]byte) ([]byte, error)

func (CheckerEnvironment) BLSVerifyPOP

func (CheckerEnvironment) BLSVerifyPOP(_ *stdlib.PublicKey, _ []byte) (bool, error)

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) CreateAccount(_ common.Address) (address common.Address, err error)

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 (e CheckerEnvironment) DecodeArgument(argument []byte, argumentType cadence.Type) (cadence.Value, error)

func (CheckerEnvironment) EmitEvent

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) GetBlockAtHeight(_ uint64) (stdlib.Block, bool, error)

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 (CheckerEnvironment) IsContractBeingAdded

func (CheckerEnvironment) IsContractBeingAdded(_ common.AddressLocation) bool

func (CheckerEnvironment) NewAccountValue

func (CheckerEnvironment) ParseAndCheckProgram

func (CheckerEnvironment) ParseAndCheckProgram(_ []byte, _ common.Location, _ bool) (*interpreter.Program, error)

func (CheckerEnvironment) ProgramLog

* 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) RemoveAccountContractCode

func (CheckerEnvironment) RemoveAccountContractCode(_ common.AddressLocation) error

func (CheckerEnvironment) RevokeAccountKey

func (CheckerEnvironment) RevokeAccountKey(_ common.Address, _ uint32) (*stdlib.AccountKey, error)

func (CheckerEnvironment) RevokeEncodedAccountKey

func (CheckerEnvironment) RevokeEncodedAccountKey(_ common.Address, _ int) ([]byte, error)

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)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL