ram

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

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

func (r *Record) Clone() Record

func (*Record) CopyTo

func (r *Record) CopyTo(dst *Record)

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)

func (*Record) Validate

func (r *Record) Validate() error

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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