Documentation
¶
Overview ¶
Package common defines the interfaces that block, block header and transaction need to implement, and contains the implementations of each chain
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Blocker ¶
type Blocker interface {
Header
// GetBlockHeader returns block header
GetBlockHeader() Header
// GetTransaction returns transactions in the block
GetTransaction() []Transactioner
// GetExtraData returns extra data in the block
GetExtraData() interface{}
}
Blocker defines the interface that the block needs to implement
type Header ¶
type Header interface {
// GetChainId returns chainId
GetChainId() string
// GetPreHash returns the hash value of previous block
GetPreHash() []byte
// GetTxRoot returns the root hash of transaction tree
GetTxRoot() []byte
// GetHeight returns block height
GetHeight() uint64
// GetBlockHash returns block hash
GetBlockHash() []byte
}
Header defines the interface that the block header needs to implement
type Transactioner ¶
type Transactioner interface {
// GetStatusCode returns the transaction status code
GetStatusCode() int32
// GetTransactionHash returns transaction hash
GetTransactionHash() ([]byte, error)
// GetContractName returns the contract name of transaction
GetContractName() (string, error)
// GetMethod returns the method in contract method of transaction
GetMethod() (string, error)
// GetParams returns parameters of transaction
GetParams() ([]interface{}, error)
// GetExtraData returns extra data of transaction, for example read-write set.
GetExtraData() (interface{}, error)
}
Transactioner defines the interface that the transaction needs to implement
Source Files
¶
- blocker.go
- transactioner.go
Click to show internal directories.
Click to hide internal directories.