2022-04-25 13:12:37 +00:00
|
|
|
import std/os
|
2022-04-13 11:18:38 +00:00
|
|
|
import ./ethertest
|
|
|
|
import dagger/contracts
|
2022-04-14 08:34:42 +00:00
|
|
|
import ./examples
|
2022-04-13 11:18:38 +00:00
|
|
|
|
|
|
|
ethersuite "Storage Contract Interactions":
|
|
|
|
|
|
|
|
var contracts: ContractInteractions
|
|
|
|
|
|
|
|
setup:
|
2022-04-25 13:12:37 +00:00
|
|
|
contracts = !ContractInteractions.new()
|
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-04-14 08:34:42 +00:00
|
|
|
test "can be instantiated with a provider url and account":
|
|
|
|
let url = "http://localhost:8545"
|
|
|
|
let account = Address.example
|
2022-04-25 13:12:37 +00:00
|
|
|
let deployment = "vendor" / "dagger-contracts" / "deployment-localhost.json"
|
|
|
|
check ContractInteractions.new(url).isSome
|
|
|
|
check ContractInteractions.new(url, account = account).isSome
|
|
|
|
check ContractInteractions.new(url, deploymentFile = 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
|