You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

23 lines
493 B

package mempool
import (
"testing"
"github.com/stretchr/testify/require"
"github.com/tendermint/tendermint/types"
)
func TestMempoolIDsBasic(t *testing.T) {
ids := NewMempoolIDs()
peerID, err := types.NewNodeID("0011223344556677889900112233445566778899")
require.NoError(t, err)
ids.ReserveForPeer(peerID)
require.EqualValues(t, 1, ids.GetForPeer(peerID))
ids.Reclaim(peerID)
ids.ReserveForPeer(peerID)
require.EqualValues(t, 2, ids.GetForPeer(peerID))
ids.Reclaim(peerID)
}