states

package
v0.0.0-...-e920dd0 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2019 License: MIT Imports: 10 Imported by: 4

Documentation

Index

Constants

View Source
const (
	MaxByteTypeSize = 1
)

Variables

Functions

This section is empty.

Types

type AccountState

type AccountState struct {
	StateBase
	ProgramHash common.Uint168
	IsFrozen    bool
	Balances    map[common.Uint256]common.Fixed64
}

func NewAccountState

func NewAccountState(programHash common.Uint168, balances map[common.Uint256]common.Fixed64) *AccountState

func (*AccountState) Bytes

func (accountState *AccountState) Bytes() []byte

func (*AccountState) Deserialize

func (accountState *AccountState) Deserialize(r io.Reader) error

func (*AccountState) Serialize

func (accountState *AccountState) Serialize(w io.Writer) error

type AssetState

type AssetState struct {
	StateBase
	AssetId    common.Uint256
	AssetType  types.AssetType
	Name       string
	Amount     common.Fixed64
	Avaliable  common.Fixed64
	Precision  byte
	FeeMode    byte
	Fee        common.Fixed64
	FeeAddress common.Uint168
	Owner      *crypto.PublicKey
	Admin      common.Uint168
	Issuer     common.Uint168
	Expiration uint32
	IsFrozen   bool
}

func (*AssetState) Bytes

func (assetState *AssetState) Bytes() []byte

func (*AssetState) Deserialize

func (assetState *AssetState) Deserialize(r io.Reader) error

func (*AssetState) Serialize

func (assetState *AssetState) Serialize(w io.Writer) error

type ContractState

type ContractState struct {
	StateBase
	Code        *types.FunctionCode
	Name        string
	Version     string
	Author      string
	Email       string
	Description string
	ProgramHash common.Uint168
}

func NewContractState

func NewContractState() *ContractState

func (*ContractState) Bytes

func (contractState *ContractState) Bytes() []byte

func (*ContractState) Deserialize

func (contractState *ContractState) Deserialize(r io.Reader) error

func (*ContractState) IsMultiSigContract

func (contractState *ContractState) IsMultiSigContract() bool

func (*ContractState) IsSignatureCotract

func (contractState *ContractState) IsSignatureCotract() bool

func (*ContractState) Serialize

func (contractState *ContractState) Serialize(w io.Writer) error

type IStateKeyInterface

type IStateKeyInterface interface {
	Serialize(w io.Writer) error
	Deserialize(r io.Reader) error
}

type IStateValueInterface

type IStateValueInterface interface {
	Serialize(w io.Writer) error
	Deserialize(r io.Reader) error
}

func GetStateValue

func GetStateValue(prefix blockchain.EntryPrefix, data []byte) (IStateValueInterface, error)

type StateBase

type StateBase struct {
	StateVersion byte
}

func (*StateBase) Deserialize

func (stateBase *StateBase) Deserialize(r io.Reader) error

func (*StateBase) Serialize

func (stateBase *StateBase) Serialize(w io.Writer) error

type StorageItem

type StorageItem struct {
	StateBase
	Value []byte
}

func NewStorageItem

func NewStorageItem(value []byte) *StorageItem

func (*StorageItem) Bytes

func (storageItem *StorageItem) Bytes() []byte

func (*StorageItem) Deserialize

func (storageItem *StorageItem) Deserialize(r io.Reader) error

func (*StorageItem) Serialize

func (storageItem *StorageItem) Serialize(w io.Writer) error

type StorageKey

type StorageKey struct {
	CodeHash *common.Uint168
	Key      []byte
}

func NewStorageKey

func NewStorageKey(codeHash *common.Uint168, key []byte) *StorageKey

func (*StorageKey) Deserialize

func (storageKey *StorageKey) Deserialize(r io.Reader) error

func (*StorageKey) Serialize

func (storageKey *StorageKey) Serialize(w io.Writer) error

Jump to

Keyboard shortcuts

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