Documentation ¶
Index ¶
- func IsServiceLevelAddress(address common.Address) bool
- type AccountsAtreeLedger
- func (a *AccountsAtreeLedger) AllocateStorageIndex(owner []byte) (atree.StorageIndex, error)
- func (a *AccountsAtreeLedger) GetValue(owner, key []byte) ([]byte, error)
- func (a *AccountsAtreeLedger) SetValue(owner, key, value []byte) error
- func (a *AccountsAtreeLedger) ValueExists(owner, key []byte) (exists bool, err error)
- type MigrationRuntimeInterface
- func (m MigrationRuntimeInterface) AccountKeysCount(_ runtime.Address) (uint64, error)
- func (m MigrationRuntimeInterface) AddAccountKey(_ runtime.Address, _ *runtime.PublicKey, _ runtime.HashAlgorithm, _ int) (*runtime.AccountKey, error)
- func (m MigrationRuntimeInterface) AddEncodedAccountKey(_ runtime.Address, _ []byte) error
- func (m MigrationRuntimeInterface) AllocateStorageIndex(_ []byte) (atree.StorageIndex, error)
- func (m MigrationRuntimeInterface) BLSAggregatePublicKeys(_ []*runtime.PublicKey) (*runtime.PublicKey, error)
- func (m MigrationRuntimeInterface) BLSAggregateSignatures(_ [][]byte) ([]byte, error)
- func (m MigrationRuntimeInterface) BLSVerifyPOP(_ *runtime.PublicKey, _ []byte) (bool, error)
- func (m MigrationRuntimeInterface) ComputationUsed() (uint64, error)
- func (m MigrationRuntimeInterface) CreateAccount(_ runtime.Address) (address runtime.Address, err error)
- func (m MigrationRuntimeInterface) DecodeArgument(_ []byte, _ cadence.Type) (cadence.Value, error)
- func (m MigrationRuntimeInterface) EmitEvent(_ cadence.Event) error
- func (m MigrationRuntimeInterface) GenerateAccountID(_ common.Address) (uint64, error)
- func (m MigrationRuntimeInterface) GenerateUUID() (uint64, error)
- func (m MigrationRuntimeInterface) GetAccountAvailableBalance(_ common.Address) (value uint64, err error)
- func (m MigrationRuntimeInterface) GetAccountBalance(_ common.Address) (value uint64, err error)
- func (m MigrationRuntimeInterface) GetAccountContractCode(l common.AddressLocation) (code []byte, err error)
- func (m MigrationRuntimeInterface) GetAccountContractNames(_ runtime.Address) ([]string, error)
- func (m MigrationRuntimeInterface) GetAccountKey(_ runtime.Address, _ int) (*runtime.AccountKey, error)
- func (m MigrationRuntimeInterface) GetBlockAtHeight(_ uint64) (block runtime.Block, exists bool, err error)
- func (m MigrationRuntimeInterface) GetCode(location runtime.Location) ([]byte, error)
- func (m MigrationRuntimeInterface) GetComputationLimit() uint64
- func (m MigrationRuntimeInterface) GetCurrentBlockHeight() (uint64, error)
- func (m MigrationRuntimeInterface) GetInterpreterSharedState() *interpreter.SharedState
- func (m MigrationRuntimeInterface) GetOrLoadProgram(location runtime.Location, load func() (*interpreter.Program, error)) (*interpreter.Program, error)
- func (m MigrationRuntimeInterface) GetSigningAccounts() ([]runtime.Address, error)
- func (m MigrationRuntimeInterface) GetStorageCapacity(_ runtime.Address) (value uint64, err error)
- func (m MigrationRuntimeInterface) GetStorageUsed(_ runtime.Address) (value uint64, err error)
- func (m MigrationRuntimeInterface) GetValue(_, _ []byte) (value []byte, err error)
- func (m MigrationRuntimeInterface) Hash(_ []byte, _ string, _ runtime.HashAlgorithm) ([]byte, error)
- func (m MigrationRuntimeInterface) ImplementationDebugLog(_ string) error
- func (m MigrationRuntimeInterface) InteractionUsed() (uint64, error)
- func (m MigrationRuntimeInterface) MemoryUsed() (uint64, error)
- func (m MigrationRuntimeInterface) MeterComputation(_ common.ComputationKind, _ uint) error
- func (m MigrationRuntimeInterface) MeterMemory(_ common.MemoryUsage) error
- func (m MigrationRuntimeInterface) ProgramLog(_ string) error
- func (m MigrationRuntimeInterface) ReadRandom([]byte) error
- func (m MigrationRuntimeInterface) RecordTrace(_ string, _ runtime.Location, _ time.Duration, _ []attribute.KeyValue)
- func (m MigrationRuntimeInterface) RemoveAccountContractCode(common.AddressLocation) (err error)
- func (m MigrationRuntimeInterface) ResolveLocation(identifiers []runtime.Identifier, location runtime.Location) ([]runtime.ResolvedLocation, error)
- func (m MigrationRuntimeInterface) ResourceOwnerChanged(_ *interpreter.Interpreter, _ *interpreter.CompositeValue, _ common.Address, ...)
- func (m MigrationRuntimeInterface) RevokeAccountKey(_ runtime.Address, _ int) (*runtime.AccountKey, error)
- func (m MigrationRuntimeInterface) RevokeEncodedAccountKey(_ runtime.Address, _ int) (publicKey []byte, err error)
- func (m MigrationRuntimeInterface) SetComputationUsed(_ uint64) error
- func (m MigrationRuntimeInterface) SetInterpreterSharedState(_ *interpreter.SharedState)
- func (m MigrationRuntimeInterface) SetValue(_, _, _ []byte) (err error)
- func (m MigrationRuntimeInterface) UpdateAccountContractCode(_ common.AddressLocation, _ []byte) (err error)
- func (m MigrationRuntimeInterface) ValidatePublicKey(_ *runtime.PublicKey) error
- func (m MigrationRuntimeInterface) ValueExists(_, _ []byte) (exists bool, err error)
- func (m MigrationRuntimeInterface) VerifySignature(_ []byte, _ string, _ []byte, _ []byte, _ runtime.SignatureAlgorithm, ...) (bool, error)
- type NopMemoryGauge
- type NopMeter
- func (n NopMeter) ComputationAvailable(_ common.ComputationKind, _ uint) bool
- func (n NopMeter) ComputationIntensities() meter.MeteredComputationIntensities
- func (n NopMeter) ComputationUsed() (uint64, error)
- func (n NopMeter) InteractionUsed() (uint64, error)
- func (n NopMeter) MemoryUsed() (uint64, error)
- func (n NopMeter) MeterComputation(_ common.ComputationKind, _ uint) error
- func (n NopMeter) MeterEmittedEvent(_ uint64) error
- func (n NopMeter) MeterMemory(_ common.MemoryUsage) error
- func (n NopMeter) TotalEmittedEventBytes() uint64
- type PayloadAccountGroup
- type PayloadAccountGrouping
- type PayloadSnapshot
- type PayloadsReadonlyLedger
- func (p *PayloadsReadonlyLedger) AllocateStorageIndex(owner []byte) (atree.StorageIndex, error)
- func (p *PayloadsReadonlyLedger) GetValue(owner, key []byte) (value []byte, err error)
- func (p *PayloadsReadonlyLedger) SetValue(owner, key, value []byte) (err error)
- func (p *PayloadsReadonlyLedger) ValueExists(owner, key []byte) (exists bool, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsServiceLevelAddress ¶
IsServiceLevelAddress returns true if the given address is the service level address. Which means it's not an actual account but instead holds service lever registers.
Types ¶
type AccountsAtreeLedger ¶
type AccountsAtreeLedger struct {
Accounts environment.Accounts
}
func NewAccountsAtreeLedger ¶
func NewAccountsAtreeLedger(accounts environment.Accounts) *AccountsAtreeLedger
func (*AccountsAtreeLedger) AllocateStorageIndex ¶
func (a *AccountsAtreeLedger) AllocateStorageIndex(owner []byte) (atree.StorageIndex, error)
AllocateStorageIndex allocates new storage index under the owner accounts to store a new register
func (*AccountsAtreeLedger) GetValue ¶
func (a *AccountsAtreeLedger) GetValue(owner, key []byte) ([]byte, error)
func (*AccountsAtreeLedger) SetValue ¶
func (a *AccountsAtreeLedger) SetValue(owner, key, value []byte) error
func (*AccountsAtreeLedger) ValueExists ¶
func (a *AccountsAtreeLedger) ValueExists(owner, key []byte) (exists bool, err error)
type MigrationRuntimeInterface ¶
type MigrationRuntimeInterface struct { Accounts environment.Accounts Programs *environment.Programs // GetOrLoadProgramFunc allows for injecting extra logic GetOrLoadProgramFunc func(location runtime.Location, load func() (*interpreter.Program, error)) (*interpreter.Program, error) }
MigrationRuntimeInterface is a runtime interface that can be used in migrations.
func (MigrationRuntimeInterface) AccountKeysCount ¶
func (m MigrationRuntimeInterface) AccountKeysCount(_ runtime.Address) (uint64, error)
func (MigrationRuntimeInterface) AddAccountKey ¶
func (m MigrationRuntimeInterface) AddAccountKey(_ runtime.Address, _ *runtime.PublicKey, _ runtime.HashAlgorithm, _ int) (*runtime.AccountKey, error)
func (MigrationRuntimeInterface) AddEncodedAccountKey ¶
func (m MigrationRuntimeInterface) AddEncodedAccountKey(_ runtime.Address, _ []byte) error
func (MigrationRuntimeInterface) AllocateStorageIndex ¶
func (m MigrationRuntimeInterface) AllocateStorageIndex(_ []byte) (atree.StorageIndex, error)
func (MigrationRuntimeInterface) BLSAggregatePublicKeys ¶
func (MigrationRuntimeInterface) BLSAggregateSignatures ¶
func (m MigrationRuntimeInterface) BLSAggregateSignatures(_ [][]byte) ([]byte, error)
func (MigrationRuntimeInterface) BLSVerifyPOP ¶
func (MigrationRuntimeInterface) ComputationUsed ¶
func (m MigrationRuntimeInterface) ComputationUsed() (uint64, error)
func (MigrationRuntimeInterface) CreateAccount ¶
func (MigrationRuntimeInterface) DecodeArgument ¶
func (MigrationRuntimeInterface) EmitEvent ¶
func (m MigrationRuntimeInterface) EmitEvent(_ cadence.Event) error
func (MigrationRuntimeInterface) GenerateAccountID ¶
func (m MigrationRuntimeInterface) GenerateAccountID(_ common.Address) (uint64, error)
func (MigrationRuntimeInterface) GenerateUUID ¶
func (m MigrationRuntimeInterface) GenerateUUID() (uint64, error)
func (MigrationRuntimeInterface) GetAccountAvailableBalance ¶
func (m MigrationRuntimeInterface) GetAccountAvailableBalance(_ common.Address) (value uint64, err error)
func (MigrationRuntimeInterface) GetAccountBalance ¶
func (m MigrationRuntimeInterface) GetAccountBalance(_ common.Address) (value uint64, err error)
func (MigrationRuntimeInterface) GetAccountContractCode ¶
func (m MigrationRuntimeInterface) GetAccountContractCode( l common.AddressLocation, ) (code []byte, err error)
func (MigrationRuntimeInterface) GetAccountContractNames ¶
func (m MigrationRuntimeInterface) GetAccountContractNames(_ runtime.Address) ([]string, error)
func (MigrationRuntimeInterface) GetAccountKey ¶
func (m MigrationRuntimeInterface) GetAccountKey(_ runtime.Address, _ int) (*runtime.AccountKey, error)
func (MigrationRuntimeInterface) GetBlockAtHeight ¶
func (MigrationRuntimeInterface) GetCode ¶
func (m MigrationRuntimeInterface) GetCode(location runtime.Location) ([]byte, error)
func (MigrationRuntimeInterface) GetComputationLimit ¶
func (m MigrationRuntimeInterface) GetComputationLimit() uint64
func (MigrationRuntimeInterface) GetCurrentBlockHeight ¶
func (m MigrationRuntimeInterface) GetCurrentBlockHeight() (uint64, error)
func (MigrationRuntimeInterface) GetInterpreterSharedState ¶
func (m MigrationRuntimeInterface) GetInterpreterSharedState() *interpreter.SharedState
func (MigrationRuntimeInterface) GetOrLoadProgram ¶
func (m MigrationRuntimeInterface) GetOrLoadProgram(location runtime.Location, load func() (*interpreter.Program, error)) (*interpreter.Program, error)
func (MigrationRuntimeInterface) GetSigningAccounts ¶
func (m MigrationRuntimeInterface) GetSigningAccounts() ([]runtime.Address, error)
func (MigrationRuntimeInterface) GetStorageCapacity ¶
func (m MigrationRuntimeInterface) GetStorageCapacity(_ runtime.Address) (value uint64, err error)
func (MigrationRuntimeInterface) GetStorageUsed ¶
func (m MigrationRuntimeInterface) GetStorageUsed(_ runtime.Address) (value uint64, err error)
func (MigrationRuntimeInterface) GetValue ¶
func (m MigrationRuntimeInterface) GetValue(_, _ []byte) (value []byte, err error)
func (MigrationRuntimeInterface) Hash ¶
func (m MigrationRuntimeInterface) Hash(_ []byte, _ string, _ runtime.HashAlgorithm) ([]byte, error)
func (MigrationRuntimeInterface) ImplementationDebugLog ¶
func (m MigrationRuntimeInterface) ImplementationDebugLog(_ string) error
func (MigrationRuntimeInterface) InteractionUsed ¶
func (m MigrationRuntimeInterface) InteractionUsed() (uint64, error)
func (MigrationRuntimeInterface) MemoryUsed ¶
func (m MigrationRuntimeInterface) MemoryUsed() (uint64, error)
func (MigrationRuntimeInterface) MeterComputation ¶
func (m MigrationRuntimeInterface) MeterComputation(_ common.ComputationKind, _ uint) error
func (MigrationRuntimeInterface) MeterMemory ¶
func (m MigrationRuntimeInterface) MeterMemory(_ common.MemoryUsage) error
func (MigrationRuntimeInterface) ProgramLog ¶
func (m MigrationRuntimeInterface) ProgramLog(_ string) error
func (MigrationRuntimeInterface) ReadRandom ¶
func (m MigrationRuntimeInterface) ReadRandom([]byte) error
func (MigrationRuntimeInterface) RecordTrace ¶
func (MigrationRuntimeInterface) RemoveAccountContractCode ¶
func (m MigrationRuntimeInterface) RemoveAccountContractCode(common.AddressLocation) (err error)
func (MigrationRuntimeInterface) ResolveLocation ¶
func (m MigrationRuntimeInterface) ResolveLocation( identifiers []runtime.Identifier, location runtime.Location, ) ([]runtime.ResolvedLocation, error)
func (MigrationRuntimeInterface) ResourceOwnerChanged ¶
func (m MigrationRuntimeInterface) ResourceOwnerChanged(_ *interpreter.Interpreter, _ *interpreter.CompositeValue, _ common.Address, _ common.Address)
func (MigrationRuntimeInterface) RevokeAccountKey ¶
func (m MigrationRuntimeInterface) RevokeAccountKey(_ runtime.Address, _ int) (*runtime.AccountKey, error)
func (MigrationRuntimeInterface) RevokeEncodedAccountKey ¶
func (MigrationRuntimeInterface) SetComputationUsed ¶
func (m MigrationRuntimeInterface) SetComputationUsed(_ uint64) error
func (MigrationRuntimeInterface) SetInterpreterSharedState ¶
func (m MigrationRuntimeInterface) SetInterpreterSharedState(_ *interpreter.SharedState)
func (MigrationRuntimeInterface) SetValue ¶
func (m MigrationRuntimeInterface) SetValue(_, _, _ []byte) (err error)
func (MigrationRuntimeInterface) UpdateAccountContractCode ¶
func (m MigrationRuntimeInterface) UpdateAccountContractCode(_ common.AddressLocation, _ []byte) (err error)
func (MigrationRuntimeInterface) ValidatePublicKey ¶
func (m MigrationRuntimeInterface) ValidatePublicKey(_ *runtime.PublicKey) error
func (MigrationRuntimeInterface) ValueExists ¶
func (m MigrationRuntimeInterface) ValueExists(_, _ []byte) (exists bool, err error)
func (MigrationRuntimeInterface) VerifySignature ¶
func (m MigrationRuntimeInterface) VerifySignature(_ []byte, _ string, _ []byte, _ []byte, _ runtime.SignatureAlgorithm, _ runtime.HashAlgorithm) (bool, error)
type NopMemoryGauge ¶
type NopMemoryGauge struct{}
NopMemoryGauge is a no-op implementation of the MemoryGauge interface
func (NopMemoryGauge) MeterMemory ¶
func (n NopMemoryGauge) MeterMemory(common.MemoryUsage) error
type NopMeter ¶
type NopMeter struct{}
NopMeter is a meter that does nothing. It can be used in migrations.
func (NopMeter) ComputationAvailable ¶
func (n NopMeter) ComputationAvailable(_ common.ComputationKind, _ uint) bool
func (NopMeter) ComputationIntensities ¶
func (n NopMeter) ComputationIntensities() meter.MeteredComputationIntensities
func (NopMeter) ComputationUsed ¶
func (NopMeter) InteractionUsed ¶
func (NopMeter) MemoryUsed ¶
func (NopMeter) MeterComputation ¶
func (n NopMeter) MeterComputation(_ common.ComputationKind, _ uint) error
func (NopMeter) MeterEmittedEvent ¶
func (NopMeter) MeterMemory ¶
func (n NopMeter) MeterMemory(_ common.MemoryUsage) error
func (NopMeter) TotalEmittedEventBytes ¶
type PayloadAccountGroup ¶
PayloadAccountGroup is a grouping of payloads by account
type PayloadAccountGrouping ¶
type PayloadAccountGrouping struct {
// contains filtered or unexported fields
}
PayloadAccountGrouping is a grouping of payloads by account.
func GroupPayloadsByAccount ¶
func GroupPayloadsByAccount( log zerolog.Logger, payloads []*ledger.Payload, nWorkers int, ) *PayloadAccountGrouping
GroupPayloadsByAccount takes a list of payloads and groups them by account. it uses nWorkers to sort the payloads by address and find the start and end indexes of each account.
func (*PayloadAccountGrouping) AllPayloadsCount ¶
func (g *PayloadAccountGrouping) AllPayloadsCount() int
AllPayloadsCount the number of payloads
func (*PayloadAccountGrouping) Len ¶
func (g *PayloadAccountGrouping) Len() int
Len returns the number of accounts
func (*PayloadAccountGrouping) Next ¶
func (g *PayloadAccountGrouping) Next() (*PayloadAccountGroup, error)
Next returns the next account group. If there is no more account group, it returns nil. The zero address is used for global Payloads and is not an actual account.
type PayloadSnapshot ¶
type PayloadSnapshot struct {
Payloads map[flow.RegisterID]*ledger.Payload
}
func NewPayloadSnapshot ¶
func NewPayloadSnapshot(payloads []*ledger.Payload) (*PayloadSnapshot, error)
func (PayloadSnapshot) Get ¶
func (p PayloadSnapshot) Get(id flow.RegisterID) (flow.RegisterValue, error)
type PayloadsReadonlyLedger ¶
type PayloadsReadonlyLedger struct { Snapshot *PayloadSnapshot AllocateStorageIndexFunc func(owner []byte) (atree.StorageIndex, error) SetValueFunc func(owner, key, value []byte) (err error) }
func NewPayloadsReadonlyLedger ¶
func NewPayloadsReadonlyLedger(snapshot *PayloadSnapshot) *PayloadsReadonlyLedger
func (*PayloadsReadonlyLedger) AllocateStorageIndex ¶
func (p *PayloadsReadonlyLedger) AllocateStorageIndex(owner []byte) (atree.StorageIndex, error)
func (*PayloadsReadonlyLedger) GetValue ¶
func (p *PayloadsReadonlyLedger) GetValue(owner, key []byte) (value []byte, err error)
func (*PayloadsReadonlyLedger) SetValue ¶
func (p *PayloadsReadonlyLedger) SetValue(owner, key, value []byte) (err error)
func (*PayloadsReadonlyLedger) ValueExists ¶
func (p *PayloadsReadonlyLedger) ValueExists(owner, key []byte) (exists bool, err error)