vat

package
v0.0.0-...-d9e9996 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2019 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package vat is Verifiable Autogen Tx package

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HandlerSlice

type HandlerSlice []string

HandlerSlice the handler slice type

func (HandlerSlice) Len

func (hs HandlerSlice) Len() int

Len get the length of HandlerSlice

func (HandlerSlice) Less

func (hs HandlerSlice) Less(i, j int) bool

Less return true if element j is less than element i

func (HandlerSlice) Swap

func (hs HandlerSlice) Swap(i, j int)

Swap replace two elements in slice

type VATHandler

type VATHandler struct {
	HandlerList HandlerSlice
	Handlers    map[string]VATInterface
	// map[module]map[method]bool
	WhiteList map[string]map[string]bool
	// contains filtered or unexported fields
}

VATHandler define the VAT handler struct

func NewVATHandler

func NewVATHandler() *VATHandler

NewVATHandler create instance of VATHandler

func (*VATHandler) MustVAT

func (vh *VATHandler) MustVAT(module, method string) bool

MustVAT check if the given module and method in whitelist

func (*VATHandler) RegisterHandler

func (vh *VATHandler) RegisterHandler(name string, handler VATInterface, whiteList map[string]bool)

RegisterHandler add new handler into VATHandler

func (*VATHandler) Remove

func (vh *VATHandler) Remove(name string)

Remove delete handler of given name

type VATInterface

type VATInterface interface {
	GetVerifiableAutogenTx(blockHeight int64, maxCount int, timestamp int64) ([]*pb.Transaction, error)
	GetVATWhiteList() map[string]bool
}

VATInterface define the VAT interface

Jump to

Keyboard shortcuts

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