1
0
mirror of https://github.com/oceanprotocol-archive/squid-js.git synced 2024-02-02 15:31:51 +01:00
squid-js/test/keeper/ContractHandler.test.ts

31 lines
811 B
TypeScript
Raw Normal View History

2018-10-18 09:19:10 +02:00
import {assert} from "chai"
2018-10-16 14:56:18 +02:00
import ContractHandler from "../../src/keeper/ContractHandler"
import { Ocean } from "../../src/ocean/Ocean"
2018-10-16 14:56:18 +02:00
import config from "../config"
2018-10-16 14:56:18 +02:00
describe("ContractHandler", () => {
let contractHandler: ContractHandler
2018-10-16 14:56:18 +02:00
2018-10-26 10:40:46 +02:00
before(async () => {
const instanceConfig = (<any>await Ocean.getInstance(config)).instanceConfig
contractHandler = new ContractHandler(instanceConfig)
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 () => {
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")
2018-10-18 09:19:10 +02:00
.catch(() => {
done()
})
})
2018-10-16 14:56:18 +02:00
})
})