Documentation ¶
Index ¶
- func ApplyChanges(registers Registers, changes map[flow.RegisterID]flow.RegisterValue, ...) error
- type AccountRegisters
- func (a *AccountRegisters) Count() int
- func (a *AccountRegisters) ForEach(f ForEachCallback) error
- func (a *AccountRegisters) ForEachKey(f func(key string) error) error
- func (a *AccountRegisters) Get(owner string, key string) ([]byte, error)
- func (a *AccountRegisters) Merge(other *AccountRegisters) error
- func (a *AccountRegisters) Owner() string
- func (a *AccountRegisters) Payloads() []*ledger.Payload
- func (a *AccountRegisters) Set(owner string, key string, value []byte) error
- type ByAccount
- func (b *ByAccount) AccountCount() int
- func (b *ByAccount) AccountRegisters(owner string) *AccountRegisters
- func (b *ByAccount) Count() int
- func (b *ByAccount) DestructIntoPayloads(nWorker int) []*ledger.Payload
- func (b *ByAccount) ForEach(f ForEachCallback) error
- func (b *ByAccount) ForEachAccount(f func(accountRegisters *AccountRegisters) error) error
- func (b *ByAccount) Get(owner string, key string) ([]byte, error)
- func (b *ByAccount) HasAccountOwner(owner string) bool
- func (b *ByAccount) Set(owner string, key string, value []byte) error
- func (b *ByAccount) SetAccountRegisters(newAccountRegisters *AccountRegisters) *AccountRegisters
- type ForEachCallback
- type ReadOnlyLedger
- type Registers
- type StorageSnapshot
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyChanges ¶
func ApplyChanges( registers Registers, changes map[flow.RegisterID]flow.RegisterValue, expectedChangeAddresses map[flow.Address]struct{}, logger zerolog.Logger, ) error
ApplyChanges applies the given changes to the given registers, and verifies that the changes are only for the expected addresses.
Types ¶
type AccountRegisters ¶
type AccountRegisters struct {
// contains filtered or unexported fields
}
AccountRegisters represents the registers of an account
func NewAccountRegisters ¶
func NewAccountRegisters(owner string) *AccountRegisters
func NewAccountRegistersFromPayloads ¶
func NewAccountRegistersFromPayloads(owner string, payloads []*ledger.Payload) (*AccountRegisters, error)
func (*AccountRegisters) Count ¶
func (a *AccountRegisters) Count() int
func (*AccountRegisters) ForEach ¶
func (a *AccountRegisters) ForEach(f ForEachCallback) error
func (*AccountRegisters) ForEachKey ¶
func (a *AccountRegisters) ForEachKey(f func(key string) error) error
func (*AccountRegisters) Get ¶
func (a *AccountRegisters) Get(owner string, key string) ([]byte, error)
func (*AccountRegisters) Merge ¶
func (a *AccountRegisters) Merge(other *AccountRegisters) error
Merge merges the registers from the other AccountRegisters into this AccountRegisters.
func (*AccountRegisters) Owner ¶
func (a *AccountRegisters) Owner() string
func (*AccountRegisters) Payloads ¶
func (a *AccountRegisters) Payloads() []*ledger.Payload
type ByAccount ¶
type ByAccount struct {
// contains filtered or unexported fields
}
ByAccount represents the registers of all accounts
func NewByAccount ¶
func NewByAccount() *ByAccount
func (*ByAccount) AccountCount ¶
func (*ByAccount) AccountRegisters ¶
func (b *ByAccount) AccountRegisters(owner string) *AccountRegisters
func (*ByAccount) DestructIntoPayloads ¶
func (*ByAccount) ForEach ¶
func (b *ByAccount) ForEach(f ForEachCallback) error
func (*ByAccount) ForEachAccount ¶
func (b *ByAccount) ForEachAccount(f func(accountRegisters *AccountRegisters) error) error
func (*ByAccount) HasAccountOwner ¶
func (*ByAccount) SetAccountRegisters ¶
func (b *ByAccount) SetAccountRegisters(newAccountRegisters *AccountRegisters) *AccountRegisters
type ReadOnlyLedger ¶
type ReadOnlyLedger struct {
Registers
}
ReadOnlyLedger adapts Registers to the atree.Ledger interface
func (ReadOnlyLedger) AllocateStorageIndex ¶
func (l ReadOnlyLedger) AllocateStorageIndex(_ []byte) (atree.StorageIndex, error)
func (ReadOnlyLedger) GetValue ¶
func (l ReadOnlyLedger) GetValue(owner, key []byte) (value []byte, err error)
func (ReadOnlyLedger) SetValue ¶
func (l ReadOnlyLedger) SetValue(_, _, _ []byte) error
func (ReadOnlyLedger) ValueExists ¶
func (l ReadOnlyLedger) ValueExists(owner, key []byte) (exists bool, err error)
type StorageSnapshot ¶
type StorageSnapshot struct {
Registers
}
StorageSnapshot adapts Registers to the snapshot.StorageSnapshot interface
func (StorageSnapshot) Get ¶
func (s StorageSnapshot) Get(id flow.RegisterID) (flow.RegisterValue, error)
Click to show internal directories.
Click to hide internal directories.