valinternal

package
v0.0.0-...-d1c7554 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2019 License: Apache-2.0 Imports: 4 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 InternalValidator

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

InternalValidator 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

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)

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
}

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

Jump to

Keyboard shortcuts

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