Swap contract module test - initial step (#369)

* Basic pwd shelling out script

* Get balance string from running node

* Add comment re manual test

* Add TODOs
This commit is contained in:
Oskar Thorén 2021-02-08 22:19:34 +08:00 committed by GitHub
parent 1d9e3afaa4
commit d05692587d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 31 additions and 0 deletions

View File

@ -13,3 +13,7 @@ import
./v2/test_peer_manager,
./v2/test_web3, # TODO remove it when rln-relay tests get finalized
./v2/test_waku_rln_relay
# TODO Only enable this once swap module is integrated more nicely as a dependency, i.e. as submodule with CI etc
# For PoC execute it manually and run separate module here: https://github.com/vacp2p/swap-contracts-module
# ./v2/test_waku_swap_contracts

View File

@ -0,0 +1,27 @@
# Tests of Swap contracts via external module
#
import
std/[unittest, options, tables, sets, osproc, strutils, strformat],
../test_helpers, ./utils
procSuite "Basic balance test":
test "Get pwd of swap module":
let (output, errC) = osproc.execCmdEx("(cd ../swap-contracts-module && pwd)")
echo output
check:
contains(output, "swap-contracts-module")
test "Get balance from running node":
# NOTE: This corresponds to the first default account in Hardhat
let taskString = "npx hardhat balance --account 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266"
let cmdString = "cd ../swap-contracts-module; " & &"{taskString}"
echo cmdString
let (output, errC) = osproc.execCmdEx(cmdString)
echo output
check:
contains(output, "ETH")
# TODO Setup more tasks in Swap module for e2e PoC
# TODO Use basic JSON interface instead of strings for basic IO