Documentation ¶
Index ¶
- Variables
- type Account
- func (a *Account) FromPod(pod AccountPod)
- func (this *Account) GetBalance() uint64
- func (this *Account) GetHashBuffer() AccountHashBuffer
- func (this *Account) GetNumber() uint32
- func (this *Account) GetOperationsCount() uint32
- func (this *Account) GetOperationsTotal() uint32
- func (a *Account) GetPublicKey() *crypto.Public
- func (this *Account) GetPublicKeySerialized() crypto.PublicSerialized
- func (this *Account) GetTimestamp() uint32
- func (this *Account) GetUpdatedIndex() uint32
- func (this *Account) IsPublicKeyEqual(other *crypto.Public) bool
- func (this *Account) Marshal() ([]byte, error)
- func (this *Account) Pod() *AccountPod
- func (this *Account) Unmarshal(data []byte) (int, error)
- type AccountHashBuffer
- type AccountPod
- type Accounter
- func (this *Accounter) AppendPack(pack *PackBase)
- func (this *Accounter) BalanceAdd(number uint32, amount uint64, index uint32)
- func (this *Accounter) BalanceSub(number uint32, amount uint64, index uint32)
- func (this *Accounter) GetAccount(number uint32) *Account
- func (this *Accounter) GetAccountPackSerialized(index uint32) ([]byte, error)
- func (this *Accounter) GetCumulativeDifficultyAndTimestamp(index uint32) (*big.Int, uint32)
- func (this *Accounter) GetHeight() uint32
- func (this *Accounter) GetState() (uint32, []byte, *big.Int)
- func (a *Accounter) GetUpdatedPacks() []uint32
- func (this *Accounter) KeyChange(number uint32, key *crypto.Public, index uint32, fee uint64)
- func (a *Accounter) Marshal() ([]byte, error)
- func (a *Accounter) Merge()
- func (this *Accounter) NewPack(miner *crypto.Public, reward uint64, timestamp uint32, difficulty *big.Int) uint32
- func (a *Accounter) Rollback()
- func (this *Accounter) ToBlob() []byte
- func (a *Accounter) Unmarshal(data []byte) (int, error)
- type AccounterPod
- type ColferError
- type ColferMax
- type ColferTail
- type PackBase
- func (this *PackBase) BalanceAdd(offset uint32, amount uint64, index uint32)
- func (this *PackBase) BalanceSub(offset uint32, amount uint64, index uint32)
- func (p *PackBase) Copy() *PackBase
- func (p *PackBase) FromPod(pod PackPod)
- func (this *PackBase) GetAccount(offset int) *Account
- func (this *PackBase) GetCumulativeDifficulty() *big.Int
- func (this *PackBase) GetHash() []byte
- func (this *PackBase) GetIndex() uint32
- func (this *PackBase) KeyChange(offset uint32, key *crypto.Public, index uint32, fee uint64)
- func (p *PackBase) Marshal() ([]byte, error)
- func (this *PackBase) Pod() *PackPod
- func (this *PackBase) ToBlob() []byte
- func (p *PackBase) Unmarshal(data []byte) (int, error)
- type PackPod
- type PublicPod
Constants ¶
This section is empty.
Variables ¶
var ( // ColferSizeMax is the upper limit for serial byte sizes. ColferSizeMax = 1024 * 1024 * 1024 // ColferListMax is the upper limit for the number of elements in a list. ColferListMax = 1024 * 1024 )
Colfer configuration attributes
Functions ¶
This section is empty.
Types ¶
type Account ¶
type Account struct {
// contains filtered or unexported fields
}
func NewAccount ¶
func (*Account) FromPod ¶
func (a *Account) FromPod(pod AccountPod)
func (*Account) GetBalance ¶
func (*Account) GetHashBuffer ¶
func (this *Account) GetHashBuffer() AccountHashBuffer
func (*Account) GetOperationsCount ¶
func (*Account) GetOperationsTotal ¶
func (*Account) GetPublicKey ¶
func (*Account) GetPublicKeySerialized ¶
func (this *Account) GetPublicKeySerialized() crypto.PublicSerialized
func (*Account) GetTimestamp ¶
func (*Account) GetUpdatedIndex ¶
func (*Account) Pod ¶
func (this *Account) Pod() *AccountPod
type AccountHashBuffer ¶
type AccountPod ¶
type AccountPod struct { Number uint32 PublicKey *PublicPod Balance uint64 UpdatedIndex uint32 Operations uint32 OperationsTotal uint32 Timestamp uint32 }
func (*AccountPod) MarshalBinary ¶
func (o *AccountPod) MarshalBinary() (data []byte, err error)
MarshalBinary encodes o as Colfer conform encoding.BinaryMarshaler. The error return option is accounter.ColferMax.
func (*AccountPod) MarshalLen ¶
func (o *AccountPod) MarshalLen() (int, error)
MarshalLen returns the Colfer serial byte size. The error return option is accounter.ColferMax.
func (*AccountPod) MarshalTo ¶
func (o *AccountPod) MarshalTo(buf []byte) int
MarshalTo encodes o as Colfer into buf and returns the number of bytes written. If the buffer is too small, MarshalTo will panic.
func (*AccountPod) Unmarshal ¶
func (o *AccountPod) Unmarshal(data []byte) (int, error)
Unmarshal decodes data as Colfer and returns the number of bytes read. The error return options are io.EOF, accounter.ColferError and accounter.ColferMax.
func (*AccountPod) UnmarshalBinary ¶
func (o *AccountPod) UnmarshalBinary(data []byte) error
UnmarshalBinary decodes data as Colfer conform encoding.BinaryUnmarshaler. The error return options are io.EOF, accounter.ColferError, accounter.ColferTail and accounter.ColferMax.
type Accounter ¶
type Accounter struct {
// contains filtered or unexported fields
}
func NewAccounter ¶
func NewAccounter() *Accounter
func (*Accounter) AppendPack ¶
func (*Accounter) BalanceAdd ¶
func (*Accounter) BalanceSub ¶
func (*Accounter) GetAccount ¶
func (*Accounter) GetAccountPackSerialized ¶
func (*Accounter) GetCumulativeDifficultyAndTimestamp ¶
func (*Accounter) GetUpdatedPacks ¶
type AccounterPod ¶
type AccounterPod struct {
Packs []*PackPod
}
func (*AccounterPod) MarshalBinary ¶
func (o *AccounterPod) MarshalBinary() (data []byte, err error)
MarshalBinary encodes o as Colfer conform encoding.BinaryMarshaler. All nil entries in o.Packs will be replaced with a new value. The error return option is accounter.ColferMax.
func (*AccounterPod) MarshalLen ¶
func (o *AccounterPod) MarshalLen() (int, error)
MarshalLen returns the Colfer serial byte size. The error return option is accounter.ColferMax.
func (*AccounterPod) MarshalTo ¶
func (o *AccounterPod) MarshalTo(buf []byte) int
MarshalTo encodes o as Colfer into buf and returns the number of bytes written. If the buffer is too small, MarshalTo will panic. All nil entries in o.Packs will be replaced with a new value.
func (*AccounterPod) Unmarshal ¶
func (o *AccounterPod) Unmarshal(data []byte) (int, error)
Unmarshal decodes data as Colfer and returns the number of bytes read. The error return options are io.EOF, accounter.ColferError and accounter.ColferMax.
func (*AccounterPod) UnmarshalBinary ¶
func (o *AccounterPod) UnmarshalBinary(data []byte) error
UnmarshalBinary decodes data as Colfer conform encoding.BinaryUnmarshaler. The error return options are io.EOF, accounter.ColferError, accounter.ColferTail and accounter.ColferMax.
type PackBase ¶
type PackBase struct {
// contains filtered or unexported fields
}
func NewPackWithAccounts ¶
func (*PackBase) BalanceAdd ¶
func (*PackBase) BalanceSub ¶
func (*PackBase) GetAccount ¶
func (*PackBase) GetCumulativeDifficulty ¶
type PackPod ¶
type PackPod struct { Accounts []*AccountPod CumulativeDifficulty []byte Dirty bool Hash []byte Index uint32 }
func (*PackPod) MarshalBinary ¶
MarshalBinary encodes o as Colfer conform encoding.BinaryMarshaler. All nil entries in o.Accounts will be replaced with a new value. The error return option is accounter.ColferMax.
func (*PackPod) MarshalLen ¶
MarshalLen returns the Colfer serial byte size. The error return option is accounter.ColferMax.
func (*PackPod) MarshalTo ¶
MarshalTo encodes o as Colfer into buf and returns the number of bytes written. If the buffer is too small, MarshalTo will panic. All nil entries in o.Accounts will be replaced with a new value.
func (*PackPod) Unmarshal ¶
Unmarshal decodes data as Colfer and returns the number of bytes read. The error return options are io.EOF, accounter.ColferError and accounter.ColferMax.
func (*PackPod) UnmarshalBinary ¶
UnmarshalBinary decodes data as Colfer conform encoding.BinaryUnmarshaler. The error return options are io.EOF, accounter.ColferError, accounter.ColferTail and accounter.ColferMax.
type PublicPod ¶
func (*PublicPod) MarshalBinary ¶
MarshalBinary encodes o as Colfer conform encoding.BinaryMarshaler. The error return option is accounter.ColferMax.
func (*PublicPod) MarshalLen ¶
MarshalLen returns the Colfer serial byte size. The error return option is accounter.ColferMax.
func (*PublicPod) MarshalTo ¶
MarshalTo encodes o as Colfer into buf and returns the number of bytes written. If the buffer is too small, MarshalTo will panic.
func (*PublicPod) Unmarshal ¶
Unmarshal decodes data as Colfer and returns the number of bytes read. The error return options are io.EOF, accounter.ColferError and accounter.ColferMax.
func (*PublicPod) UnmarshalBinary ¶
UnmarshalBinary decodes data as Colfer conform encoding.BinaryUnmarshaler. The error return options are io.EOF, accounter.ColferError, accounter.ColferTail and accounter.ColferMax.