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 ¶
View Source
var ( ErrStaleState = errors.New("memory item state is stale") ErrNotFound = errors.New("memory item not found") )
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 // 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 GetAllVirtualAccountsByAddressAndType(ctx context.Context, address string, accountType cvm.VirtualAccountType) ([]*Record, error) }
Click to show internal directories.
Click to hide internal directories.