txpool

package
v0.0.0-...-4619e39 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2022 License: Apache-2.0 Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthTransactionPool        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowTransactionPool          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupTransactionPool = fmt.Errorf("proto: unexpected end of group")
)
View Source
var SignalType_name = map[int32]string{
	0: "NO_EVENT",
	1: "TRANSACTION_INCOME",
	2: "BLOCK_PROPOSE",
}
View Source
var SignalType_value = map[string]int32{
	"NO_EVENT":           0,
	"TRANSACTION_INCOME": 1,
	"BLOCK_PROPOSE":      2,
}

Functions

This section is empty.

Types

type SignalType

type SignalType int32

SignalType 是交易事件类型

const (
	// 没有交易
	SignalType_NO_EVENT SignalType = 0
	// 新交易
	SignalType_TRANSACTION_INCOME SignalType = 1
	// 打包块
	SignalType_BLOCK_PROPOSE SignalType = 2
)

func (SignalType) EnumDescriptor

func (SignalType) EnumDescriptor() ([]byte, []int)

func (SignalType) String

func (x SignalType) String() string

type TxBatch

type TxBatch struct {
	// 批次编号
	BatchId int32 `protobuf:"varint,1,opt,name=batch_id,json=batchId,proto3" json:"batch_id,omitempty"`
	// 批量交易由节点广播
	NodeId string `protobuf:"bytes,2,opt,name=node_id,json=nodeId,proto3" json:"node_id,omitempty"`
	// 批次大小
	Size_ int32 `protobuf:"varint,3,opt,name=size,proto3" json:"size,omitempty"`
	// 交易列表
	Txs []*common.Transaction `protobuf:"bytes,4,rep,name=txs,proto3" json:"txs,omitempty"`
	// map:交易ID映射记录(key:交易ID,value:tcs中的交易索引)
	TxIdsMap map[string]int32 `` /* 176-byte string literal not displayed */
}

事务批处理,用于高效添加事务

func (*TxBatch) Descriptor

func (*TxBatch) Descriptor() ([]byte, []int)

func (*TxBatch) GetBatchId

func (m *TxBatch) GetBatchId() int32

func (*TxBatch) GetNodeId

func (m *TxBatch) GetNodeId() string

func (*TxBatch) GetSize_

func (m *TxBatch) GetSize_() int32

func (*TxBatch) GetTxIdsMap

func (m *TxBatch) GetTxIdsMap() map[string]int32

func (*TxBatch) GetTxs

func (m *TxBatch) GetTxs() []*common.Transaction

func (*TxBatch) Marshal

func (m *TxBatch) Marshal() (dAtA []byte, err error)

func (*TxBatch) MarshalTo

func (m *TxBatch) MarshalTo(dAtA []byte) (int, error)

func (*TxBatch) MarshalToSizedBuffer

func (m *TxBatch) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*TxBatch) ProtoMessage

func (*TxBatch) ProtoMessage()

func (*TxBatch) Reset

func (m *TxBatch) Reset()

func (*TxBatch) Size

func (m *TxBatch) Size() (n int)

func (*TxBatch) String

func (m *TxBatch) String() string

func (*TxBatch) Unmarshal

func (m *TxBatch) Unmarshal(dAtA []byte) error

func (*TxBatch) XXX_DiscardUnknown

func (m *TxBatch) XXX_DiscardUnknown()

func (*TxBatch) XXX_Marshal

func (m *TxBatch) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*TxBatch) XXX_Merge

func (m *TxBatch) XXX_Merge(src proto.Message)

func (*TxBatch) XXX_Size

func (m *TxBatch) XXX_Size() int

func (*TxBatch) XXX_Unmarshal

func (m *TxBatch) XXX_Unmarshal(b []byte) error

type TxPoolSignal

type TxPoolSignal struct {
	// 交易事件类型
	SignalType SignalType `protobuf:"varint,1,opt,name=signal_type,json=signalType,proto3,enum=txpool.SignalType" json:"signal_type,omitempty"`
	// chain id
	ChainId string `protobuf:"bytes,2,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"`
}

TxPoolSignal 被 tx pool 用来向区块提议者发送信号

func (*TxPoolSignal) Descriptor

func (*TxPoolSignal) Descriptor() ([]byte, []int)

func (*TxPoolSignal) GetChainId

func (m *TxPoolSignal) GetChainId() string

func (*TxPoolSignal) GetSignalType

func (m *TxPoolSignal) GetSignalType() SignalType

func (*TxPoolSignal) Marshal

func (m *TxPoolSignal) Marshal() (dAtA []byte, err error)

func (*TxPoolSignal) MarshalTo

func (m *TxPoolSignal) MarshalTo(dAtA []byte) (int, error)

func (*TxPoolSignal) MarshalToSizedBuffer

func (m *TxPoolSignal) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*TxPoolSignal) ProtoMessage

func (*TxPoolSignal) ProtoMessage()

func (*TxPoolSignal) Reset

func (m *TxPoolSignal) Reset()

func (*TxPoolSignal) Size

func (m *TxPoolSignal) Size() (n int)

func (*TxPoolSignal) String

func (m *TxPoolSignal) String() string

func (*TxPoolSignal) Unmarshal

func (m *TxPoolSignal) Unmarshal(dAtA []byte) error

func (*TxPoolSignal) XXX_DiscardUnknown

func (m *TxPoolSignal) XXX_DiscardUnknown()

func (*TxPoolSignal) XXX_Marshal

func (m *TxPoolSignal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*TxPoolSignal) XXX_Merge

func (m *TxPoolSignal) XXX_Merge(src proto.Message)

func (*TxPoolSignal) XXX_Size

func (m *TxPoolSignal) XXX_Size() int

func (*TxPoolSignal) XXX_Unmarshal

func (m *TxPoolSignal) XXX_Unmarshal(b []byte) error

Jump to

Keyboard shortcuts

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