checker

package
v0.0.0-...-8220f0d Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2019 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Opcode_name = map[int32]string{
	0: "UNKNOWN",
	1: "CHECK",
}
View Source
var Opcode_value = map[string]int32{
	"UNKNOWN": 0,
	"CHECK":   1,
}

Functions

func New

func New(cfg *Config) (*checkerService, error)

func TypeCheck

func TypeCheck(tx *sbac.Transaction) error

Types

type CheckRequest

type CheckRequest struct {
	Tx                   *sbac.Transaction `protobuf:"bytes,1,opt,name=tx" json:"tx,omitempty"`
	XXX_NoUnkeyedLiteral struct{}          `json:"-"`
	XXX_unrecognized     []byte            `json:"-"`
	XXX_sizecache        int32             `json:"-"`
}

func (*CheckRequest) Descriptor

func (*CheckRequest) Descriptor() ([]byte, []int)

func (*CheckRequest) GetTx

func (m *CheckRequest) GetTx() *sbac.Transaction

func (*CheckRequest) ProtoMessage

func (*CheckRequest) ProtoMessage()

func (*CheckRequest) Reset

func (m *CheckRequest) Reset()

func (*CheckRequest) String

func (m *CheckRequest) String() string

func (*CheckRequest) XXX_DiscardUnknown

func (m *CheckRequest) XXX_DiscardUnknown()

func (*CheckRequest) XXX_Marshal

func (m *CheckRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*CheckRequest) XXX_Merge

func (dst *CheckRequest) XXX_Merge(src proto.Message)

func (*CheckRequest) XXX_Size

func (m *CheckRequest) XXX_Size() int

func (*CheckRequest) XXX_Unmarshal

func (m *CheckRequest) XXX_Unmarshal(b []byte) error

type CheckResponse

type CheckResponse struct {
	Ok                   bool     `protobuf:"varint,1,opt,name=ok,proto3" json:"ok,omitempty"`
	Signature            []byte   `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*CheckResponse) Descriptor

func (*CheckResponse) Descriptor() ([]byte, []int)

func (*CheckResponse) GetOk

func (m *CheckResponse) GetOk() bool

func (*CheckResponse) GetSignature

func (m *CheckResponse) GetSignature() []byte

func (*CheckResponse) ProtoMessage

func (*CheckResponse) ProtoMessage()

func (*CheckResponse) Reset

func (m *CheckResponse) Reset()

func (*CheckResponse) String

func (m *CheckResponse) String() string

func (*CheckResponse) XXX_DiscardUnknown

func (m *CheckResponse) XXX_DiscardUnknown()

func (*CheckResponse) XXX_Marshal

func (m *CheckResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*CheckResponse) XXX_Merge

func (dst *CheckResponse) XXX_Merge(src proto.Message)

func (*CheckResponse) XXX_Size

func (m *CheckResponse) XXX_Size() int

func (*CheckResponse) XXX_Unmarshal

func (m *CheckResponse) XXX_Unmarshal(b []byte) error

type Checker

type Checker interface {
	ContractID() string
	Name() string
	Check(inputs, refInputs, parameters [][]byte, outputObjects []*sbac.OutputObject, returns [][]byte, dependencies []*sbac.Trace) bool
}

Checker define the interface for a contract procedure check

type Config

type Config struct {
	SigningKey *config.Key
	Checkers   []Checker
}

type Opcode

type Opcode int32
const (
	Opcode_UNKNOWN Opcode = 0
	Opcode_CHECK   Opcode = 1
)

func (Opcode) EnumDescriptor

func (Opcode) EnumDescriptor() ([]byte, []int)

func (Opcode) String

func (x Opcode) String() string

type Service

type Service interface {
	service.Handler
	Check(ctx context.Context, tx *sbac.Transaction) (bool, error)
	CheckAndSign(ctx context.Context, tx *sbac.Transaction) (bool, []byte, error)
}

Directories

Path Synopsis
api

Jump to

Keyboard shortcuts

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