@ -159,6 +159,7 @@ func TestBlockPoolUpdatePeer(t *testing.T) {
}
for _ , tt := range tests {
tt := tt
t . Run ( tt . name , func ( t * testing . T ) {
pool := tt . pool
err := pool . UpdatePeer ( tt . args . id , tt . args . height )
@ -232,6 +233,7 @@ func TestBlockPoolRemovePeer(t *testing.T) {
}
for _ , tt := range tests {
tt := tt
t . Run ( tt . name , func ( t * testing . T ) {
tt . pool . RemovePeer ( tt . args . peerID , tt . args . err )
assertBlockPoolEquivalent ( t , tt . poolWanted , tt . pool )
@ -272,6 +274,7 @@ func TestBlockPoolRemoveShortPeers(t *testing.T) {
}
for _ , tt := range tests {
tt := tt
t . Run ( tt . name , func ( t * testing . T ) {
pool := tt . pool
pool . removeShortPeers ( )
@ -317,6 +320,7 @@ func TestBlockPoolSendRequestBatch(t *testing.T) {
}
for _ , tt := range tests {
tt := tt
t . Run ( tt . name , func ( t * testing . T ) {
resetPoolTestResults ( )
@ -421,6 +425,7 @@ func TestBlockPoolAddBlock(t *testing.T) {
}
for _ , tt := range tests {
tt := tt
t . Run ( tt . name , func ( t * testing . T ) {
err := tt . pool . AddBlock ( tt . args . peerID , tt . args . block , tt . args . blockSize )
assert . Equal ( t , tt . errWanted , err )
@ -473,6 +478,7 @@ func TestBlockPoolFirstTwoBlocksAndPeers(t *testing.T) {
}
for _ , tt := range tests {
tt := tt
t . Run ( tt . name , func ( t * testing . T ) {
pool := tt . pool
gotFirst , gotSecond , err := pool . FirstTwoBlocksAndPeers ( )
@ -544,6 +550,7 @@ func TestBlockPoolInvalidateFirstTwoBlocks(t *testing.T) {
}
for _ , tt := range tests {
tt := tt
t . Run ( tt . name , func ( t * testing . T ) {
tt . pool . InvalidateFirstTwoBlocks ( errNoPeerResponse )
assertBlockPoolEquivalent ( t , tt . poolWanted , tt . pool )
@ -584,6 +591,7 @@ func TestProcessedCurrentHeightBlock(t *testing.T) {
}
for _ , tt := range tests {
tt := tt
t . Run ( tt . name , func ( t * testing . T ) {
tt . pool . ProcessedCurrentHeightBlock ( )
assertBlockPoolEquivalent ( t , tt . poolWanted , tt . pool )
@ -642,6 +650,7 @@ func TestRemovePeerAtCurrentHeight(t *testing.T) {
}
for _ , tt := range tests {
tt := tt
t . Run ( tt . name , func ( t * testing . T ) {
tt . pool . RemovePeerAtCurrentHeights ( errNoPeerResponse )
assertBlockPoolEquivalent ( t , tt . poolWanted , tt . pool )