mint

package
v0.0.0-...-63f9e25 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2018 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init()

Types

type Contract

type Contract struct {
	Address []byte `json:"addr,omitempty"`
	Method  string `json:"method,omitempty"`
	Data    []byte `json:"data,omitempty"`

	ContractAddress []byte
	Code            []byte
	Tx              []byte
	// contains filtered or unexported fields
}

func (*Contract) CallWithRet

func (c *Contract) CallWithRet(method string, args []byte) ([]byte, error)

func (*Contract) CreateContractAddress

func (c *Contract) CreateContractAddress(tx []byte) []byte

func (*Contract) Deploy

func (c *Contract) Deploy()

func (*Contract) Init

func (c *Contract) Init() error

type ContractManager

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

func (*ContractManager) Contract

func (c *ContractManager) Contract(addr []byte) *lua.LState

type Mint

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

创建一个bussiness层

func New

func New() *Mint

func (*Mint) BeginBlock

func (m *Mint) BeginBlock(data []byte) error

BeginBlock 开始区块

func (*Mint) CheckTx

func (m *Mint) CheckTx(data []byte) error

CheckTx 预提交

func (*Mint) Commit

func (m *Mint) Commit() []byte

Commit 提交tx

func (*Mint) ContractCall

func (m *Mint) ContractCall() error

ContractCall 调用合约

func (*Mint) ContractDeploy

func (m *Mint) ContractDeploy() error

ContractDeploy 部署合约

func (*Mint) ContractQuery

func (m *Mint) ContractQuery() error

func (*Mint) DeliverTx

func (m *Mint) DeliverTx(data []byte) error

DeliverTx 提交

func (*Mint) EndBlock

func (m *Mint) EndBlock(data []byte) ([]types.Validator, error)

EndBlock 结束区块

func (*Mint) GetState

func (m *Mint) GetState() *State

func (*Mint) InitChain

func (m *Mint) InitChain(vals ...types.Validator) error

InitChain 初始化chain

func (*Mint) UpdateValidators

func (m *Mint) UpdateValidators(vals ...types.Validator) error

UpdateValidators 更新Validators

type State

type State struct {
	Size    int64  `json:"size"`
	Height  int64  `json:"height"`
	AppHash []byte `json:"app_hash"`
	// contains filtered or unexported fields
}

func NewState

func NewState(dbs ...*kdb.KDB) *State

func (*State) Load

func (s *State) Load()

func (*State) Save

func (s *State) Save()

type Validator

type Validator struct {
	PubKey []byte `json:"pubkey,omitempty" mapstructure:"pubkey"`
	Power  int64  `json:"power,omitempty" mapstructure:"power"`
	// contains filtered or unexported fields
}

Validator

func NewValidator

func NewValidator(dbs ...*kdb.KDB) *Validator

func (*Validator) Check

func (v *Validator) Check() error

Check 检查Power值和Pubkey

func (*Validator) Decode

func (v *Validator) Decode(val []byte) error

func (*Validator) Delete

func (v *Validator) Delete() error

func (*Validator) GetPubkey

func (v *Validator) GetPubkey() (crypto.PubKey, error)

func (*Validator) Has

func (v *Validator) Has() bool

func (*Validator) Save

func (v *Validator) Save() error

func (*Validator) UpdateValidator

func (v *Validator) UpdateValidator(val *types.Validator) error

UpdateValidators 更新Validators

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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