chengtay

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 24, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DatabaseVersion uint64 = 0x1
View Source
var ProtocolVersion uint64 = 0x1

Functions

func BlockHash

func BlockHash(lastBlockHeight int64, lastBlockHash []byte, transactionHashes [][]byte) (ret []byte)

func TODO

func TODO(whatever interface{})

Types

type Application

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

func NewApplication

func NewApplication(dbDir string) *Application

func (*Application) BeginBlock

func (*Application) CheckTx

func (*Application) Commit

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

func (*Application) DeliverTx

func (*Application) EndBlock

func (*Application) GetCommonState

func (app *Application) GetCommonState() *CommonState

func (*Application) Info

func (app *Application) Info(req abcitypes.RequestInfo) (resInfo abcitypes.ResponseInfo)

func (*Application) InitChain

func (*Application) Query

type CommonState

type CommonState struct {
	TransactionCount  int64                     // The number of transactions in all blocks.
	AccountNonce      map[string]uint64         // account -> nonce
	TrustedPublicKeys map[string]ed25519.PubKey // account -> publickey

	// TODO store the content in memory for now
	// prototype only!
	DatabaseHashItems map[int64]types.DatabaseHashItem // startTime -> HashItem
	Rawtransactions   map[string]*types.RawTransaction
	Blocktransactions map[int64]*types.BlockTransactions
}

func NewCommonState

func NewCommonState() *CommonState

func (*CommonState) Clone

func (self *CommonState) Clone() *CommonState

type PersistentState

type PersistentState struct {
	CommonState CommonState

	LastBlockHeight int64 // The height of last block. Every time a new block is added, the height gets increased by 1.
	LastBlockHash   []byte
}

func NewPersistentState

func NewPersistentState() *PersistentState

type TemporaryState

type TemporaryState struct {
	CommonState CommonState

	RawTransactions []*types.RawTransaction
}

func NewTemporaryStateFromPersistentState

func NewTemporaryStateFromPersistentState(state *PersistentState) *TemporaryState

Jump to

Keyboard shortcuts

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