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

Commit

Permalink
Deploy indra-7.3.6
Browse files Browse the repository at this point in the history
  • Loading branch information
LayneHaber committed Aug 21, 2020
2 parents 705fb8a + fe991de commit 9ec72ae
Show file tree
Hide file tree
Showing 24 changed files with 293 additions and 137 deletions.
6 changes: 3 additions & 3 deletions modules/apps/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@connext/apps",
"version": "7.3.5",
"version": "7.3.6",
"description": "Connext Counterfactual Apps",
"main": "dist/index.js",
"module": "dist/index.esm.js",
Expand All @@ -19,8 +19,8 @@
},
"devDependencies": {
"@connext/contracts": "3.5.0",
"@connext/types": "7.3.5",
"@connext/utils": "7.3.5",
"@connext/types": "7.3.6",
"@connext/utils": "7.3.6",
"@rollup/plugin-json": "4.1.0",
"ethers": "5.0.8",
"rollup": "2.23.0",
Expand Down
8 changes: 4 additions & 4 deletions modules/bot/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
"author": "",
"license": "ISC",
"dependencies": {
"@connext/client": "7.3.5",
"@connext/client": "7.3.6",
"@connext/contracts": "3.5.0",
"@connext/store": "7.3.5",
"@connext/types": "7.3.5",
"@connext/utils": "7.3.5",
"@connext/store": "7.3.6",
"@connext/types": "7.3.6",
"@connext/utils": "7.3.6",
"axios": "0.19.2",
"body-parser": "1.19.0",
"ethers": "5.0.8",
Expand Down
8 changes: 4 additions & 4 deletions modules/cf-core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@connext/cf-core",
"version": "7.3.5",
"version": "7.3.6",
"main": "dist/index.js",
"iife": "dist/index.iife.js",
"types": "dist/index.d.ts",
Expand All @@ -20,8 +20,8 @@
"dependencies": {
"@connext/contracts": "3.5.0",
"@connext/pure-evm-wasm": "0.1.4",
"@connext/types": "7.3.5",
"@connext/utils": "7.3.5",
"@connext/types": "7.3.6",
"@connext/utils": "7.3.6",
"@openzeppelin/contracts": "3.0.2",
"async-mutex": "0.2.4",
"ethers": "5.0.8",
Expand All @@ -32,7 +32,7 @@
},
"devDependencies": {
"@babel/core": "7.11.1",
"@connext/store": "7.3.5",
"@connext/store": "7.3.6",
"@ethereum-waffle/chai": "3.0.2",
"@types/chai": "4.2.12",
"@types/chai-as-promised": "7.1.3",
Expand Down
4 changes: 2 additions & 2 deletions modules/channel-provider/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@connext/channel-provider",
"version": "7.3.5",
"version": "7.3.6",
"description": "Channel Provider module for Connext client",
"main": "dist/index.js",
"files": [
Expand All @@ -16,7 +16,7 @@
"test": "./node_modules/.bin/ts-mocha --watch"
},
"dependencies": {
"@connext/types": "7.3.5",
"@connext/types": "7.3.6",
"eventemitter3": "4.0.4"
},
"devDependencies": {
Expand Down
16 changes: 8 additions & 8 deletions modules/client/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@connext/client",
"version": "7.3.5",
"version": "7.3.6",
"description": "Client for Connext Network",
"main": "dist/index.js",
"files": [
Expand All @@ -16,14 +16,14 @@
},
"dependencies": {
"axios": "0.19.2",
"@connext/apps": "7.3.5",
"@connext/cf-core": "7.3.5",
"@connext/channel-provider": "7.3.5",
"@connext/utils": "7.3.5",
"@connext/apps": "7.3.6",
"@connext/cf-core": "7.3.6",
"@connext/channel-provider": "7.3.6",
"@connext/utils": "7.3.6",
"@connext/contracts": "3.5.0",
"@connext/messaging": "7.3.5",
"@connext/store": "7.3.5",
"@connext/types": "7.3.5",
"@connext/messaging": "7.3.6",
"@connext/store": "7.3.6",
"@connext/types": "7.3.6",
"core-js": "3.6.5",
"ethers": "5.0.8",
"evt": "1.8.4",
Expand Down
6 changes: 3 additions & 3 deletions modules/client/src/controllers/DepositController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,12 @@ export class DepositController extends AbstractController {
this.throwIfAny(notLessThanOrEqualTo(amount, startingBalance), notGreaterThan(amount, Zero));
const { appIdentityHash } = await this.requestDepositRights({ assetId });

this.log.info(`Sending deposit transaction to chain`);
const txHash = await this.connext.channelProvider.walletDeposit({
amount: amount.toString(),
assetId,
});
this.log.info(`Sent deposit transaction to chain: ${txHash}`);
const transaction = await this.ethProvider.getTransaction(txHash);
const completed: Promise<PublicResults.RescindDepositRights> = new Promise(
async (resolve, reject) => {
Expand All @@ -60,7 +62,6 @@ export class DepositController extends AbstractController {
appIdentityHash,
hash: txHash,
});
this.log.info(`Sent deposit transaction to chain: ${txHash}`);
await transaction.wait();
const res = await this.rescindDepositRights({ appIdentityHash, assetId });
this.connext.emit(EventNames.DEPOSIT_CONFIRMED_EVENT, {
Expand Down Expand Up @@ -160,7 +161,7 @@ export class DepositController extends AbstractController {
// get the app instance
const app = await this.getDepositApp({ assetId });
if (!app) {
this.log.debug(`No deposit app found for assset: ${assetId}`);
this.log.info(`No deposit app found for assset: ${assetId}`);
const freeBalance = await this.connext.getFreeBalance(assetId);
this.log.info(`Successfully rescinded deposit rights for ${assetId}`);
return { freeBalance };
Expand Down Expand Up @@ -200,7 +201,6 @@ export class DepositController extends AbstractController {
////// PRIVATE METHODS

private proposeDepositInstall = async (assetId: string): Promise<string> => {

// generate initial totalAmountWithdrawn
const multisig = new Contract(
this.connext.multisigAddress,
Expand Down
4 changes: 2 additions & 2 deletions modules/contracts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
"transpile": "tsc -p tsconfig.json"
},
"dependencies": {
"@connext/types": "7.3.5",
"@connext/utils": "7.3.5",
"@connext/types": "7.3.6",
"@connext/utils": "7.3.6",
"@nomiclabs/buidler": "1.4.3",
"@openzeppelin/contracts": "3.0.2",
"ethers": "5.0.8",
Expand Down
8 changes: 4 additions & 4 deletions modules/daicard/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
"format": "prettier --write 'src/**/*.js'"
},
"dependencies": {
"@connext/client": "7.3.5",
"@connext/client": "7.3.6",
"@connext/contracts": "3.5.0",
"@connext/utils": "7.3.5",
"@connext/store": "7.3.5",
"@connext/types": "7.3.5",
"@connext/utils": "7.3.6",
"@connext/store": "7.3.6",
"@connext/types": "7.3.6",
"@material-ui/core": "4.11.0",
"@material-ui/icons": "4.9.1",
"@walletconnect/browser": "1.0.0",
Expand Down
6 changes: 3 additions & 3 deletions modules/dashboard/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
"eject": "./node_modules/.bin/react-scripts eject"
},
"dependencies": {
"@connext/cf-core": "7.3.5",
"@connext/messaging": "7.3.5",
"@connext/types": "7.3.5",
"@connext/cf-core": "7.3.6",
"@connext/messaging": "7.3.6",
"@connext/types": "7.3.6",
"@material-ui/core": "4.11.0",
"@material-ui/icons": "4.9.1",
"react": "16.13.1",
Expand Down
6 changes: 3 additions & 3 deletions modules/messaging/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@connext/messaging",
"description": "Messaging module for Connext client",
"version": "7.3.5",
"version": "7.3.6",
"main": "dist/index.js",
"iife": "dist/index.iife.js",
"types": "dist/index.d.ts",
Expand All @@ -16,8 +16,8 @@
"lint": "../../node_modules/.bin/eslint -c '../../.eslintrc.js' --fix 'src/**/*'"
},
"dependencies": {
"@connext/types": "7.3.5",
"@connext/utils": "7.3.5",
"@connext/types": "7.3.6",
"@connext/utils": "7.3.6",
"ts-natsutil": "1.1.1"
},
"devDependencies": {
Expand Down
16 changes: 8 additions & 8 deletions modules/node/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "indra-node",
"version": "7.3.5",
"version": "7.3.6",
"description": "",
"author": "",
"license": "MIT",
Expand All @@ -15,14 +15,14 @@
"watch": "ts-mocha --bail --check-leaks --watch --timeout 60000 'src/**/*.spec.ts'"
},
"dependencies": {
"@connext/apps": "7.3.5",
"@connext/cf-core": "7.3.5",
"@connext/apps": "7.3.6",
"@connext/cf-core": "7.3.6",
"@connext/contracts": "3.5.0",
"@connext/messaging": "7.3.5",
"@connext/messaging": "7.3.6",
"@connext/pure-evm-wasm": "0.1.4",
"@connext/store": "7.3.5",
"@connext/types": "7.3.5",
"@connext/utils": "7.3.5",
"@connext/store": "7.3.6",
"@connext/types": "7.3.6",
"@connext/utils": "7.3.6",
"@nestjs/common": "7.4.2",
"@nestjs/core": "7.4.2",
"@nestjs/microservices": "7.4.2",
Expand All @@ -49,7 +49,7 @@
"wasm-loader": "1.3.0"
},
"devDependencies": {
"@connext/client": "7.3.5",
"@connext/client": "7.3.6",
"@ethereum-waffle/chai": "3.0.2",
"@nestjs/testing": "7.4.2",
"@openzeppelin/contracts": "3.0.2",
Expand Down
24 changes: 17 additions & 7 deletions modules/node/src/channel/channel.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ import {
DepositAppState,
FreeBalanceResponse,
} from "@connext/types";
import { getSignerAddressFromPublicIdentifier, stringify } from "@connext/utils";
import {
getSignerAddressFromPublicIdentifier,
stringify,
calculateExchangeWad,
} from "@connext/utils";
import { Injectable, HttpService } from "@nestjs/common";
import { AxiosResponse } from "axios";
import { BigNumber, constants, utils, providers } from "ethers";
Expand All @@ -25,7 +29,7 @@ import { Channel } from "./channel.entity";
import { ChannelRepository } from "./channel.repository";

const { AddressZero } = constants;
const { getAddress, toUtf8Bytes, sha256, formatUnits } = utils;
const { getAddress, toUtf8Bytes, sha256 } = utils;

export enum RebalanceType {
COLLATERALIZE = "COLLATERALIZE",
Expand Down Expand Up @@ -268,12 +272,18 @@ export class ChannelService {
const decimals = await this.configService.getTokenDecimals(chainId, assetId);
if (decimals !== DEFAULT_DECIMALS) {
this.log.info(`Token has ${decimals} decimals, converting rebalance targets`);
targets.collateralizeThreshold = BigNumber.from(
formatUnits(targets.collateralizeThreshold, decimals).split(".")[0],
targets.collateralizeThreshold = calculateExchangeWad(
targets.collateralizeThreshold,
DEFAULT_DECIMALS,
"1",
decimals,
);
targets.target = BigNumber.from(formatUnits(targets.target, decimals).split(".")[0]);
targets.reclaimThreshold = BigNumber.from(
formatUnits(targets.reclaimThreshold, decimals).split(".")[0],
targets.target = calculateExchangeWad(targets.target, DEFAULT_DECIMALS, "1", decimals);
targets.reclaimThreshold = calculateExchangeWad(
targets.reclaimThreshold,
DEFAULT_DECIMALS,
"1",
decimals,
);
this.log.warn(`Converted rebalance targets: ${stringify(targets)}`);
}
Expand Down
Loading

0 comments on commit 9ec72ae

Please sign in to comment.