addressstate

package
v0.0.0-...-7bd4979 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2019 License: MIT Imports: 8 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsValidAddress

func IsValidAddress(address []byte) bool

Types

type AddressState

type AddressState struct {
	// contains filtered or unexported fields
}

func CreateAddressState

func CreateAddressState(address []byte, nonce uint64, balance uint64, otsBitfield [][]byte, tokens map[string]uint64, slavePksAccessType map[string]uint32, otsCounter uint64) *AddressState

func DeSerializeAddressState

func DeSerializeAddressState(data []byte) (*AddressState, error)

func GetDefaultAddressState

func GetDefaultAddressState(address []byte) *AddressState

func (*AddressState) AddBalance

func (a *AddressState) AddBalance(balance uint64)

func (*AddressState) AddSlavePKSAccessType

func (a *AddressState) AddSlavePKSAccessType(slavePK []byte, accessType uint32)

func (*AddressState) Address

func (a *AddressState) Address() []byte

func (*AddressState) AppendTransactionHash

func (a *AddressState) AppendTransactionHash(hash []byte)

func (*AddressState) Balance

func (a *AddressState) Balance() uint64

func (*AddressState) DecreaseNonce

func (a *AddressState) DecreaseNonce()

func (*AddressState) GetSlavePermission

func (a *AddressState) GetSlavePermission(slavePK []byte) (uint32, bool)

func (*AddressState) GetTokenBalance

func (a *AddressState) GetTokenBalance(tokenTxHash []byte) uint64

func (*AddressState) GetUnusedOTSIndex

func (a *AddressState) GetUnusedOTSIndex(startFrom uint64) (uint64, bool)

func (*AddressState) Height

func (a *AddressState) Height() uint64

func (*AddressState) IncreaseNonce

func (a *AddressState) IncreaseNonce()

func (*AddressState) IsTokenExists

func (a *AddressState) IsTokenExists(tokenTxHash []byte) bool

func (*AddressState) LatticePKList

func (a *AddressState) LatticePKList() []*generated.LatticePK

func (*AddressState) Nonce

func (a *AddressState) Nonce() uint64

func (*AddressState) OTSKeyReuse

func (a *AddressState) OTSKeyReuse(otsKeyIndex uint64) bool

func (*AddressState) OtsBitfield

func (a *AddressState) OtsBitfield() [][]byte

func (*AddressState) OtsCounter

func (a *AddressState) OtsCounter() uint64

func (*AddressState) PBData

func (a *AddressState) PBData() *generated.AddressState

func (*AddressState) RemoveSlavePKSAccessType

func (a *AddressState) RemoveSlavePKSAccessType(slavePK []byte)

func (*AddressState) RemoveTransactionHash

func (a *AddressState) RemoveTransactionHash(hash []byte)

func (*AddressState) Serialize

func (a *AddressState) Serialize() ([]byte, error)

func (*AddressState) SetBalance

func (a *AddressState) SetBalance(balance uint64)

func (*AddressState) SetOTSKey

func (a *AddressState) SetOTSKey(otsKeyIndex uint64)

func (*AddressState) SlavePKSAccessType

func (a *AddressState) SlavePKSAccessType() map[string]uint32

func (*AddressState) SubtractBalance

func (a *AddressState) SubtractBalance(balance uint64)

func (*AddressState) TransactionHashes

func (a *AddressState) TransactionHashes() [][]byte

func (*AddressState) UpdateTokenBalance

func (a *AddressState) UpdateTokenBalance(tokenTxHash []byte, balance uint64, subtract bool)

type AddressStateInterface

type AddressStateInterface interface {
	PBData() *generated.AddressState

	Address() []byte

	Nonce() uint64

	Balance() uint64

	SetBalance(balance uint64)

	AddBalance(balance uint64)

	SubtractBalance(balance uint64)

	OTSBitfield() [][]byte

	OTSCounter() uint64

	TransactionHashes() [][]byte

	LatticePKList() []*generated.LatticePK

	SlavePKSAccessType() map[string]uint32

	UpdateTokenBalance(tokenTxHash []byte, balance uint64, subtract bool)

	GetTokenBalance(tokenTxHash []byte) uint64

	IsTokenExists(tokenTxHash []byte) bool

	AddSlavePKSAccessType(slavePK []byte, accessType uint32)

	RemoveSlavePKSAccessType(slavePK []byte)

	IncreaseNonce()

	DecreaseNonce()

	GetSlavePermission(slavePK []byte) (uint16, bool)

	GetDefault(address []byte) *AddressState

	OTSKeyReuse(otsKeyIndex uint64) bool

	SetOTSKey(otsKeyIndex uint64)

	IsValidAddress(address []byte) bool

	Serialize() string
}

type IsUnusedOTSIndex

type IsUnusedOTSIndex struct {
	IsUnusedOTSIndex bool `json:"isUnusedOtsIndex" bson:"isUnusedOtsIndex"`
}

type NextUnusedOTS

type NextUnusedOTS struct {
	UnusedOTSIndex uint64 `json:"unusedOtsIndex" bson:"unusedOtsIndex"`
	Found          bool   `json:"found" bson:"found"`
}

type PlainAddressState

type PlainAddressState struct {
	Address           string   `json:"address" bson:"address"`
	Balance           uint64   `json:"balance" bson:"balance"`
	Nonce             uint64   `json:"nonce" bson:"nonce"`
	OtsBitfield       []string `json:"otsBitField" bson:"otsBitField"`
	TransactionHashes []string `json:"transactionHashes" bson:"transactionHashes"`
	OtsCounter        uint64   `json:"otsCounter" bson:"otsCounter"`
}

func (*PlainAddressState) AddressStateFromPBData

func (a *PlainAddressState) AddressStateFromPBData(a2 *generated.AddressState)

type PlainBalance

type PlainBalance struct {
	Balance string `json:"balance" bson:"balance"`
}

Jump to

Keyboard shortcuts

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