entryCreditBlock

package
v0.0.0-...-303b437 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2019 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 4 more Imports: 8 Imported by: 2 modules, 11 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	// CommitChainSize = 1+6+32+32+32+1+32+64
	CommitChainSize int = 200
)
View Source
const (
	// CommitEntrySize = 1 + 6 + 32 + 1 + 32 + 64
	CommitEntrySize int = 136
)
View Source
const (
	MinuteNumberSize = 1
)
View Source
const (
	ServerIndexNumberSize = 1
)

Variables

This section is empty.

Functions

func NewECBlock

func NewECBlock() interfaces.IEntryCreditBlock

func NewECBlockBody

func NewECBlockBody() interfaces.IECBlockBody

func UnmarshalECBlock

func UnmarshalECBlock(data []byte) (interfaces.IEntryCreditBlock, error)

Types

type CommitChain

type CommitChain struct {
	Version     uint8                   `json:"version"`
	MilliTime   *primitives.ByteSlice6  `json:"millitime"`
	ChainIDHash interfaces.IHash        `json:"chainidhash"`
	Weld        interfaces.IHash        `json:"weld"`
	EntryHash   interfaces.IHash        `json:"entryhash"`
	Credits     uint8                   `json:"credits"`
	ECPubKey    *primitives.ByteSlice32 `json:"ecpubkey"`
	Sig         *primitives.ByteSlice64 `json:"sig"`
}

func NewCommitChain

func NewCommitChain() *CommitChain

func (*CommitChain) CommitMsg

func (c *CommitChain) CommitMsg() []byte

CommitMsg returns the binary marshalled message section of the CommitEntry that is covered by the CommitEntry.Sig.

func (*CommitChain) ECID

func (c *CommitChain) ECID() byte

func (*CommitChain) GetEntryHash

func (a *CommitChain) GetEntryHash() (rval interfaces.IHash)

func (*CommitChain) GetHash

func (c *CommitChain) GetHash() (rval interfaces.IHash)

func (*CommitChain) GetSigHash

func (c *CommitChain) GetSigHash() (rval interfaces.IHash)

func (*CommitChain) GetTimestamp

func (c *CommitChain) GetTimestamp() interfaces.Timestamp

Return the timestamp

func (*CommitChain) Hash

func (e *CommitChain) Hash() (rval interfaces.IHash)

func (*CommitChain) Init

func (e *CommitChain) Init()

func (*CommitChain) Interpret

func (b *CommitChain) Interpret() string

func (*CommitChain) IsInterpretable

func (b *CommitChain) IsInterpretable() bool

func (*CommitChain) IsSameAs

func (a *CommitChain) IsSameAs(b interfaces.IECBlockEntry) bool

this function only checks if everything in the item is identical. It does not catch if the private key holder has created a malleated version which is functionally identical in come cases from the protocol perspective, but would fail comparison here

func (*CommitChain) IsValid

func (c *CommitChain) IsValid() bool

func (*CommitChain) JSONByte

func (e *CommitChain) JSONByte() ([]byte, error)

func (*CommitChain) JSONString

func (e *CommitChain) JSONString() (string, error)

func (*CommitChain) MarshalBinary

func (c *CommitChain) MarshalBinary() (rval []byte, err error)

func (*CommitChain) MarshalBinarySig

func (c *CommitChain) MarshalBinarySig() (rval []byte, err error)

func (*CommitChain) MarshalBinaryTransaction

func (c *CommitChain) MarshalBinaryTransaction() (rval []byte, err error)

Transaction hash of chain commit. (version through pub key hashed)

func (*CommitChain) Sign

func (c *CommitChain) Sign(privateKey []byte) error

func (*CommitChain) String

func (e *CommitChain) String() string

func (*CommitChain) UnmarshalBinary

func (c *CommitChain) UnmarshalBinary(data []byte) (err error)

func (*CommitChain) UnmarshalBinaryData

func (c *CommitChain) UnmarshalBinaryData(data []byte) ([]byte, error)

func (*CommitChain) ValidateSignatures

func (c *CommitChain) ValidateSignatures() error

type CommitEntry

type CommitEntry struct {
	Version   uint8                   `json:"version"`
	MilliTime *primitives.ByteSlice6  `json:"millitime"`
	EntryHash interfaces.IHash        `json:"entryhash"`
	Credits   uint8                   `json:"credits"`
	ECPubKey  *primitives.ByteSlice32 `json:"ecpubkey"`
	Sig       *primitives.ByteSlice64 `json:"sig"`
}

func NewCommitEntry

func NewCommitEntry() *CommitEntry

func (*CommitEntry) CommitMsg

func (c *CommitEntry) CommitMsg() []byte

CommitMsg returns the binary marshalled message section of the CommitEntry that is covered by the CommitEntry.Sig.

func (*CommitEntry) ECID

func (c *CommitEntry) ECID() byte

func (*CommitEntry) GetEntryHash

func (a *CommitEntry) GetEntryHash() (rval interfaces.IHash)

func (*CommitEntry) GetHash

func (c *CommitEntry) GetHash() (rval interfaces.IHash)

func (*CommitEntry) GetSigHash

func (c *CommitEntry) GetSigHash() (rval interfaces.IHash)

func (*CommitEntry) GetTimestamp

func (c *CommitEntry) GetTimestamp() interfaces.Timestamp

Return the timestamp

func (*CommitEntry) Hash

func (e *CommitEntry) Hash() (rval interfaces.IHash)

func (*CommitEntry) Init

func (e *CommitEntry) Init()

func (*CommitEntry) Interpret

func (b *CommitEntry) Interpret() string

func (*CommitEntry) IsInterpretable

func (b *CommitEntry) IsInterpretable() bool

func (*CommitEntry) IsSameAs

func (a *CommitEntry) IsSameAs(b interfaces.IECBlockEntry) bool

this function only checks if everything in the item is identical. It does not catch if the private key holder has created a malleated version which is functionally identical in come cases from the protocol perspective, but would fail comparison here

func (*CommitEntry) IsValid

func (c *CommitEntry) IsValid() bool

func (*CommitEntry) JSONByte

func (e *CommitEntry) JSONByte() ([]byte, error)

func (*CommitEntry) JSONString

func (e *CommitEntry) JSONString() (string, error)

func (*CommitEntry) MarshalBinary

func (c *CommitEntry) MarshalBinary() (rval []byte, err error)

func (*CommitEntry) MarshalBinarySig

func (c *CommitEntry) MarshalBinarySig() (rval []byte, err error)

func (*CommitEntry) MarshalBinaryTransaction

func (c *CommitEntry) MarshalBinaryTransaction() (rval []byte, err error)

Transaction hash of entry commit. (version through pub key hashed)

func (*CommitEntry) Sign

func (c *CommitEntry) Sign(privateKey []byte) error

func (*CommitEntry) String

func (e *CommitEntry) String() string

func (*CommitEntry) UnmarshalBinary

func (c *CommitEntry) UnmarshalBinary(data []byte) (err error)

func (*CommitEntry) UnmarshalBinaryData

func (c *CommitEntry) UnmarshalBinaryData(data []byte) ([]byte, error)

func (*CommitEntry) ValidateSignatures

func (c *CommitEntry) ValidateSignatures() error

type ECBlock

type ECBlock struct {
	Header interfaces.IECBlockHeader `json:"header"`
	Body   interfaces.IECBlockBody   `json:"body"`
}

The Entry Credit Block consists of a header and a body. The body is composed of primarily Commits and Balance Increases with Minute Markers and Server Markers distributed throughout.

func (*ECBlock) AddEntry

func (e *ECBlock) AddEntry(entries ...interfaces.IECBlockEntry)

func (*ECBlock) BuildHeader

func (e *ECBlock) BuildHeader() error

func (*ECBlock) DatabasePrimaryIndex

func (c *ECBlock) DatabasePrimaryIndex() (rval interfaces.IHash)

func (*ECBlock) DatabaseSecondaryIndex

func (c *ECBlock) DatabaseSecondaryIndex() (rval interfaces.IHash)

func (*ECBlock) GetBody

func (c *ECBlock) GetBody() interfaces.IECBlockBody

func (*ECBlock) GetChainID

func (c *ECBlock) GetChainID() (rval interfaces.IHash)

func (*ECBlock) GetDatabaseHeight

func (c *ECBlock) GetDatabaseHeight() uint32

func (*ECBlock) GetEntries

func (c *ECBlock) GetEntries() []interfaces.IECBlockEntry

func (*ECBlock) GetEntryByHash

func (c *ECBlock) GetEntryByHash(hash interfaces.IHash) interfaces.IECBlockEntry

func (*ECBlock) GetEntryHashes

func (c *ECBlock) GetEntryHashes() []interfaces.IHash

func (*ECBlock) GetEntrySigHashes

func (c *ECBlock) GetEntrySigHashes() []interfaces.IHash

func (*ECBlock) GetFullHash

func (e *ECBlock) GetFullHash() (interfaces.IHash, error)

This is the FullHash.

func (*ECBlock) GetHash

func (e *ECBlock) GetHash() (rval interfaces.IHash)

func (*ECBlock) GetHeader

func (c *ECBlock) GetHeader() interfaces.IECBlockHeader

func (*ECBlock) HeaderHash

func (e *ECBlock) HeaderHash() (interfaces.IHash, error)

func (*ECBlock) Init

func (c *ECBlock) Init()

func (*ECBlock) IsSameAs

func (a *ECBlock) IsSameAs(b interfaces.IEntryCreditBlock) bool

func (*ECBlock) JSONByte

func (e *ECBlock) JSONByte() ([]byte, error)

func (*ECBlock) JSONString

func (e *ECBlock) JSONString() (string, error)

func (*ECBlock) MarshalBinary

func (e *ECBlock) MarshalBinary() (rval []byte, err error)

func (*ECBlock) New

func (*ECBlock) String

func (c *ECBlock) String() string

func (*ECBlock) UnmarshalBinary

func (e *ECBlock) UnmarshalBinary(data []byte) (err error)

func (*ECBlock) UnmarshalBinaryData

func (e *ECBlock) UnmarshalBinaryData(data []byte) ([]byte, error)

func (*ECBlock) UpdateState

func (c *ECBlock) UpdateState(state interfaces.IState) error

type ECBlockBody

type ECBlockBody struct {
	Entries []interfaces.IECBlockEntry `json:"entries"`
}

func (*ECBlockBody) AddEntry

func (e *ECBlockBody) AddEntry(entry interfaces.IECBlockEntry)

func (*ECBlockBody) GetEntries

func (e *ECBlockBody) GetEntries() []interfaces.IECBlockEntry

func (*ECBlockBody) IsSameAs

func (a *ECBlockBody) IsSameAs(b interfaces.IECBlockBody) bool

func (*ECBlockBody) JSONByte

func (e *ECBlockBody) JSONByte() ([]byte, error)

func (*ECBlockBody) JSONString

func (e *ECBlockBody) JSONString() (string, error)

func (*ECBlockBody) SetEntries

func (e *ECBlockBody) SetEntries(entries []interfaces.IECBlockEntry)

func (*ECBlockBody) String

func (e *ECBlockBody) String() string

type ECBlockHeader

type ECBlockHeader struct {
	BodyHash            interfaces.IHash `json:"bodyhash"`
	PrevHeaderHash      interfaces.IHash `json:"prevheaderhash"`
	PrevFullHash        interfaces.IHash `json:"prevfullhash"`
	DBHeight            uint32           `json:"dbheight"`
	HeaderExpansionArea []byte           `json:"headerexpansionarea"`
	ObjectCount         uint64           `json:"objectcount"`
	BodySize            uint64           `json:"bodysize"`
}

func NewECBlockHeader

func NewECBlockHeader() *ECBlockHeader

func (*ECBlockHeader) GetBodyHash

func (e *ECBlockHeader) GetBodyHash() (rval interfaces.IHash)

func (*ECBlockHeader) GetBodySize

func (e *ECBlockHeader) GetBodySize() uint64

func (*ECBlockHeader) GetDBHeight

func (e *ECBlockHeader) GetDBHeight() (height uint32)

func (*ECBlockHeader) GetECChainID

func (e *ECBlockHeader) GetECChainID() (rval interfaces.IHash)

func (*ECBlockHeader) GetHeaderExpansionArea

func (e *ECBlockHeader) GetHeaderExpansionArea() (area []byte)

func (*ECBlockHeader) GetObjectCount

func (e *ECBlockHeader) GetObjectCount() uint64

func (*ECBlockHeader) GetPrevFullHash

func (e *ECBlockHeader) GetPrevFullHash() (rval interfaces.IHash)

func (*ECBlockHeader) GetPrevHeaderHash

func (e *ECBlockHeader) GetPrevHeaderHash() (rval interfaces.IHash)

func (*ECBlockHeader) Init

func (c *ECBlockHeader) Init()

func (*ECBlockHeader) IsSameAs

func (*ECBlockHeader) JSONByte

func (e *ECBlockHeader) JSONByte() ([]byte, error)

func (*ECBlockHeader) JSONString

func (e *ECBlockHeader) JSONString() (string, error)

func (*ECBlockHeader) MarshalBinary

func (e *ECBlockHeader) MarshalBinary() (rval []byte, err error)

func (ECBlockHeader) MarshalJSON

func (e ECBlockHeader) MarshalJSON() ([]byte, error)

func (*ECBlockHeader) SetBodyHash

func (e *ECBlockHeader) SetBodyHash(prev interfaces.IHash)

func (*ECBlockHeader) SetBodySize

func (e *ECBlockHeader) SetBodySize(cnt uint64)

func (*ECBlockHeader) SetDBHeight

func (e *ECBlockHeader) SetDBHeight(height uint32)

func (*ECBlockHeader) SetHeaderExpansionArea

func (e *ECBlockHeader) SetHeaderExpansionArea(area []byte)

func (*ECBlockHeader) SetObjectCount

func (e *ECBlockHeader) SetObjectCount(cnt uint64)

func (*ECBlockHeader) SetPrevFullHash

func (e *ECBlockHeader) SetPrevFullHash(prev interfaces.IHash)

func (*ECBlockHeader) SetPrevHeaderHash

func (e *ECBlockHeader) SetPrevHeaderHash(prev interfaces.IHash)

func (*ECBlockHeader) String

func (e *ECBlockHeader) String() string

func (*ECBlockHeader) UnmarshalBinary

func (e *ECBlockHeader) UnmarshalBinary(data []byte) error

func (*ECBlockHeader) UnmarshalBinaryData

func (e *ECBlockHeader) UnmarshalBinaryData(data []byte) ([]byte, error)

type ExpandedECBlockHeader

type ExpandedECBlockHeader ECBlockHeader

type IncreaseBalance

type IncreaseBalance struct {
	ECPubKey *primitives.ByteSlice32 `json:"ecpubkey"`
	TXID     interfaces.IHash        `json:"txid"`
	Index    uint64                  `json:"index"`
	NumEC    uint64                  `json:"numec"`
}

func NewIncreaseBalance

func NewIncreaseBalance() *IncreaseBalance

func (*IncreaseBalance) ECID

func (b *IncreaseBalance) ECID() byte

func (*IncreaseBalance) GetEntryHash

func (a *IncreaseBalance) GetEntryHash() (rval interfaces.IHash)

func (*IncreaseBalance) GetHash

func (e *IncreaseBalance) GetHash() (rval interfaces.IHash)

func (*IncreaseBalance) GetSigHash

func (e *IncreaseBalance) GetSigHash() (rval interfaces.IHash)

func (*IncreaseBalance) GetTimestamp

func (e *IncreaseBalance) GetTimestamp() interfaces.Timestamp

func (*IncreaseBalance) Hash

func (e *IncreaseBalance) Hash() (rval interfaces.IHash)

func (*IncreaseBalance) Init

func (e *IncreaseBalance) Init()

func (*IncreaseBalance) Interpret

func (b *IncreaseBalance) Interpret() string

func (*IncreaseBalance) IsInterpretable

func (b *IncreaseBalance) IsInterpretable() bool

func (*IncreaseBalance) IsSameAs

func (*IncreaseBalance) JSONByte

func (e *IncreaseBalance) JSONByte() ([]byte, error)

func (*IncreaseBalance) JSONString

func (e *IncreaseBalance) JSONString() (string, error)

func (*IncreaseBalance) MarshalBinary

func (b *IncreaseBalance) MarshalBinary() (rval []byte, err error)

func (*IncreaseBalance) String

func (e *IncreaseBalance) String() string

func (*IncreaseBalance) UnmarshalBinary

func (b *IncreaseBalance) UnmarshalBinary(data []byte) (err error)

func (*IncreaseBalance) UnmarshalBinaryData

func (b *IncreaseBalance) UnmarshalBinaryData(data []byte) ([]byte, error)

type MinuteNumber

type MinuteNumber struct {
	Number uint8 `json:"number"`
}

func NewMinuteNumber

func NewMinuteNumber(number uint8) *MinuteNumber

func (*MinuteNumber) ECID

func (m *MinuteNumber) ECID() byte

func (*MinuteNumber) GetEntryHash

func (a *MinuteNumber) GetEntryHash() (rval interfaces.IHash)

func (*MinuteNumber) GetHash

func (e *MinuteNumber) GetHash() (rval interfaces.IHash)

func (*MinuteNumber) GetSigHash

func (e *MinuteNumber) GetSigHash() (rval interfaces.IHash)

func (*MinuteNumber) GetTimestamp

func (e *MinuteNumber) GetTimestamp() interfaces.Timestamp

func (*MinuteNumber) Hash

func (e *MinuteNumber) Hash() (rval interfaces.IHash)

func (*MinuteNumber) Interpret

func (b *MinuteNumber) Interpret() string

func (*MinuteNumber) IsInterpretable

func (b *MinuteNumber) IsInterpretable() bool

func (*MinuteNumber) IsSameAs

func (a *MinuteNumber) IsSameAs(b interfaces.IECBlockEntry) bool

func (*MinuteNumber) JSONByte

func (e *MinuteNumber) JSONByte() ([]byte, error)

func (*MinuteNumber) JSONString

func (e *MinuteNumber) JSONString() (string, error)

func (*MinuteNumber) MarshalBinary

func (m *MinuteNumber) MarshalBinary() (rval []byte, err error)

func (*MinuteNumber) String

func (e *MinuteNumber) String() string

func (*MinuteNumber) UnmarshalBinary

func (m *MinuteNumber) UnmarshalBinary(data []byte) (err error)

func (*MinuteNumber) UnmarshalBinaryData

func (m *MinuteNumber) UnmarshalBinaryData(data []byte) ([]byte, error)

type ServerIndexNumber

type ServerIndexNumber struct {
	ServerIndexNumber uint8 `json:"serverindexnumber"`
}

func NewServerIndexNumber

func NewServerIndexNumber() *ServerIndexNumber

func NewServerIndexNumber2

func NewServerIndexNumber2(number uint8) *ServerIndexNumber

func (*ServerIndexNumber) ECID

func (s *ServerIndexNumber) ECID() byte

func (*ServerIndexNumber) GetEntryHash

func (a *ServerIndexNumber) GetEntryHash() (rval interfaces.IHash)

func (*ServerIndexNumber) GetHash

func (e *ServerIndexNumber) GetHash() (rval interfaces.IHash)

func (*ServerIndexNumber) GetSigHash

func (e *ServerIndexNumber) GetSigHash() (rval interfaces.IHash)

func (*ServerIndexNumber) GetTimestamp

func (e *ServerIndexNumber) GetTimestamp() interfaces.Timestamp

func (*ServerIndexNumber) Hash

func (e *ServerIndexNumber) Hash() (rval interfaces.IHash)

func (*ServerIndexNumber) Interpret

func (b *ServerIndexNumber) Interpret() string

func (*ServerIndexNumber) IsInterpretable

func (b *ServerIndexNumber) IsInterpretable() bool

func (*ServerIndexNumber) IsSameAs

func (*ServerIndexNumber) JSONByte

func (e *ServerIndexNumber) JSONByte() ([]byte, error)

func (*ServerIndexNumber) JSONString

func (e *ServerIndexNumber) JSONString() (string, error)

func (*ServerIndexNumber) MarshalBinary

func (s *ServerIndexNumber) MarshalBinary() (rval []byte, err error)

func (*ServerIndexNumber) String

func (e *ServerIndexNumber) String() string

func (*ServerIndexNumber) UnmarshalBinary

func (s *ServerIndexNumber) UnmarshalBinary(data []byte) (err error)

func (*ServerIndexNumber) UnmarshalBinaryData

func (s *ServerIndexNumber) UnmarshalBinaryData(data []byte) ([]byte, error)

Jump to

Keyboard shortcuts

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