diff --git a/README.md b/README.md index a0691e83..bfd13116 100644 --- a/README.md +++ b/README.md @@ -76,30 +76,31 @@ The following options are available: --metrics Enable the metrics server [=false]. --metrics-address Listening address of the metrics server [=127.0.0.1]. --metrics-port Listening HTTP port of the metrics server [=8008]. - -d, --data-dir The directory where codex will store configuration and data.. + -d, --data-dir The directory where codex will store configuration and data. -i, --listen-addrs Multi Addresses to listen on [=/ip4/0.0.0.0/tcp/0]. -a, --nat IP Addresses to announce behind a NAT [=127.0.0.1]. -e, --disc-ip Discovery listen address [=0.0.0.0]. -u, --disc-port Discovery (UDP) port [=8090]. --net-privkey Source of network (secp256k1) private key file path or name [=key]. - -b, --bootstrap-node Specifies one or more bootstrap nodes to use when connecting to the network.. + -b, --bootstrap-node Specifies one or more bootstrap nodes to use when connecting to the network. --max-peers The maximum number of peers to connect to [=160]. --agent-string Node agent string which is used as identifier in network [=Codex]. --api-bindaddr The REST API bind address [=127.0.0.1]. -p, --api-port The REST Api port [=8080]. - --repo-kind backend for main repo store (fs, sqlite) [=fs]. + --repo-kind Backend for main repo store (fs, sqlite) [=fs]. -q, --storage-quota The size of the total storage quota dedicated to the node [=8589934592]. -t, --block-ttl Default block timeout in seconds - 0 disables the ttl [=$DefaultBlockTtl]. --block-mi Time interval in seconds - determines frequency of block maintenance cycle: how - often blocks are checked for expiration and cleanup. + often blocks are checked for expiration and cleanup [=$DefaultBlockMaintenanceInterval]. - --block-mn Number of blocks to check every maintenance cycle. [=1000]. - -c, --cache-size The size in MiB of the block cache, 0 disables the cache - might help on slow - hardrives [=0]. + --block-mn Number of blocks to check every maintenance cycle [=1000]. + -c, --cache-size The size of the block cache, 0 disables the cache - might help on slow hardrives + [=0]. --persistence Enables persistence mechanism, requires an Ethereum node [=false]. --eth-provider The URL of the JSON-RPC API of the Ethereum node [=ws://localhost:8545]. --eth-account The Ethereum account that is used for storage contracts [=EthAddress.none]. - --eth-deployment The json file describing the contract deployment [=string.none]. + --eth-private-key File containing Ethereum private key for storage contracts [=string.none]. + --marketplace-address Address of deployed Marketplace contract [=EthAddress.none]. --validator Enables validator, requires an Ethereum node [=false]. --validator-max-slots Maximum number of slots that the validator monitors [=1000]. diff --git a/atlas.lock b/atlas.lock index c45cfae1..497023cf 100644 --- a/atlas.lock +++ b/atlas.lock @@ -5,7 +5,7 @@ "hostOS": "macosx", "items": { "asynctest": { - "commit": "fe1a34caf572b05f8bdba3b650f1871af9fce31e", + "commit": "8e2f4e73b97123be0f0041c129942b32df23ecb1", "dir": "vendor/asynctest", "url": "https://github.com/codex-storage/asynctest" }, diff --git a/codex.nimble b/codex.nimble index 5f989a95..11490201 100644 --- a/codex.nimble +++ b/codex.nimble @@ -7,7 +7,7 @@ srcDir = "." installFiles = @["build.nims"] requires "nim >= 1.2.0" -requires "asynctest >= 0.4.3 & < 0.5.0" +requires "asynctest >= 0.5.1 & < 0.6.0" requires "bearssl >= 0.1.4" requires "chronicles >= 0.7.2" requires "chronos#head" diff --git a/codex/conf.nim b/codex/conf.nim index 09f17f83..197df56c 100644 --- a/codex/conf.nim +++ b/codex/conf.nim @@ -105,7 +105,7 @@ type name: "metrics-port" }: Port dataDir* {. - desc: "The directory where codex will store configuration and data." + desc: "The directory where codex will store configuration and data" defaultValue: defaultDataDir() defaultValueDesc: "" abbr: "d" @@ -154,7 +154,7 @@ type name: "net-privkey" }: string bootstrapNodes* {. - desc: "Specifies one or more bootstrap nodes to use when connecting to the network." + desc: "Specifies one or more bootstrap nodes to use when connecting to the network" abbr: "b" name: "bootstrap-node" }: seq[SignedPeerRecord] @@ -182,7 +182,7 @@ type abbr: "p" }: Port repoKind* {. - desc: "backend for main repo store (fs, sqlite)" + desc: "Backend for main repo store (fs, sqlite)" defaultValueDesc: "fs" defaultValue: repoFS name: "repo-kind" }: RepoKind @@ -202,13 +202,13 @@ type abbr: "t" }: Duration blockMaintenanceInterval* {. - desc: "Time interval in seconds - determines frequency of block maintenance cycle: how often blocks are checked for expiration and cleanup." + desc: "Time interval in seconds - determines frequency of block maintenance cycle: how often blocks are checked for expiration and cleanup" defaultValue: DefaultBlockMaintenanceInterval defaultValueDesc: $DefaultBlockMaintenanceInterval name: "block-mi" }: Duration blockMaintenanceNumberOfBlocks* {. - desc: "Number of blocks to check every maintenance cycle." + desc: "Number of blocks to check every maintenance cycle" defaultValue: DefaultNumberOfBlocksToMaintainPerInterval defaultValueDesc: $DefaultNumberOfBlocksToMaintainPerInterval name: "block-mn" }: int diff --git a/tests/asynctest.nim b/tests/asynctest.nim new file mode 100644 index 00000000..7c6a4afd --- /dev/null +++ b/tests/asynctest.nim @@ -0,0 +1,3 @@ +import pkg/asynctest/chronos/unittest + +export unittest diff --git a/tests/codex/blockexchange/discovery/testdiscovery.nim b/tests/codex/blockexchange/discovery/testdiscovery.nim index 8a263393..a7a3983e 100644 --- a/tests/codex/blockexchange/discovery/testdiscovery.nim +++ b/tests/codex/blockexchange/discovery/testdiscovery.nim @@ -2,7 +2,6 @@ import std/sequtils import std/sugar import std/tables -import pkg/asynctest/chronos/unittest import pkg/chronos import pkg/libp2p/errors @@ -15,11 +14,12 @@ import pkg/codex/manifest import pkg/codex/merkletree import pkg/codex/blocktype as bt -import ../../helpers/mockdiscovery - +import ../../../asynctest import ../../helpers +import ../../helpers/mockdiscovery import ../../examples + asyncchecksuite "Block Advertising and Discovery": let chunker = RandomChunker.new(Rng.instance(), size = 4096, chunkSize = 256) diff --git a/tests/codex/blockexchange/discovery/testdiscoveryengine.nim b/tests/codex/blockexchange/discovery/testdiscoveryengine.nim index cdaedcc3..43bcfe3b 100644 --- a/tests/codex/blockexchange/discovery/testdiscoveryengine.nim +++ b/tests/codex/blockexchange/discovery/testdiscoveryengine.nim @@ -2,8 +2,6 @@ import std/sequtils import std/sugar import std/tables -import pkg/asynctest/chronos/unittest - import pkg/chronos import pkg/codex/rng @@ -13,9 +11,9 @@ import pkg/codex/chunker import pkg/codex/blocktype as bt import pkg/codex/blockexchange/engine -import ../../helpers/mockdiscovery - +import ../../../asynctest import ../../helpers +import ../../helpers/mockdiscovery import ../../examples asyncchecksuite "Test Discovery Engine": diff --git a/tests/codex/blockexchange/engine/testblockexc.nim b/tests/codex/blockexchange/engine/testblockexc.nim index 2d927796..33ec374e 100644 --- a/tests/codex/blockexchange/engine/testblockexc.nim +++ b/tests/codex/blockexchange/engine/testblockexc.nim @@ -1,7 +1,6 @@ import std/sequtils import std/algorithm -import pkg/asynctest/chronos/unittest import pkg/chronos import pkg/stew/byteutils @@ -12,6 +11,7 @@ import pkg/codex/chunker import pkg/codex/discovery import pkg/codex/blocktype as bt +import ../../../asynctest import ../../examples import ../../helpers diff --git a/tests/codex/blockexchange/engine/testengine.nim b/tests/codex/blockexchange/engine/testengine.nim index d9172442..b13e6338 100644 --- a/tests/codex/blockexchange/engine/testengine.nim +++ b/tests/codex/blockexchange/engine/testengine.nim @@ -3,7 +3,6 @@ import std/random import std/algorithm import pkg/stew/byteutils -import pkg/asynctest/chronos/unittest import pkg/chronos import pkg/libp2p/errors import pkg/libp2p/routing_record @@ -17,6 +16,7 @@ import pkg/codex/discovery import pkg/codex/blocktype import pkg/codex/utils/asyncheapqueue +import ../../../asynctest import ../../helpers import ../../examples diff --git a/tests/codex/blockexchange/protobuf/testpayments.nim b/tests/codex/blockexchange/protobuf/testpayments.nim index ca0cde1c..81bc5dfc 100644 --- a/tests/codex/blockexchange/protobuf/testpayments.nim +++ b/tests/codex/blockexchange/protobuf/testpayments.nim @@ -1,9 +1,11 @@ -import pkg/asynctest/chronos/unittest import pkg/chronos import pkg/stew/byteutils +import pkg/codex/stores + +import ../../../asynctest import ../../examples import ../../helpers -import pkg/codex/stores + checksuite "account protobuf messages": diff --git a/tests/codex/blockexchange/protobuf/testpresence.nim b/tests/codex/blockexchange/protobuf/testpresence.nim index 72997a8d..963dd0ec 100644 --- a/tests/codex/blockexchange/protobuf/testpresence.nim +++ b/tests/codex/blockexchange/protobuf/testpresence.nim @@ -1,7 +1,8 @@ -import pkg/asynctest/chronos/unittest import pkg/chronos import pkg/codex/blockexchange/protobuf/presence + +import ../../../asynctest import ../../examples import ../../helpers diff --git a/tests/codex/blockexchange/testnetwork.nim b/tests/codex/blockexchange/testnetwork.nim index 12648e74..943f1e46 100644 --- a/tests/codex/blockexchange/testnetwork.nim +++ b/tests/codex/blockexchange/testnetwork.nim @@ -1,7 +1,6 @@ import std/sequtils import std/tables -import pkg/asynctest/chronos/unittest import pkg/chronos import pkg/codex/rng @@ -9,8 +8,9 @@ import pkg/codex/chunker import pkg/codex/blocktype as bt import pkg/codex/blockexchange -import ../helpers +import ../../asynctest import ../examples +import ../helpers asyncchecksuite "Network - Handlers": let diff --git a/tests/codex/blockexchange/testpendingblocks.nim b/tests/codex/blockexchange/testpendingblocks.nim index 6d603608..dd94c4da 100644 --- a/tests/codex/blockexchange/testpendingblocks.nim +++ b/tests/codex/blockexchange/testpendingblocks.nim @@ -2,13 +2,13 @@ import std/sequtils import std/algorithm import pkg/chronos -import pkg/asynctest/chronos/unittest import pkg/stew/byteutils import pkg/codex/blocktype as bt import pkg/codex/blockexchange import ../helpers +import ../../asynctest checksuite "Pending Blocks": test "Should add want handle": diff --git a/tests/codex/node/helpers.nim b/tests/codex/node/helpers.nim index dd441601..210ab53e 100644 --- a/tests/codex/node/helpers.nim +++ b/tests/codex/node/helpers.nim @@ -3,11 +3,12 @@ import std/times import pkg/libp2p import pkg/chronos -import pkg/asynctest/chronos/unittest import pkg/codex/codextypes import pkg/codex/chunker +import ../../asynctest + proc toTimesDuration*(d: chronos.Duration): times.Duration = initDuration(seconds = d.seconds) diff --git a/tests/codex/node/testcontracts.nim b/tests/codex/node/testcontracts.nim index feb64c7c..1adb6991 100644 --- a/tests/codex/node/testcontracts.nim +++ b/tests/codex/node/testcontracts.nim @@ -5,7 +5,6 @@ import std/times import std/sequtils import std/importutils -import pkg/asynctest/chronos/unittest import pkg/chronos import pkg/stew/byteutils import pkg/datastore @@ -35,6 +34,7 @@ import pkg/codex/utils/asynciter import pkg/codex/node {.all.} +import ../../asynctest import ../../examples import ../helpers import ../helpers/mockmarket diff --git a/tests/codex/node/testnode.nim b/tests/codex/node/testnode.nim index 6f1ee30a..10dc10d4 100644 --- a/tests/codex/node/testnode.nim +++ b/tests/codex/node/testnode.nim @@ -5,7 +5,6 @@ import std/times import std/sequtils import std/importutils -import pkg/asynctest/chronos/unittest import pkg/chronos import pkg/stew/byteutils import pkg/datastore @@ -34,6 +33,7 @@ import pkg/codex/blocktype as bt import pkg/codex/node {.all.} +import ../../asynctest import ../examples import ../helpers import ../helpers/mockmarket diff --git a/tests/codex/sales/states/testfilled.nim b/tests/codex/sales/states/testfilled.nim index 15ed7315..1e5e292f 100644 --- a/tests/codex/sales/states/testfilled.nim +++ b/tests/codex/sales/states/testfilled.nim @@ -1,4 +1,3 @@ -import pkg/asynctest/chronos/unittest import pkg/questionable/results import pkg/codex/clock @@ -11,6 +10,7 @@ import pkg/codex/sales/states/errored import pkg/codex/sales/states/proving import pkg/codex/sales/states/finished +import ../../../asynctest import ../../helpers/mockmarket import ../../examples import ../../helpers diff --git a/tests/codex/sales/states/testinitialproving.nim b/tests/codex/sales/states/testinitialproving.nim index 2429e62d..a47406a2 100644 --- a/tests/codex/sales/states/testinitialproving.nim +++ b/tests/codex/sales/states/testinitialproving.nim @@ -1,4 +1,3 @@ -import pkg/asynctest/chronos/unittest import pkg/questionable import pkg/chronos import pkg/codex/contracts/requests @@ -10,6 +9,8 @@ import pkg/codex/sales/states/errored import pkg/codex/sales/salesagent import pkg/codex/sales/salescontext import pkg/codex/market + +import ../../../asynctest import ../../examples import ../../helpers import ../../helpers/mockmarket diff --git a/tests/codex/sales/states/testproving.nim b/tests/codex/sales/states/testproving.nim index 70a2cd73..a14d3975 100644 --- a/tests/codex/sales/states/testproving.nim +++ b/tests/codex/sales/states/testproving.nim @@ -1,4 +1,3 @@ -import pkg/asynctest/chronos/unittest import pkg/chronos import pkg/questionable import pkg/codex/contracts/requests @@ -8,6 +7,8 @@ import pkg/codex/sales/states/failed import pkg/codex/sales/states/payout import pkg/codex/sales/salesagent import pkg/codex/sales/salescontext + +import ../../../asynctest import ../../examples import ../../helpers import ../../helpers/mockmarket diff --git a/tests/codex/sales/states/testsimulatedproving.nim b/tests/codex/sales/states/testsimulatedproving.nim index 9262a3ea..e9efa617 100644 --- a/tests/codex/sales/states/testsimulatedproving.nim +++ b/tests/codex/sales/states/testsimulatedproving.nim @@ -1,4 +1,3 @@ -import pkg/asynctest/chronos/unittest import pkg/chronos import pkg/questionable import pkg/codex/contracts/requests @@ -9,6 +8,8 @@ import pkg/codex/sales/states/failed import pkg/codex/sales/states/payout import pkg/codex/sales/salesagent import pkg/codex/sales/salescontext + +import ../../../asynctest import ../../examples import ../../helpers import ../../helpers/mockmarket diff --git a/tests/codex/sales/states/testunknown.nim b/tests/codex/sales/states/testunknown.nim index beb2b226..e02b3c90 100644 --- a/tests/codex/sales/states/testunknown.nim +++ b/tests/codex/sales/states/testunknown.nim @@ -1,4 +1,3 @@ -import pkg/asynctest/chronos/unittest import pkg/codex/contracts/requests import pkg/codex/sales import pkg/codex/sales/salesagent @@ -9,6 +8,8 @@ import pkg/codex/sales/states/filled import pkg/codex/sales/states/finished import pkg/codex/sales/states/failed import pkg/codex/sales/states/payout + +import ../../../asynctest import ../../helpers/mockmarket import ../../examples import ../../helpers diff --git a/tests/codex/sales/testreservations.nim b/tests/codex/sales/testreservations.nim index 1f9e5577..08c0bf95 100644 --- a/tests/codex/sales/testreservations.nim +++ b/tests/codex/sales/testreservations.nim @@ -3,13 +3,13 @@ import std/random import pkg/questionable import pkg/questionable/results import pkg/chronos -import pkg/asynctest/chronos/unittest import pkg/datastore import pkg/codex/stores import pkg/codex/sales import pkg/codex/utils/json +import ../../asynctest import ../examples import ../helpers diff --git a/tests/codex/sales/testsales.nim b/tests/codex/sales/testsales.nim index 49ca567d..24e8c059 100644 --- a/tests/codex/sales/testsales.nim +++ b/tests/codex/sales/testsales.nim @@ -1,7 +1,6 @@ import std/sequtils import std/sugar import std/times -import pkg/asynctest/chronos/unittest import pkg/chronos import pkg/datastore import pkg/questionable @@ -14,7 +13,7 @@ import pkg/codex/sales/slotqueue import pkg/codex/stores/repostore import pkg/codex/blocktype as bt import pkg/codex/node -import pkg/codex/utils/asyncspawn +import ../../asynctest import ../helpers import ../helpers/mockmarket import ../helpers/mockclock @@ -289,7 +288,7 @@ asyncchecksuite "Sales": slot: UInt256, onBatch: BatchProc): Future[?!void] {.async.} = let blk = bt.Block.new( @[1.byte] ).get - asyncSpawn onBatch( blk.repeat(request.ask.slotSize.truncate(int)) ) + discard await onBatch( blk.repeat(request.ask.slotSize.truncate(int)) ) return success() createAvailability() @@ -303,7 +302,7 @@ asyncchecksuite "Sales": onBatch: BatchProc): Future[?!void] {.async.} = slotIndex = slot let blk = bt.Block.new( @[1.byte] ).get - asyncSpawn onBatch(@[ blk ]) + discard await onBatch(@[ blk ]) return success() let sold = newFuture[void]() sales.onSale = proc(request: StorageRequest, slotIndex: UInt256) = diff --git a/tests/codex/sales/testsalesagent.nim b/tests/codex/sales/testsalesagent.nim index 90f1e98e..329e7b68 100644 --- a/tests/codex/sales/testsalesagent.nim +++ b/tests/codex/sales/testsalesagent.nim @@ -1,5 +1,4 @@ import std/times -import pkg/asynctest/chronos/unittest import pkg/chronos import pkg/codex/sales import pkg/codex/sales/salesagent @@ -7,6 +6,8 @@ import pkg/codex/sales/salescontext import pkg/codex/sales/statemachine import pkg/codex/sales/states/errorhandling import pkg/codex/proving + +import ../../asynctest import ../helpers/mockmarket import ../helpers/mockclock import ../helpers diff --git a/tests/codex/sales/testslotqueue.nim b/tests/codex/sales/testslotqueue.nim index 67ea7eca..2e30fb3a 100644 --- a/tests/codex/sales/testslotqueue.nim +++ b/tests/codex/sales/testslotqueue.nim @@ -1,5 +1,4 @@ import std/sequtils -import pkg/asynctest/chronos/unittest import pkg/chronicles import pkg/chronos import pkg/datastore @@ -9,6 +8,7 @@ import pkg/questionable/results import pkg/codex/logutils import pkg/codex/sales/slotqueue +import ../../asynctest import ../helpers import ../helpers/mockmarket import ../examples diff --git a/tests/codex/slots/testconverters.nim b/tests/codex/slots/testconverters.nim index 1881da65..cf18d6b2 100644 --- a/tests/codex/slots/testconverters.nim +++ b/tests/codex/slots/testconverters.nim @@ -1,12 +1,12 @@ import pkg/chronos -import pkg/asynctest/chronos/unittest import pkg/poseidon2 import pkg/poseidon2/io import pkg/constantine/math/io/io_fields import pkg/questionable/results import pkg/codex/merkletree - import pkg/codex/slots/converters + +import ../../asynctest import ../examples import ../merkletree/helpers diff --git a/tests/codex/slots/testsampler.nim b/tests/codex/slots/testsampler.nim index 8956a131..bf8102f8 100644 --- a/tests/codex/slots/testsampler.nim +++ b/tests/codex/slots/testsampler.nim @@ -26,7 +26,8 @@ import pkg/codex/slots/builder/builder import ../helpers import ../examples import ../merkletree/helpers -import testsampler_expected +import ../../asynctest +import ./testsampler_expected import ./provingtestenv asyncchecksuite "Test DataSampler": diff --git a/tests/codex/slots/testslotbuilder.nim b/tests/codex/slots/testslotbuilder.nim index 5c8a8b48..24b760a9 100644 --- a/tests/codex/slots/testslotbuilder.nim +++ b/tests/codex/slots/testslotbuilder.nim @@ -4,7 +4,6 @@ import std/importutils import std/sugar import pkg/chronos -import pkg/asynctest/chronos/unittest import pkg/questionable/results import pkg/codex/blocktype as bt import pkg/codex/rng @@ -19,6 +18,7 @@ import pkg/poseidon2 import pkg/poseidon2/io import constantine/math/io/io_fields +import ../../asynctest import ../helpers import ../examples import ../merkletree/helpers diff --git a/tests/codex/slots/testutils.nim b/tests/codex/slots/testutils.nim index 736d4a9f..8c1db0c4 100644 --- a/tests/codex/slots/testutils.nim +++ b/tests/codex/slots/testutils.nim @@ -10,7 +10,6 @@ import pkg/constantine/math/io/io_fields import pkg/poseidon2/io import pkg/poseidon2 import pkg/chronos -import pkg/asynctest/chronos/unittest import pkg/codex/stores/cachestore import pkg/codex/chunker import pkg/codex/stores @@ -22,6 +21,7 @@ import pkg/codex/stores/cachestore import pkg/codex/slots/sampler/utils +import ../../asynctest import ../helpers import ../examples import ../merkletree/helpers diff --git a/tests/codex/stores/commonstoretests.nim b/tests/codex/stores/commonstoretests.nim index 46cb051b..863b59d4 100644 --- a/tests/codex/stores/commonstoretests.nim +++ b/tests/codex/stores/commonstoretests.nim @@ -3,7 +3,6 @@ import std/strutils import std/options import pkg/chronos -import pkg/asynctest/chronos/unittest import pkg/libp2p/multicodec import pkg/stew/byteutils import pkg/questionable @@ -14,6 +13,7 @@ import pkg/codex/manifest import pkg/codex/merkletree import pkg/codex/utils +import ../../asynctest import ../helpers type diff --git a/tests/codex/stores/testcachestore.nim b/tests/codex/stores/testcachestore.nim index e366a470..51c59bbf 100644 --- a/tests/codex/stores/testcachestore.nim +++ b/tests/codex/stores/testcachestore.nim @@ -1,7 +1,6 @@ import std/strutils import pkg/chronos -import pkg/asynctest/chronos/unittest import pkg/stew/byteutils import pkg/questionable/results import pkg/codex/stores/cachestore @@ -9,6 +8,7 @@ import pkg/codex/chunker import ./commonstoretests +import ../../asynctest import ../helpers checksuite "Cache Store": diff --git a/tests/codex/stores/testkeyutils.nim b/tests/codex/stores/testkeyutils.nim index 6e5e171b..c750df05 100644 --- a/tests/codex/stores/testkeyutils.nim +++ b/tests/codex/stores/testkeyutils.nim @@ -10,13 +10,13 @@ import std/random import std/sequtils import pkg/chronos -import pkg/asynctest/chronos/unittest import pkg/questionable import pkg/questionable/results import pkg/codex/blocktype as bt import pkg/codex/stores/repostore import pkg/codex/clock +import ../../asynctest import ../helpers/mocktimer import ../helpers/mockrepostore import ../helpers/mockclock diff --git a/tests/codex/stores/testmaintenance.nim b/tests/codex/stores/testmaintenance.nim index da6aff54..c050f623 100644 --- a/tests/codex/stores/testmaintenance.nim +++ b/tests/codex/stores/testmaintenance.nim @@ -8,12 +8,12 @@ ## those terms. import pkg/chronos -import pkg/asynctest/chronos/unittest import pkg/questionable/results import pkg/codex/blocktype as bt import pkg/codex/stores/repostore import pkg/codex/clock +import ../../asynctest import ../helpers import ../helpers/mocktimer import ../helpers/mockrepostore diff --git a/tests/codex/stores/testrepostore.nim b/tests/codex/stores/testrepostore.nim index 0677cc95..e58eeb29 100644 --- a/tests/codex/stores/testrepostore.nim +++ b/tests/codex/stores/testrepostore.nim @@ -6,7 +6,6 @@ import pkg/questionable import pkg/questionable/results import pkg/chronos -import pkg/asynctest/chronos/unittest import pkg/stew/byteutils import pkg/stew/endians2 import pkg/datastore @@ -18,6 +17,7 @@ import pkg/codex/blocktype as bt import pkg/codex/clock import pkg/codex/utils/asynciter +import ../../asynctest import ../helpers import ../helpers/mockclock import ../examples diff --git a/tests/codex/testasyncheapqueue.nim b/tests/codex/testasyncheapqueue.nim index a2ae5069..10bab65d 100644 --- a/tests/codex/testasyncheapqueue.nim +++ b/tests/codex/testasyncheapqueue.nim @@ -1,10 +1,10 @@ import pkg/chronos -import pkg/asynctest/chronos/unittest import pkg/stew/results import pkg/codex/utils/asyncheapqueue import pkg/codex/rng +import ../asynctest import ./helpers type diff --git a/tests/codex/testasyncstreamwrapper.nim b/tests/codex/testasyncstreamwrapper.nim index b55843d1..8a325351 100644 --- a/tests/codex/testasyncstreamwrapper.nim +++ b/tests/codex/testasyncstreamwrapper.nim @@ -1,4 +1,3 @@ -import pkg/asynctest/chronos/unittest import pkg/chronos import pkg/chronos/transports/stream import pkg/chronos/transports/common @@ -6,6 +5,7 @@ import pkg/chronos/streams/asyncstream import pkg/codex/streams import pkg/stew/byteutils +import ../asynctest import ./helpers asyncchecksuite "AsyncStreamWrapper": diff --git a/tests/codex/testchunking.nim b/tests/codex/testchunking.nim index fca776ff..f4f40a29 100644 --- a/tests/codex/testchunking.nim +++ b/tests/codex/testchunking.nim @@ -1,10 +1,10 @@ -import pkg/asynctest/chronos/unittest import pkg/stew/byteutils import pkg/codex/chunker import pkg/codex/logutils import pkg/chronos +import ../asynctest import ./helpers asyncchecksuite "Chunking": diff --git a/tests/codex/testerasure.nim b/tests/codex/testerasure.nim index 5d7e3e5a..667e3100 100644 --- a/tests/codex/testerasure.nim +++ b/tests/codex/testerasure.nim @@ -1,7 +1,6 @@ import std/sequtils import std/sugar -import pkg/asynctest/chronos/unittest import pkg/chronos import pkg/datastore import pkg/questionable/results @@ -13,6 +12,7 @@ import pkg/codex/blocktype as bt import pkg/codex/rng import pkg/codex/utils +import ../asynctest import ./helpers suite "Erasure encode/decode": diff --git a/tests/codex/testindexingstrategy.nim b/tests/codex/testindexingstrategy.nim index f7a8f67d..d571c65d 100644 --- a/tests/codex/testindexingstrategy.nim +++ b/tests/codex/testindexingstrategy.nim @@ -1,9 +1,9 @@ import std/sequtils import pkg/chronos -import pkg/asynctest/chronos/unittest import pkg/codex/utils/asynciter +import ../asynctest import ./helpers import pkg/codex/indexingstrategy diff --git a/tests/codex/testmanifest.nim b/tests/codex/testmanifest.nim index f79ffab0..4fe39f47 100644 --- a/tests/codex/testmanifest.nim +++ b/tests/codex/testmanifest.nim @@ -2,9 +2,6 @@ import std/sequtils import pkg/chronos import pkg/questionable/results -import pkg/asynctest/chronos/unittest -import pkg/stew/byteutils - import pkg/codex/chunker import pkg/codex/blocktype as bt import pkg/codex/manifest @@ -13,6 +10,7 @@ import pkg/poseidon2 import pkg/codex/slots import pkg/codex/merkletree +import ../asynctest import ./helpers import ./examples diff --git a/tests/codex/testpurchasing.nim b/tests/codex/testpurchasing.nim index f7778029..1660cb6a 100644 --- a/tests/codex/testpurchasing.nim +++ b/tests/codex/testpurchasing.nim @@ -1,5 +1,4 @@ import std/times -import pkg/asynctest/chronos/unittest import pkg/chronos import pkg/stint import pkg/codex/purchasing @@ -9,6 +8,8 @@ import pkg/codex/purchasing/states/submitted import pkg/codex/purchasing/states/unknown import pkg/codex/purchasing/states/cancelled import pkg/codex/purchasing/states/failed + +import ../asynctest import ./helpers/mockmarket import ./helpers/mockclock import ./examples diff --git a/tests/codex/teststorestream.nim b/tests/codex/teststorestream.nim index 00eed526..eaf92c1d 100644 --- a/tests/codex/teststorestream.nim +++ b/tests/codex/teststorestream.nim @@ -1,14 +1,14 @@ import pkg/chronos -import pkg/asynctest/chronos/unittest import pkg/questionable/results -import ./helpers - import pkg/codex/streams import pkg/codex/stores import pkg/codex/manifest import pkg/codex/blocktype as bt +import ../asynctest +import ./helpers + asyncchecksuite "StoreStream": var manifest: Manifest diff --git a/tests/codex/testvalidation.nim b/tests/codex/testvalidation.nim index 4f8d9d4a..9e4a2dcf 100644 --- a/tests/codex/testvalidation.nim +++ b/tests/codex/testvalidation.nim @@ -1,8 +1,9 @@ -import pkg/asynctest/chronos/unittest import pkg/chronos import codex/validation import codex/periods + +import ../asynctest import ./helpers/mockmarket import ./helpers/mockclock import ./examples diff --git a/tests/codex/utils/testasyncstatemachine.nim b/tests/codex/utils/testasyncstatemachine.nim index 23e0489e..7871bcd8 100644 --- a/tests/codex/utils/testasyncstatemachine.nim +++ b/tests/codex/utils/testasyncstatemachine.nim @@ -1,8 +1,9 @@ -import pkg/asynctest/chronos/unittest import pkg/questionable import pkg/chronos import pkg/upraises import codex/utils/asyncstatemachine + +import ../../asynctest import ../helpers type diff --git a/tests/codex/utils/testthen.nim b/tests/codex/utils/testthen.nim index 3d388446..a66e8cd2 100644 --- a/tests/codex/utils/testthen.nim +++ b/tests/codex/utils/testthen.nim @@ -1,8 +1,9 @@ -import pkg/asynctest/chronos/unittest import pkg/chronos import pkg/questionable import pkg/questionable/results import codex/utils/then + +import ../../asynctest import ../helpers proc newError(): ref CatchableError = diff --git a/tests/codex/utils/testtimer.nim b/tests/codex/utils/testtimer.nim index e3549903..303c43fb 100644 --- a/tests/codex/utils/testtimer.nim +++ b/tests/codex/utils/testtimer.nim @@ -8,9 +8,10 @@ ## those terms. import pkg/chronos -import pkg/asynctest/chronos/unittest import codex/utils/timer + +import ../../asynctest import ../helpers asyncchecksuite "Timer": diff --git a/tests/codex/utils/testtrackedfutures.nim b/tests/codex/utils/testtrackedfutures.nim index 4b0cf0b9..9274f84f 100644 --- a/tests/codex/utils/testtrackedfutures.nim +++ b/tests/codex/utils/testtrackedfutures.nim @@ -1,6 +1,7 @@ -import pkg/asynctest/chronos/unittest import pkg/chronos import codex/utils/trackedfutures + +import ../../asynctest import ../helpers type Module = object diff --git a/tests/contracts/testDeployment.nim b/tests/contracts/testDeployment.nim index 81c6c0bd..d5cb1727 100644 --- a/tests/contracts/testDeployment.nim +++ b/tests/contracts/testDeployment.nim @@ -1,9 +1,9 @@ -import pkg/asynctest/chronos/unittest import pkg/ethers import codex/contracts/deployment import codex/conf import codex/contracts +import ../asynctest import ../checktest type MockProvider = ref object of Provider diff --git a/tests/ethertest.nim b/tests/ethertest.nim index 6b6c3d37..8859f714 100644 --- a/tests/ethertest.nim +++ b/tests/ethertest.nim @@ -1,6 +1,7 @@ -import pkg/asynctest/chronos/unittest +import std/json import pkg/ethers +import ./asynctest import ./checktest ## Unit testing suite that sets up an Ethereum testing environment. diff --git a/tests/testTaiko.nim b/tests/testTaiko.nim index 54ac99ee..49ad3226 100644 --- a/tests/testTaiko.nim +++ b/tests/testTaiko.nim @@ -2,13 +2,15 @@ import std/times import std/os import std/json import std/tempfiles -import pkg/asynctest/chronos/unittest import pkg/chronos import pkg/stint import pkg/questionable import pkg/questionable/results + +import ./asynctest import ./integration/nodes + suite "Taiko L2 Integration Tests": var node1, node2: NodeProcess