validator

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2023 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Copyright IBM Corp. All Rights Reserved.

SPDX-License-Identifier: Apache-2.0

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TransferHTLCValidate

func TransferHTLCValidate(ctx *Context) error

func TransferSignatureValidate

func TransferSignatureValidate(ctx *Context) error

func TransferZKProofValidate

func TransferZKProofValidate(ctx *Context) error

Types

type Context

type Context struct {
	PP                *crypto.PublicParams
	Deserializer      driver.Deserializer
	SignatureProvider driver.SignatureProvider
	Signatures        [][]byte
	InputTokens       []*token.Token
	Action            *transfer.TransferAction
	Ledger            driver.Ledger
	MetadataCounter   map[string]int
}

func (*Context) CountMetadataKey

func (c *Context) CountMetadataKey(key string)

type Ledger

type Ledger interface {
	GetState(key string) ([]byte, error)
}

type ValidateTransferFunc

type ValidateTransferFunc func(ctx *Context) error

type Validator

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

func New

func New(pp *crypto.PublicParams, deserializer driver.Deserializer, extraValidators ...ValidateTransferFunc) *Validator

func (*Validator) UnmarshalActions

func (v *Validator) UnmarshalActions(raw []byte) ([]interface{}, error)

func (*Validator) UnmarshalIssueActions

func (v *Validator) UnmarshalIssueActions(raw [][]byte) ([]driver.IssueAction, error)

func (*Validator) UnmarshalIssueTransferActions

func (v *Validator) UnmarshalIssueTransferActions(tr *driver.TokenRequest) ([]driver.IssueAction, []driver.TransferAction, error)

UnmarshalIssueTransferActions returns the deserialized issue and transfer actions contained in TokenRequest

func (*Validator) UnmarshalTransferActions

func (v *Validator) UnmarshalTransferActions(raw [][]byte) ([]driver.TransferAction, error)

func (*Validator) VerifyTokenRequest

func (v *Validator) VerifyTokenRequest(ledger driver.Ledger, signatureProvider driver.SignatureProvider, anchor string, tr *driver.TokenRequest) ([]interface{}, map[string][]byte, error)

func (*Validator) VerifyTokenRequestFromRaw

func (v *Validator) VerifyTokenRequestFromRaw(getState driver.GetStateFnc, anchor string, raw []byte) ([]interface{}, map[string][]byte, error)

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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