candy

package
v0.0.0-...-f47aca1 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2020 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const LastCommitKey = "lck"
View Source
const ValidatorSetChangePrefix string = "val:"

Variables

This section is empty.

Functions

This section is empty.

Types

type Application

type Application struct {
	types.BaseApplication
	// contains filtered or unexported fields
}

func NewApplication

func NewApplication(caller ContractCaller, dbDir string) *Application

func (*Application) BeginBlock

func (app *Application) BeginBlock(reqBeginBlock types.RequestBeginBlock) types.ResponseBeginBlock

BeginBlock determines whether there is a Byzantine evidence, and punishes the specified validator

func (*Application) CheckTx

func (app *Application) CheckTx(reqCheckTx types.RequestCheckTx) types.ResponseCheckTx

func (*Application) Commit

func (app *Application) Commit() types.ResponseCommit

func (*Application) DeliverTx

func (app *Application) DeliverTx(reqDeliverTx types.RequestDeliverTx) types.ResponseDeliverTx

func (*Application) EndBlock

EndBlock updates the validator set

func (*Application) Info

func (*Application) InitChain

func (app *Application) InitChain(reqInitChain types.RequestInitChain) types.ResponseInitChain

func (*Application) Query

func (app *Application) Query(reqQuery types.RequestQuery) types.ResponseQuery

Query does not check signature

func (*Application) ValidateHeight

func (app *Application) ValidateHeight(req types.RequestBeginBlock) bool

type ContractCaller

type ContractCaller interface {
	// CallContract sends message to the specified contract container and waits for response
	CallContract(cId string, args [][]byte) (*pb.ContractOutput, error)

	// QueryContractList gets all installed contacts
	QueryContractList() []string
}

ContractCaller chats with contracts

type DecodeTx

type DecodeTx struct {
	Contract  string
	Function  string
	Args      [][]byte
	PubKey    crypto.PubKey
	Signature []byte
}

func TxDecode

func TxDecode(tx []byte) *DecodeTx

type LastCommit

type LastCommit struct {
	Version  int64 // height
	CommitID string
}

Jump to

Keyboard shortcuts

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