2023-03-27 13:47:25 +00:00
|
|
|
import std/os
|
|
|
|
import std/macros
|
2024-12-17 13:01:41 +00:00
|
|
|
import pkg/questionable
|
|
|
|
import ./multinodes
|
|
|
|
import ./codexconfig
|
|
|
|
import ./codexprocess
|
2023-03-27 13:47:25 +00:00
|
|
|
import ./codexclient
|
2024-12-17 13:01:41 +00:00
|
|
|
import ./nodeconfigs
|
2023-03-27 13:47:25 +00:00
|
|
|
|
|
|
|
export codexclient
|
2024-12-17 13:01:41 +00:00
|
|
|
export multinodes
|
2023-03-27 13:47:25 +00:00
|
|
|
|
2024-12-17 13:01:41 +00:00
|
|
|
template twonodessuite*(name: string, body: untyped) =
|
|
|
|
multinodesuite name:
|
|
|
|
let twoNodesConfig {.inject, used.} = NodeConfigs(clients: CodexConfigs.init(nodes=2).some)
|
2023-05-15 07:02:57 +00:00
|
|
|
|
2024-12-17 13:01:41 +00:00
|
|
|
var node1 {.inject, used.}: CodexProcess
|
|
|
|
var node2 {.inject, used.}: CodexProcess
|
2023-03-27 13:47:25 +00:00
|
|
|
var client1 {.inject, used.}: CodexClient
|
|
|
|
var client2 {.inject, used.}: CodexClient
|
2023-05-15 07:02:57 +00:00
|
|
|
var account1 {.inject, used.}: Address
|
|
|
|
var account2 {.inject, used.}: Address
|
2023-03-27 13:47:25 +00:00
|
|
|
|
|
|
|
setup:
|
2023-05-15 07:02:57 +00:00
|
|
|
account1 = accounts[0]
|
|
|
|
account2 = accounts[1]
|
2023-03-27 13:47:25 +00:00
|
|
|
|
2024-12-17 13:01:41 +00:00
|
|
|
node1 = clients()[0]
|
|
|
|
node2 = clients()[1]
|
2023-03-27 13:47:25 +00:00
|
|
|
|
2024-12-17 13:01:41 +00:00
|
|
|
client1 = node1.client
|
|
|
|
client2 = node2.client
|
2023-03-27 13:47:25 +00:00
|
|
|
|
|
|
|
body
|