Skip to content

Commit 91b2912

Browse files
committed
update tests
1 parent aaab6d7 commit 91b2912

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

src/helpers.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { ethers, hexlify, Signer } from "ethers";
22
import fetch from "cross-fetch";
3-
import { promises as fs } from "fs";
3+
import { promises as fs, readFileSync } from "fs";
44
import * as path from "path";
55
import * as sapphire from '@oasisprotocol/sapphire-paratime';
66
import { Asset, DDO } from '@oceanprotocol/ddo-js';
@@ -26,7 +26,7 @@ import {
2626
} from "@oceanprotocol/lib";
2727
import { homedir } from "os";
2828

29-
import ERC20Template from '@oceanprotocol/contracts/artifacts/contracts/templates/ERC20Template.sol/ERC20Template.json';
29+
const ERC20Template = readFileSync('./node_modules/@oceanprotocol/contracts/artifacts/contracts/templates/ERC20Template.sol/ERC20Template.json', 'utf8') as any;
3030

3131
export async function downloadFile(
3232
url: string,

test/escrow.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { expect } from "chai";
22
import { homedir } from 'os';
33
import { runCommand } from "./util.js";
44
import { getConfigByChainId } from "../src/helpers.js";
5-
import { ethers } from "ethers";
5+
import { JsonRpcProvider, ethers, formatEther, getAddress } from "ethers";
66
import { EscrowContract } from "@oceanprotocol/lib";
77

88
describe("Ocean CLI Escrow", function () {
@@ -25,7 +25,7 @@ describe("Ocean CLI Escrow", function () {
2525
tokenAddress = chainConfig.Ocean;
2626
escrowAddress = chainConfig.Escrow;
2727

28-
const provider = new ethers.providers.JsonRpcProvider(process.env.RPC);
28+
const provider = new JsonRpcProvider(process.env.RPC);
2929
payer = new ethers.Wallet(process.env.PRIVATE_KEY, provider);
3030
payee = new ethers.Wallet('0xef4b441145c1d0f3b4bc6d61d29f5c6e502359481152f869247c7a4244d45209', provider);
3131

@@ -82,7 +82,7 @@ describe("Ocean CLI Escrow", function () {
8282
);
8383

8484
const escrow = new EscrowContract(
85-
ethers.utils.getAddress(escrowAddress),
85+
getAddress(escrowAddress),
8686
payer,
8787
chainConfig.chainId
8888
);
@@ -94,7 +94,7 @@ describe("Ocean CLI Escrow", function () {
9494
);
9595

9696
const maxLockedAmountFromEscrowBN = authorizations[0].maxLockedAmount;
97-
const maxLockedAmountFromEscrow = ethers.utils.formatEther(maxLockedAmountFromEscrowBN);
97+
const maxLockedAmountFromEscrow = formatEther(maxLockedAmountFromEscrowBN);
9898

9999
expect(Number(maxLockedAmountFromEscrow)).to.equal(Number(maxLockedAmount));
100100

0 commit comments

Comments
 (0)