Versions in this module Expand all Collapse all v0 v0.2.1 Oct 13, 2023 v0.2.0 Sep 27, 2023 Changes in this version + var ErrBlockHashIsNil = errors.New("block hash is nil") + var ErrBlockIsNil = errors.New("block is nil") + var ErrHashIsNil = errors.New("hash is nil") + var ErrInputRecordIsNil = errors.New("input record is nil") + var ErrInvalidBlockNumber = errors.New("invalid block number") + var ErrInvalidPartitionRound = errors.New("partition round is 0") + var ErrPreviousHashIsNil = errors.New("previous hash is nil") + var ErrRootValidatorInfoMissing = errors.New("root node info is missing") + var ErrSignerIsNil = errors.New("signer is nil") + var ErrSummaryValueIsNil = errors.New("summary value is nil") + var ErrUnicityCertificateIsNil = errors.New("unicity certificate is nil") + var ErrUnicitySealHashIsNil = errors.New("hash is nil") + var ErrUnicitySealIsNil = errors.New("unicity seal is nil") + var ErrUnicitySealSignatureIsNil = errors.New("no signatures") + var ErrUnicityTreeCertificateIsNil = errors.New("unicity tree certificate is nil") + var ErrUnknownSigner = errors.New("unknown signer") + func CheckNonEquivocatingCertificates(prevUC, newUC *UnicityCertificate) error + func NewTxProof(block *Block, txIndex int, algorithm crypto.Hash) (*TxProof, *TransactionRecord, error) + func VerifyTxProof(proof *TxProof, txRecord *TransactionRecord, ...) error + type Block struct + Header *Header + Transactions []*TransactionRecord + UnicityCertificate *UnicityCertificate + func (b *Block) GetProposerID() string + func (b *Block) GetRoundNumber() uint64 + func (b *Block) Hash(algorithm crypto.Hash) ([]byte, error) + func (b *Block) HeaderHash(algorithm crypto.Hash) []byte + func (b *Block) IsValid(v func(uc *UnicityCertificate) error) error + func (b *Block) SystemID() SystemID + type ClientMetadata struct + FeeCreditRecordID []byte + MaxTransactionFee uint64 + Timeout uint64 + type GenericChainItem struct + Hash []byte + Left bool + type Header struct + PreviousBlockHash []byte + ProposerID string + ShardID []byte + SystemID SystemID + func (h *Header) Hash(algorithm crypto.Hash) []byte + type InputRecord struct + BlockHash []byte + Hash []byte + PreviousHash []byte + RoundNumber uint64 + SumOfEarnedFees uint64 + SummaryValue []byte + func (x *InputRecord) AddToHasher(hasher hash.Hash) + func (x *InputRecord) Bytes() []byte + func (x *InputRecord) IsValid() error + func (x *InputRecord) NewRepeatIR() *InputRecord + type Payload struct + Attributes RawCBOR + ClientMetadata *ClientMetadata + SystemID SystemID + Type string + UnitID UnitID + func (p *Payload) Bytes() ([]byte, error) + func (p *Payload) BytesWithAttributeSigBytes(attrs SigBytesProvider) ([]byte, error) + func (p *Payload) UnmarshalAttributes(v any) error + type RawCBOR []byte + func (r *RawCBOR) UnmarshalCBOR(data []byte) error + func (r RawCBOR) MarshalCBOR() ([]byte, error) + type ServerMetadata struct + ActualFee uint64 + ProcessingDetails RawCBOR + SuccessIndicator TxStatus + TargetUnits []UnitID + func (sm *ServerMetadata) GetActualFee() uint64 + func (sm *ServerMetadata) UnmarshalDetails(v any) error + type SigBytesProvider interface + SigBytes func() ([]byte, error) + type SystemID []byte + type TransactionOrder struct + FeeProof []byte + OwnerProof []byte + Payload *Payload + func (t *TransactionOrder) GetClientFeeCreditRecordID() []byte + func (t *TransactionOrder) GetClientMaxTxFee() uint64 + func (t *TransactionOrder) Hash(algorithm crypto.Hash) []byte + func (t *TransactionOrder) PayloadBytes() ([]byte, error) + func (t *TransactionOrder) PayloadType() string + func (t *TransactionOrder) SystemID() []byte + func (t *TransactionOrder) Timeout() uint64 + func (t *TransactionOrder) UnitID() UnitID + func (t *TransactionOrder) UnmarshalAttributes(v any) error + type TransactionRecord struct + ServerMetadata *ServerMetadata + TransactionOrder *TransactionOrder + func (t *TransactionRecord) Bytes() ([]byte, error) + func (t *TransactionRecord) Hash(algorithm crypto.Hash) []byte + func (t *TransactionRecord) UnmarshalProcessingDetails(v any) error + type TxProof struct + BlockHeaderHash []byte + Chain []*GenericChainItem + UnicityCertificate *UnicityCertificate + func (p *TxProof) GetUnicityTreeSystemDescriptionHash() []byte + type TxStatus uint64 + const TxStatusFailed + const TxStatusSuccessful + type UnicityCertificate struct + InputRecord *InputRecord + UnicitySeal *UnicitySeal + UnicityTreeCertificate *UnicityTreeCertificate + func (x *UnicityCertificate) AddToHasher(hasher hash.Hash) + func (x *UnicityCertificate) Bytes() []byte + func (x *UnicityCertificate) GetRootRoundNumber() uint64 + func (x *UnicityCertificate) GetRoundNumber() uint64 + func (x *UnicityCertificate) GetStateHash() []byte + func (x *UnicityCertificate) IsRepeat(prevUC *UnicityCertificate) bool + func (x *UnicityCertificate) IsValid(verifiers map[string]crypto.Verifier, algorithm gocrypto.Hash, ...) error + type UnicitySeal struct + Hash []byte + PreviousHash []byte + RootChainRoundNumber uint64 + Signatures map[string][]byte + Timestamp uint64 + func (x *UnicitySeal) AddToHasher(hasher hash.Hash) + func (x *UnicitySeal) Bytes() []byte + func (x *UnicitySeal) IsValid(verifiers map[string]crypto.Verifier) error + func (x *UnicitySeal) Sign(id string, signer crypto.Signer) error + func (x *UnicitySeal) Verify(verifiers map[string]crypto.Verifier) error + type UnicityTreeCertificate struct + SiblingHashes [][]byte + SystemDescriptionHash []byte + SystemIdentifier SystemID + func (x *UnicityTreeCertificate) AddToHasher(hasher hash.Hash) + func (x *UnicityTreeCertificate) Bytes() []byte + func (x *UnicityTreeCertificate) GetAuthPath(leafHash []byte, hashAlgorithm gocrypto.Hash) ([]byte, error) + func (x *UnicityTreeCertificate) IsValid(systemIdentifier, systemDescriptionHash []byte) error + type UnitID []byte + func NewUnitID(unitIDLength int, shardPart []byte, unitPart []byte, typePart []byte) UnitID + func (uid UnitID) Compare(key UnitID) int + func (uid UnitID) Eq(id UnitID) bool + func (uid UnitID) HasType(typePart []byte) bool + func (uid UnitID) String() string