swarm/network/stream: fixed invalid price check

This commit is contained in:
Fabio Barone 2019-01-07 09:35:33 -05:00
parent e3be2ed3ab
commit 00c250e4d0

View file

@ -943,12 +943,12 @@ func TestHasPriceImplementation(t *testing.T) {
t.Fatal("`Registry` does not have the expected Prices instance") t.Fatal("`Registry` does not have the expected Prices instance")
} }
price := pricesInstance.Price(&ChunkDeliveryMsgRetrieval{}) price := pricesInstance.Price(&ChunkDeliveryMsgRetrieval{})
if price == nil || price.Value == 0 && price.Value != pricesInstance.getChunkDeliveryMsgRetrievalPrice() { if price == nil || price.Value == 0 || price.Value != pricesInstance.getChunkDeliveryMsgRetrievalPrice() {
t.Fatal("No prices set for chunk delivery msg") t.Fatal("No prices set for chunk delivery msg")
} }
price = pricesInstance.Price(&RetrieveRequestMsg{}) price = pricesInstance.Price(&RetrieveRequestMsg{})
if price == nil || price.Value == 0 && price.Value != pricesInstance.getRetrieveRequestMsgPrice() { if price == nil || price.Value == 0 || price.Value != pricesInstance.getRetrieveRequestMsgPrice() {
t.Fatal("No prices set for chunk delivery msg") t.Fatal("No prices set for chunk delivery msg")
} }
} }