Skip to content
This repository has been archived by the owner on May 28, 2021. It is now read-only.

Commit

Permalink
Collateral target integration test
Browse files Browse the repository at this point in the history
  • Loading branch information
Rahul Sethuram committed Sep 19, 2020
1 parent 65f11a3 commit 7ed99be
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions modules/test-runner/src/collateral/request.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,19 @@ describe(name, () => {
expect(freeBalance[nodeSignerAddress]).to.be.least(requestedTarget);
});

it("should collateralize tokens with a target lower than profile", async () => {
const requestedTarget = utils.parseEther("10"); // requested < 20
const response = (await client.requestCollateral(tokenAddress, requestedTarget))!;
expect(response).to.be.ok;
expect(response.completed).to.be.ok;
expect(response.transaction).to.be.ok;
expect(response.transaction.hash).to.be.ok;
expect(response.depositAppIdentityHash).to.be.ok;
const { freeBalance } = await response.completed();
expect(freeBalance[client.signerAddress]).to.be.eq(Zero);
expect(freeBalance[nodeSignerAddress]).to.be.eq(requestedTarget);
});

it("should properly handle concurrent collateral requests", async () => {
const appDef = client.config.contractAddresses[client.chainId].DepositApp;
let depositAppCount = 0;
Expand Down

0 comments on commit 7ed99be

Please sign in to comment.