2018-10-18 09:19:10 +02:00
|
|
|
import {assert} from "chai"
|
2018-10-16 14:56:18 +02:00
|
|
|
import ConfigProvider from "../../src/ConfigProvider"
|
|
|
|
import ContractHandler from "../../src/keeper/ContractHandler"
|
|
|
|
import config from "../config"
|
|
|
|
|
|
|
|
describe("ContractHandler", () => {
|
|
|
|
|
2018-10-26 10:40:46 +02:00
|
|
|
before(async () => {
|
|
|
|
ConfigProvider.setConfig(config)
|
2018-11-06 16:13:12 +01:00
|
|
|
await ContractHandler.prepareContracts()
|
2018-10-26 10:40:46 +02:00
|
|
|
})
|
|
|
|
|
2018-10-16 14:56:18 +02:00
|
|
|
describe("#get()", () => {
|
|
|
|
|
|
|
|
it("should load and get OceanToken correctly", async () => {
|
2018-10-18 09:19:10 +02:00
|
|
|
assert(await ContractHandler.get("OceanToken"))
|
2018-10-16 14:56:18 +02:00
|
|
|
})
|
|
|
|
|
2018-10-18 09:19:10 +02:00
|
|
|
it("should fail to load an unknown contract", (done) => {
|
|
|
|
|
|
|
|
ContractHandler.get("OceanXXX")
|
|
|
|
.catch(() => {
|
|
|
|
|
|
|
|
done()
|
|
|
|
})
|
|
|
|
})
|
2018-10-16 14:56:18 +02:00
|
|
|
})
|
|
|
|
})
|