accounts

package
v0.1.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const NativeLoaderAddrStr = "NativeLoader1111111111111111111111111111111"

Variables

Functions

This section is empty.

Types

type Account

type Account struct {
	Slot       uint64
	Key        solana.PublicKey
	Lamports   uint64
	Data       []byte
	Owner      [32]byte
	Executable bool
	RentEpoch  uint64
	IsDummy    bool
}

func (*Account) Clone

func (a *Account) Clone() *Account

This makes a fresh copy of the account's data in 'newCopy' by allocating a new slice and copying the existing data into it. Without this, 'newCopy' would be a shallow copy, and its 'Data' member would point into the same underlying data slice as 'a'.

func (*Account) IsBuiltin

func (a *Account) IsBuiltin() bool

func (*Account) IsExecutable

func (a *Account) IsExecutable() bool

func (*Account) MarshalWithEncoder

func (a *Account) MarshalWithEncoder(encoder *bin.Encoder) error

func (*Account) Resize

func (a *Account) Resize(newLen uint64, fillVal byte)

func (*Account) SetData

func (a *Account) SetData(data []byte)

have this placeholder setter to allow for locking/mutex later

func (*Account) SetExecutable

func (a *Account) SetExecutable(isExecutable bool)

func (*Account) SetLamports

func (a *Account) SetLamports(lamports uint64)

func (*Account) UnmarshalWithDecoder

func (a *Account) UnmarshalWithDecoder(decoder *bin.Decoder) (err error)

type Accounts

type Accounts interface {
	GetAccount(pubkey *[32]byte) (*Account, error)
	SetAccount(pubkey *[32]byte, acc *Account) error
	AllAccounts() []*Account
	SetAccountWithoutLock(pubkey solana.PublicKey, acc *Account) error
	GetAccountWithoutLock(pubkey solana.PublicKey) (*Account, error)
}

type MemAccounts

type MemAccounts struct {
	Map map[[32]byte]*Account
	// contains filtered or unexported fields
}

func NewMemAccounts

func NewMemAccounts() MemAccounts

func NewMemAccountsWithLen

func NewMemAccountsWithLen(len uint64) MemAccounts

func (MemAccounts) AllAccounts

func (m MemAccounts) AllAccounts() []*Account

func (MemAccounts) GetAccount

func (m MemAccounts) GetAccount(pubkey *[32]byte) (*Account, error)

func (MemAccounts) GetAccountWithoutLock

func (m MemAccounts) GetAccountWithoutLock(pubkey solana.PublicKey) (*Account, error)

func (MemAccounts) SetAccount

func (m MemAccounts) SetAccount(pubkey *[32]byte, acct *Account) error

func (MemAccounts) SetAccountWithoutLock

func (m MemAccounts) SetAccountWithoutLock(pubkey solana.PublicKey, acct *Account) error

Jump to

Keyboard shortcuts

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