mirror of
https://github.com/codex-storage/nim-codex.git
synced 2025-01-09 20:45:38 +00:00
df729be261
* [marketplace] support removal of Storage contract * [marketplace] change submod dep dagger-contracts to codex-contracts-eth
35 lines
978 B
Nim
35 lines
978 B
Nim
import std/os
|
|
import codex/contracts
|
|
import ../ethertest
|
|
import ./examples
|
|
|
|
ethersuite "Marketplace Contract Interactions":
|
|
|
|
let account = Address.example
|
|
|
|
var contracts: ContractInteractions
|
|
|
|
setup:
|
|
contracts = !ContractInteractions.new(account)
|
|
|
|
test "can be instantiated with a signer and deployment info":
|
|
let signer = provider.getSigner()
|
|
let deployment = deployment()
|
|
check ContractInteractions.new(signer, deployment).isSome
|
|
|
|
test "can be instantiated with a provider url":
|
|
let url = "http://localhost:8545"
|
|
let account = Address.example
|
|
let deployment = "vendor" / "codex-contracts-eth" / "deployment-localhost.json"
|
|
check ContractInteractions.new(url, account).isSome
|
|
check ContractInteractions.new(url, account, deployment).isSome
|
|
|
|
test "provides purchasing":
|
|
check contracts.purchasing != nil
|
|
|
|
test "provides sales":
|
|
check contracts.sales != nil
|
|
|
|
test "provides proving":
|
|
check contracts.proving != nil
|