validator

package
v0.1.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2020 License: Apache-2.0 Imports: 8 Imported by: 5

Documentation

Index

Constants

View Source
const (
	FabricRuleAddr = "0x00000000000000000000000000000000000000a0"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Engine

type Engine interface {
	Validate(address, from string, proof, payload []byte, validators string) (bool, error)
}

Engine runs for validation

type FabV14Validator

type FabV14Validator struct {
	// contains filtered or unexported fields
}

Validator is the instance that can use wasm to verify transaction validity

func NewFabV14Validator

func NewFabV14Validator(logger logrus.FieldLogger) *FabV14Validator

New a validator instance

func (*FabV14Validator) Verify

func (vlt *FabV14Validator) Verify(address, from string, proof, payload []byte, validators string) (bool, error)

Verify will check whether the transaction info is valid

type Ledger

type Ledger interface {
	// GetCode
	GetCode(types.Address) []byte
}

type ValidationEngine

type ValidationEngine struct {
	// contains filtered or unexported fields
}

Validator is the instance that can use wasm to verify transaction validity

func NewValidationEngine

func NewValidationEngine(ledger Ledger, logger logrus.FieldLogger) *ValidationEngine

New a validator instance

func (*ValidationEngine) Validate

func (ve *ValidationEngine) Validate(address, from string, proof, payload []byte, validators string) (bool, error)

Verify will check whether the transaction info is valid

type Validator

type Validator interface {
	Verify(address, from string, proof, payload []byte, validators string) (bool, error)
}

Validator chooses specific method to verify transaction

type WasmValidator

type WasmValidator struct {
	// contains filtered or unexported fields
}

Validator is the instance that can use wasm to verify transaction validity

func NewWasmValidator

func NewWasmValidator(ledger Ledger, logger logrus.FieldLogger) *WasmValidator

New a validator instance

func (*WasmValidator) Verify

func (vlt *WasmValidator) Verify(address, from string, proof, payload []byte, validators string) (bool, error)

Verify will check whether the transaction info is valid

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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