Documentation ¶
Index ¶
- Constants
- func AddOperation(add []byte, value uint32) []byte
- func Deserilization(tx hctypes.TransactionType) (uint32, []byte)
- func GetTxType(_tx []byte) uint8
- func ResolveTx(_tx []byte) (uint32, hctypes.TransactionType)
- func Serilization(tx []byte) (uint32, hctypes.TransactionType)
- func SubOperation(minuend []byte, value uint32) []byte
- type BlockchainState
- type ValidatorInterface
- func (nw *ValidatorInterface) DeliverAttackTx(tx []byte, shardid uint8)
- func (nw *ValidatorInterface) DeliverCommitTx(tx []byte, shardid uint8)
- func (nw *ValidatorInterface) DeliverCrossLink(blockts int64, cl string)
- func (nw *ValidatorInterface) DeliverUpdateTx(tx []byte, shardid uint8)
- func (nw *ValidatorInterface) HandleCallList(list []byte)
Constants ¶
View Source
const ( Addr_Length uint8 = 4 Data_Length uint8 = 4 )
Variables ¶
This section is empty.
Functions ¶
func AddOperation ¶
func Deserilization ¶
func Deserilization(tx hctypes.TransactionType) (uint32, []byte)
func Serilization ¶
func Serilization(tx []byte) (uint32, hctypes.TransactionType)
func SubOperation ¶
Types ¶
type BlockchainState ¶
type BlockchainState struct { Database dbm.DB Size uint32 Height uint32 Index uint32 // cross_shard tx number in a shard AppHash []byte }
func NewBlockchainState ¶
func NewBlockchainState(name string, dir string) *BlockchainState
type ValidatorInterface ¶
type ValidatorInterface struct { BCState *BlockchainState Shard_id uint8 Leader bool Current_cl string Byzantine uint8 // 0: honest; 1: byzantine Attack_shard uint8 // the attacker's shard Node_id uint8 // used to construct different front-running tx // contains filtered or unexported fields }
func NewValidatorInterface ¶
func NewValidatorInterface(bcstate *BlockchainState, shard_num uint8, shard_id uint8, leader bool, in_addr hctypes.HaechiAddress, out_addrs []hctypes.HaechiAddress, attacks ...uint8) *ValidatorInterface
func (*ValidatorInterface) DeliverAttackTx ¶
func (nw *ValidatorInterface) DeliverAttackTx(tx []byte, shardid uint8)
func (*ValidatorInterface) DeliverCommitTx ¶
func (nw *ValidatorInterface) DeliverCommitTx(tx []byte, shardid uint8)
func (*ValidatorInterface) DeliverCrossLink ¶
func (nw *ValidatorInterface) DeliverCrossLink(blockts int64, cl string)
func (*ValidatorInterface) DeliverUpdateTx ¶
func (nw *ValidatorInterface) DeliverUpdateTx(tx []byte, shardid uint8)
func (*ValidatorInterface) HandleCallList ¶
func (nw *ValidatorInterface) HandleCallList(list []byte)
Click to show internal directories.
Click to hide internal directories.