validator

package
v1.28.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	FabricRuleAddr    = "0x00000000000000000000000000000000000000a0"
	SimFabricRuleAddr = "0x00000000000000000000000000000000000000a1"
	HappyRuleAddr     = "0x00000000000000000000000000000000000000a2"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ECDSASignature

type ECDSASignature struct {
	R, S *big.Int
}

type Engine

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

Engine runs for validation

type FabSimValidator

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

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

func NewFabSimValidator

func NewFabSimValidator(logger logrus.FieldLogger) *FabSimValidator

New a validator instance

func (*FabSimValidator) Verify

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

Verify will check whether the transaction info is valid

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) EvaluateSignedData

func (vlt *FabV14Validator) EvaluateSignedData(signedData []*protoutil.SignedData, identityDeserializer mspi.IdentityDeserializer, policy policies.Policy) (bool, uint64, error)

func (*FabV14Validator) Verify

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

Verify will check whether the transaction info is valid

type HappyValidator added in v1.20.0

type HappyValidator struct {
}

func (*HappyValidator) Verify added in v1.20.0

func (h *HappyValidator) Verify(from string, proof, payload []byte, validators string) (bool, uint64, error)

type Ledger

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

type ValidationEngine

type ValidationEngine struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

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

func NewValidationEngine

func NewValidationEngine(ledger Ledger, instances *sync.Map, logger logrus.FieldLogger, gasLimit uint64) *ValidationEngine

New a validator instance

func (*ValidationEngine) Validate

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

Verify will check whether the transaction info is valid

type Validator

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

Validator chooses specific method to verify transaction

type ValidatorPool added in v1.20.0

type ValidatorPool struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewValidationPool added in v1.20.0

func NewValidationPool(size int) *ValidatorPool

func (*ValidatorPool) Add added in v1.20.0

func (pool *ValidatorPool) Add(validator Validator)

func (*ValidatorPool) GetValidator added in v1.20.0

func (pool *ValidatorPool) GetValidator() Validator

func (*ValidatorPool) SetValidator added in v1.20.0

func (pool *ValidatorPool) SetValidator(vlt Validator)

type ValidatorPools added in v1.20.0

type ValidatorPools struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewValidationPools added in v1.20.0

func NewValidationPools() *ValidatorPools

func (*ValidatorPools) GetPool added in v1.20.0

func (p *ValidatorPools) GetPool(address string) (*ValidatorPool, bool)

func (*ValidatorPools) SetPool added in v1.20.0

func (p *ValidatorPools) SetPool(address string, pool *ValidatorPool)

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(code []byte, logger logrus.FieldLogger, gasLimit uint64) *WasmValidator

New a validator instance

func (*WasmValidator) Verify

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

Verify will check whether the transaction info is valid

Directories

Path Synopsis
Package mock_validator is a generated GoMock package.
Package mock_validator is a generated GoMock package.

Jump to

Keyboard shortcuts

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