CovenantSQL: github.com/CovenantSQL/CovenantSQL/xenomint/types Index | Files

package types

import "github.com/CovenantSQL/CovenantSQL/xenomint/types"

Index

Package Files

block.go block_gen.go common.go common_gen.go doc.go errors.go

Variables

var (
    // ErrMerkleRootNotMatch indicates the merkle root not match error from verifier.
    ErrMerkleRootNotMatch = errors.New("merkle root not match")
    // ErrHashValueNotMatch indicates the hash value not match error from verifier.
    ErrHashValueNotMatch = errors.New("hash value not match")
    // ErrSignatureNotMatch indicates the signature not match error from verifier.
    ErrSignatureNotMatch = errors.New("signature not match")
)

type Block Uses

type Block struct {
    SignedBlockHeader
    ReadQueries  []*types.Ack
    WriteQueries []*types.Ack
}

Block defines a block including a signed block header and its query list.

func (*Block) MarshalHash Uses

func (z *Block) MarshalHash() (o []byte, err error)

MarshalHash marshals for hash

func (*Block) Msgsize Uses

func (z *Block) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*Block) Sign Uses

func (b *Block) Sign(signer *asymmetric.PrivateKey) (err error)

Sign signs the block.

func (*Block) Verify Uses

func (b *Block) Verify() error

Verify verifies the block.

type BlockHeader Uses

type BlockHeader struct {
    Version     int32
    Producer    proto.NodeID
    GenesisHash hash.Hash
    ParentHash  hash.Hash
    MerkleRoot  hash.Hash
    Timestamp   time.Time
}

BlockHeader defines a block header.

func (*BlockHeader) MarshalHash Uses

func (z *BlockHeader) MarshalHash() (o []byte, err error)

MarshalHash marshals for hash

func (*BlockHeader) Msgsize Uses

func (z *BlockHeader) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

type DefaultHashSignVerifierImpl Uses

type DefaultHashSignVerifierImpl struct {
    DataHash  hash.Hash
    Signee    *asymmetric.PublicKey
    Signature *asymmetric.Signature
}

DefaultHashSignVerifierImpl defines a default implementation of hashSignVerifier.

func (*DefaultHashSignVerifierImpl) Hash Uses

func (i *DefaultHashSignVerifierImpl) Hash() hash.Hash

Hash implements hashSignVerifier.Hash.

func (*DefaultHashSignVerifierImpl) MarshalHash Uses

func (z *DefaultHashSignVerifierImpl) MarshalHash() (o []byte, err error)

MarshalHash marshals for hash

func (*DefaultHashSignVerifierImpl) Msgsize Uses

func (z *DefaultHashSignVerifierImpl) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*DefaultHashSignVerifierImpl) Sign Uses

func (i *DefaultHashSignVerifierImpl) Sign(
    obj marshalHasher, signer *asymmetric.PrivateKey) (err error,
)

Sign implements hashSignVerifier.Sign.

func (*DefaultHashSignVerifierImpl) Verify Uses

func (i *DefaultHashSignVerifierImpl) Verify(obj marshalHasher) (err error)

Verify implements hashSignVerifier.Verify.

type SignedBlockHeader Uses

type SignedBlockHeader struct {
    BlockHeader
    DefaultHashSignVerifierImpl
}

SignedBlockHeader defines a block along with its hasher, signer and verifier.

func (*SignedBlockHeader) MarshalHash Uses

func (z *SignedBlockHeader) MarshalHash() (o []byte, err error)

MarshalHash marshals for hash

func (*SignedBlockHeader) Msgsize Uses

func (z *SignedBlockHeader) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*SignedBlockHeader) Sign Uses

func (h *SignedBlockHeader) Sign(signer *asymmetric.PrivateKey) error

Sign signs the block header.

func (*SignedBlockHeader) Verify Uses

func (h *SignedBlockHeader) Verify() error

Verify verifies the block header.

Package types imports 8 packages (graph). Updated 2019-03-11. Refresh now. Tools for package owners.