deliver

package
v0.0.0-...-24d451d Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2020 License: Apache-2.0 Imports: 36 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppDeliver

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

AppDeliver object of delivertx

func (*AppDeliver) AddDeliverHash

func (app *AppDeliver) AddDeliverHash(deliverHash []byte)

AddDeliverHash - invoked by v1 deliverTx, add v1 deliverHash to v2 tx hash list;

  • it was used to calculate appHash.

func (*AppDeliver) AddFee

func (app *AppDeliver) AddFee(fee int64)

AddFee - invoked by v1 deliverTx, add v1 deliverTx fee to v2,

  • for calculate total fee of block

func (*AppDeliver) AddRewardValues

func (app *AppDeliver) AddRewardValues(rewardValues map[string]uint64)

AddRewardValues - invoked by v1 deliverTx, add rewardValues to v2,

  • it was used to calculate total fee of reward account

func (*AppDeliver) BCBeginBlock

func (app *AppDeliver) BCBeginBlock(req abci.RequestBeginBlock) (abci.ResponseBeginBlock, map[string][]byte)

BCBeginBlock beginblock implementation of app

func (*AppDeliver) BeginBlock

func (app *AppDeliver) BeginBlock(req abci.RequestBeginBlock) (abci.ResponseBeginBlock, map[string][]byte)

BeginBlock beginblock interface of app

func (*AppDeliver) CleanData

func (app *AppDeliver) CleanData() error

func (*AppDeliver) Commit

func (app *AppDeliver) Commit() abci.ResponseCommit

Commit commit interface of app

func (*AppDeliver) DeliverTx

func (app *AppDeliver) DeliverTx(tx []byte) (abci.ResponseDeliverTx, map[string][]byte)

DeliverTx DeliverTx interface of app

func (*AppDeliver) EndBlock

func (app *AppDeliver) EndBlock(req abci.RequestEndBlock) (abci.ResponseEndBlock, map[string][]byte)

func (*AppDeliver) Flush

func (app *AppDeliver) Flush(req abci.RequestFlush) abci.ResponseFlush

Flush flush interface of app

func (*AppDeliver) InitChain

InitChain init chain

func (*AppDeliver) Rollback

func (app *AppDeliver) Rollback() error

func (*AppDeliver) RunDeliverTx

func (app *AppDeliver) RunDeliverTx(tx []byte, transaction types.Transaction, pubKey crypto.PubKeyEd25519) (abci.ResponseDeliverTx, map[string][]byte)

RunDeliverTx - invoked by v1 deliverTx, if it's standard transfer method.

func (*AppDeliver) SetChainID

func (app *AppDeliver) SetChainID(chainID string)

SetChainID set chainID

func (*AppDeliver) SetLogger

func (app *AppDeliver) SetLogger(logger log.Logger)

SetLogger set logger

func (*AppDeliver) TransID

func (app *AppDeliver) TransID() int64

TransID - invoked by v1 deliverTx, return current transID

  • for commit txBuffer to v2

type Contract

type Contract struct {
	Name       string            `json:"name,omitempty"`
	Version    string            `json:"version,omitempty"`
	CodeByte   sdktypes.HexBytes `json:"codeByte,omitempty"`
	CodeHash   string            `json:"codeHash,omitempty"`
	Owner      string            `json:"owner,omitempty"`
	CodeDevSig Signature         `json:"codeDevSig,omitempty"`
	CodeOrgSig Signature         `json:"codeOrgSig,omitempty"`
}

Contract contract info

type InitAppState

type InitAppState struct {
	Organization   string        `json:"organization,omitempty"`
	GasPriceRatio  string        `json:"gas_price_ratio"`
	ChainVersion   int64         `json:"chainVersion,omitempty"`
	Token          std.Token     `json:"token,omitempty"`
	RewardStrategy []Rewarder    `json:"rewardStrategy,omitempty"`
	Contracts      []Contract    `json:"contracts,omitempty"`
	OrgBind        OrgBind       `json:"orgBind"`
	MainChain      MainChainInfo `json:"mainChain"`
}

InitAppState init chain app state

type InitChainInfo

type InitChainInfo struct {
	Validators []abci.Validator `json:"validators,omitempty"`
	ChainID    string           `json:"chain_id,omitempty"`
	AppState   InitAppState     `json:"app_state,omitempty"`
}

InitChainInfo init chain parameters info

type MainChainInfo

type MainChainInfo struct {
	OpenUrls   []string                           `json:"openUrls"`
	Validators map[string]statedbhelper.Validator `json:"validators"`
}

type OrgBind

type OrgBind struct {
	OrgName string        `json:"orgName"`
	Owner   types.Address `json:"owner"`
}

type Rewarder

type Rewarder struct {
	Name          string `json:"name,omitempty"`          // 被奖励者名称
	RewardPercent string `json:"rewardPercent,omitempty"` // 奖励比例
	Address       string `json:"address,omitempty"`       // 被奖励者地址
}

Rewarder reward info

type Signature

type Signature struct {
	PubKey    string `json:"pubkey"`
	Signature string `json:"signature"`
}

Signature sig for contract code

Jump to

Keyboard shortcuts

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