Documentation
¶
Index ¶
- Variables
- type Record
- func (r *Record) Clone() Record
- func (r *Record) CopyTo(dst *Record)
- func (r *Record) ToVirtualDurableNonce() (*cvm.VirtualDurableNonce, bool)
- func (r *Record) ToVirtualRelayAccount() (*cvm.VirtualRelayAccount, bool)
- func (r *Record) ToVirtualTimelockAccount() (*cvm.VirtualTimelockAccount, bool)
- func (r *Record) Validate() error
- type Store
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type Record ¶
type Record struct {
Id uint64
Vm string
MemoryAccount string
Index uint16
IsAllocated bool
Address *string
Type *cvm.VirtualAccountType
Data []byte
Slot uint64
LastUpdatedAt time.Time
}
func (*Record) ToVirtualDurableNonce ¶
func (r *Record) ToVirtualDurableNonce() (*cvm.VirtualDurableNonce, bool)
func (*Record) ToVirtualRelayAccount ¶
func (r *Record) ToVirtualRelayAccount() (*cvm.VirtualRelayAccount, bool)
func (*Record) ToVirtualTimelockAccount ¶
func (r *Record) ToVirtualTimelockAccount() (*cvm.VirtualTimelockAccount, bool)
type Store ¶
type Store interface {
// Save updates the database record for a piece of allocated memory
Save(ctx context.Context, record *Record) error
// GetAllMemoryAccounts gets all unique memory account addresses
GetAllMemoryAccounts(ctx context.Context, vm string) ([]string, error)
// GetAllByMemoryAccount gets all database records for a given memory account
GetAllByMemoryAccount(ctx context.Context, memoryAccount string) ([]*Record, error)
// GetAllVirtualAccountsByAddressAndType gets all database records for
// allocated memory with the provided address and account type in a VM
GetAllVirtualAccountsByAddressAndType(ctx context.Context, vm, address string, accountType cvm.VirtualAccountType) ([]*Record, error)
}
Click to show internal directories.
Click to hide internal directories.