mirror of
https://github.com/tendermint/tendermint.git
synced 2026-09-19 22:44:24 +00:00
rpc, node, mempool and start of ight client
This commit is contained in:
@@ -68,7 +68,7 @@ func TestCacheAfterUpdate(t *testing.T) {
|
||||
tx := types.Tx{byte(v)}
|
||||
updateTxs = append(updateTxs, tx)
|
||||
}
|
||||
err := mempool.Update(int64(tcIndex), updateTxs, abciResponses(len(updateTxs), abci.CodeTypeOK), nil, nil)
|
||||
err := mempool.Update(uint64(tcIndex), updateTxs, abciResponses(len(updateTxs), abci.CodeTypeOK), nil, nil)
|
||||
require.NoError(t, err)
|
||||
|
||||
for _, v := range tc.reAddIndices {
|
||||
|
||||
@@ -36,8 +36,8 @@ var newline = []byte("\n")
|
||||
// be efficiently accessed by multiple concurrent readers.
|
||||
type CListMempool struct {
|
||||
// Atomic integers
|
||||
height int64 // the last block Update()'d to
|
||||
txsBytes int64 // total size of mempool, in bytes
|
||||
height uint64 // the last block Update()'d to
|
||||
txsBytes int64 // total size of mempool, in bytes
|
||||
|
||||
// notify listeners (ie. consensus) when txs are available
|
||||
notifiedTxsAvailable bool
|
||||
@@ -83,7 +83,7 @@ type CListMempoolOption func(*CListMempool)
|
||||
func NewCListMempool(
|
||||
config *cfg.MempoolConfig,
|
||||
proxyAppConn proxy.AppConnMempool,
|
||||
height int64,
|
||||
height uint64,
|
||||
options ...CListMempoolOption,
|
||||
) *CListMempool {
|
||||
mempool := &CListMempool{
|
||||
@@ -577,7 +577,7 @@ func (mem *CListMempool) ReapMaxTxs(max int) types.Txs {
|
||||
|
||||
// Lock() must be help by the caller during execution.
|
||||
func (mem *CListMempool) Update(
|
||||
height int64,
|
||||
height uint64,
|
||||
txs types.Txs,
|
||||
deliverTxResponses []*abci.ResponseDeliverTx,
|
||||
preCheck PreCheckFunc,
|
||||
@@ -672,7 +672,7 @@ func (mem *CListMempool) recheckTxs() {
|
||||
|
||||
// mempoolTx is a transaction that successfully ran
|
||||
type mempoolTx struct {
|
||||
height int64 // height that this tx had been validated in
|
||||
height uint64 // height that this tx had been validated in
|
||||
gasWanted int64 // amount of gas this tx states it will require
|
||||
tx types.Tx //
|
||||
|
||||
@@ -682,8 +682,8 @@ type mempoolTx struct {
|
||||
}
|
||||
|
||||
// Height returns the height for this transaction
|
||||
func (memTx *mempoolTx) Height() int64 {
|
||||
return atomic.LoadInt64(&memTx.height)
|
||||
func (memTx *mempoolTx) Height() uint64 {
|
||||
return atomic.LoadUint64(&memTx.height)
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------
|
||||
|
||||
+1
-1
@@ -40,7 +40,7 @@ type Mempool interface {
|
||||
// NOTE: this should be called *after* block is committed by consensus.
|
||||
// NOTE: Lock/Unlock must be managed by caller
|
||||
Update(
|
||||
blockHeight int64,
|
||||
blockHeight uint64,
|
||||
blockTxs types.Txs,
|
||||
deliverTxResponses []*abci.ResponseDeliverTx,
|
||||
newPreFn PreCheckFunc,
|
||||
|
||||
@@ -21,7 +21,7 @@ func (Mempool) CheckTx(_ types.Tx, _ func(*abci.Response), _ mempl.TxInfo) error
|
||||
func (Mempool) ReapMaxBytesMaxGas(_, _ int64) types.Txs { return types.Txs{} }
|
||||
func (Mempool) ReapMaxTxs(n int) types.Txs { return types.Txs{} }
|
||||
func (Mempool) Update(
|
||||
_ int64,
|
||||
_ uint64,
|
||||
_ types.Txs,
|
||||
_ []*abci.ResponseDeliverTx,
|
||||
_ mempl.PreCheckFunc,
|
||||
|
||||
+1
-1
@@ -39,7 +39,7 @@ const (
|
||||
// peer information. This should eventually be replaced with a message-oriented
|
||||
// approach utilizing the p2p stack.
|
||||
type PeerManager interface {
|
||||
GetHeight(p2p.NodeID) int64
|
||||
GetHeight(p2p.NodeID) uint64
|
||||
}
|
||||
|
||||
// Reactor implements a service that contains mempool of txs that are broadcasted
|
||||
|
||||
Reference in New Issue
Block a user