mirror of
https://github.com/codex-storage/nim-codex.git
synced 2025-01-09 12:35:51 +00:00
bd594c9aaf
* adding tracker for streamstore * adding tracker tests * Sets up tracker helper functions and closes streams in testnode.nim * Deploying checksuite for memory leak tracker checking. * Successfully deploys checksuite and asyncchecksuite. * Fix leak in testpor.nim * Fixes leaked storestream in testnetwork.nim * Fixes integration tests * Cleanup * cleanup comment by Mark --------- Co-authored-by: benbierens <thatbenbierens@gmail.com>
25 lines
643 B
Nim
25 lines
643 B
Nim
import std/unittest
|
|
import pkg/questionable
|
|
import pkg/codex/contracts/requests
|
|
import pkg/codex/sales/states/finished
|
|
import pkg/codex/sales/states/cancelled
|
|
import pkg/codex/sales/states/failed
|
|
import ../../examples
|
|
import ../../helpers
|
|
|
|
checksuite "sales state 'finished'":
|
|
|
|
let request = StorageRequest.example
|
|
var state: SaleFinished
|
|
|
|
setup:
|
|
state = SaleFinished.new()
|
|
|
|
test "switches to cancelled state when request expires":
|
|
let next = state.onCancelled(request)
|
|
check !next of SaleCancelled
|
|
|
|
test "switches to failed state when request fails":
|
|
let next = state.onFailed(request)
|
|
check !next of SaleFailed
|