From 7b62e82b3540c2de06f30a0eaacc9ba6aff785ba Mon Sep 17 00:00:00 2001 From: Bulat-Ziganshin Date: Thu, 3 Nov 2022 16:46:22 +0300 Subject: [PATCH] Check prices each moment --- tests/codex/blockexchange/engine/testblockexc.nim | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/codex/blockexchange/engine/testblockexc.nim b/tests/codex/blockexchange/engine/testblockexc.nim index 4ce45a6a..f86e0a32 100644 --- a/tests/codex/blockexchange/engine/testblockexc.nim +++ b/tests/codex/blockexchange/engine/testblockexc.nim @@ -65,14 +65,23 @@ suite "NetworkStore engine - 2 nodes": nodeCmps1.engine.pricing = pricing1.some nodeCmps2.engine.pricing = pricing2.some + echo "1.pricing1 ", nodeCmps1.engine.pricing.?price + echo "1.pricing2 ", nodeCmps2.engine.pricing.?price + await nodeCmps1.switch.connect( nodeCmps2.switch.peerInfo.peerId, nodeCmps2.switch.peerInfo.addrs) + echo "2.pricing1 ", nodeCmps1.engine.pricing.?price + echo "2.pricing2 ", nodeCmps2.engine.pricing.?price + await sleepAsync(1.seconds) # give some time to exchange lists peerCtx2 = nodeCmps1.peerStore.get(nodeCmps2.switch.peerInfo.peerId) peerCtx1 = nodeCmps2.peerStore.get(nodeCmps1.switch.peerInfo.peerId) + echo "3.pricing1 ", nodeCmps1.engine.pricing.?price + echo "3.pricing2 ", nodeCmps2.engine.pricing.?price + check isNil(peerCtx1).not check isNil(peerCtx2).not @@ -148,6 +157,7 @@ suite "NetworkStore engine - 2 nodes": let channel = !peerCtx1.paymentChannel let wallet = nodeCmps2.wallet + echo "" echo "pricing1 ", nodeCmps1.engine.pricing.?price echo "pricing2 ", nodeCmps2.engine.pricing.?price echo "balance0 ", wallet.balance(channel, Asset) @@ -156,7 +166,11 @@ suite "NetworkStore engine - 2 nodes": blocks2.mapIt( nodeCmps1.networkStore.getBlock(it.cid) )) check eventually wallet.balance(channel, Asset) > 0 + + echo "" echo "balance after ", wallet.balance(channel, Asset) + echo "pricing1 ", nodeCmps1.engine.pricing.?price + echo "pricing2 ", nodeCmps2.engine.pricing.?price suite "NetworkStore - multiple nodes": let