internal

package
v2.0.0-alpha Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2019 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Block

type Block struct {
	Num uint64
	Txs []*Transaction
}

Block is used to used to hold the information from its proto format to a structure that is more suitable/friendly for validation

type PubAndHashUpdates

type PubAndHashUpdates struct {
	PubUpdates  *privacyenabledstate.PubUpdateBatch
	HashUpdates *privacyenabledstate.HashedUpdateBatch
}

PubAndHashUpdates encapsulates public and hash updates. The intended use of this to hold the updates that are to be applied to the statedb as a result of the block commit

func NewPubAndHashUpdates

func NewPubAndHashUpdates() *PubAndHashUpdates

NewPubAndHashUpdates constructs an empty PubAndHashUpdates

func (*PubAndHashUpdates) ApplyWriteSet

func (u *PubAndHashUpdates) ApplyWriteSet(
	txRWSet *rwsetutil.TxRwSet,
	txHeight *version.Height,
	db privacyenabledstate.DB,
	containsPostOrderWrites bool,
) error

ApplyWriteSet adds (or deletes) the key/values present in the write set to the PubAndHashUpdates

type Transaction

type Transaction struct {
	IndexInBlock            int
	ID                      string
	RWSet                   *rwsetutil.TxRwSet
	ValidationCode          peer.TxValidationCode
	ContainsPostOrderWrites bool
}

Transaction is used to hold the information from its proto format to a structure that is more suitable/friendly for validation

func (*Transaction) ContainsPvtWrites

func (t *Transaction) ContainsPvtWrites() bool

ContainsPvtWrites returns true if this transaction is not limited to affecting the public data only

func (*Transaction) RetrieveHash

func (t *Transaction) RetrieveHash(ns string, coll string) []byte

RetrieveHash returns the hash of the private write-set present in the public data for a given namespace-collection

type Validator

type Validator interface {
	ValidateAndPrepareBatch(block *Block, doMVCCValidation bool) (*PubAndHashUpdates, error)
}

Validator is supposed to validate the transactions based on public data and hashes present in a block and returns a batch that should be used to update the state

Jump to

Keyboard shortcuts

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