2022-04-25 13:12:37 +00:00
|
|
|
import std/os
|
2022-05-19 19:56:03 +00:00
|
|
|
import codex/contracts
|
2022-05-11 12:17:07 +00:00
|
|
|
import ../ethertest
|
2022-04-14 08:34:42 +00:00
|
|
|
import ./examples
|
2022-04-13 11:18:38 +00:00
|
|
|
|
2023-01-19 05:58:04 +00:00
|
|
|
ethersuite "Marketplace Contract Interactions":
|
2022-04-13 11:18:38 +00:00
|
|
|
|
2022-08-09 04:29:06 +00:00
|
|
|
let account = Address.example
|
|
|
|
|
2022-04-13 11:18:38 +00:00
|
|
|
var contracts: ContractInteractions
|
|
|
|
|
|
|
|
setup:
|
2022-08-09 04:29:06 +00:00
|
|
|
contracts = !ContractInteractions.new(account)
|
2022-04-13 11:18:38 +00:00
|
|
|
|
|
|
|
test "can be instantiated with a signer and deployment info":
|
|
|
|
let signer = provider.getSigner()
|
|
|
|
let deployment = deployment()
|
2022-04-25 13:12:37 +00:00
|
|
|
check ContractInteractions.new(signer, deployment).isSome
|
2022-04-13 11:18:38 +00:00
|
|
|
|
2022-08-09 04:29:06 +00:00
|
|
|
test "can be instantiated with a provider url":
|
2022-04-14 08:34:42 +00:00
|
|
|
let url = "http://localhost:8545"
|
|
|
|
let account = Address.example
|
2023-01-19 05:58:04 +00:00
|
|
|
let deployment = "vendor" / "codex-contracts-eth" / "deployment-localhost.json"
|
2022-08-09 04:29:06 +00:00
|
|
|
check ContractInteractions.new(url, account).isSome
|
|
|
|
check ContractInteractions.new(url, account, deployment).isSome
|
2022-04-14 08:34:42 +00:00
|
|
|
|
2022-04-13 11:18:38 +00:00
|
|
|
test "provides purchasing":
|
|
|
|
check contracts.purchasing != nil
|
|
|
|
|
|
|
|
test "provides sales":
|
|
|
|
check contracts.sales != nil
|
|
|
|
|
|
|
|
test "provides proving":
|
|
|
|
check contracts.proving != nil
|