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.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Rahul Sethuram committed Aug 15, 2020
2 parents 009c6b6 + bad4564 commit 6ce60df
Show file tree
Hide file tree
Showing 88 changed files with 1,458 additions and 1,860 deletions.
2 changes: 1 addition & 1 deletion .aliases
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ alias ....="cd ../../.. "
alias ...="cd ../.. "
alias ..="cd .. "
alias dls="docker service ls && echo '=====' && docker container ls -a"
alias gba="git branch -a --sort=-committerdate --format='%(HEAD) %(color:red)%(objectname:short)%(color:reset) %(color:yellow)%(refname:short)%(color:reset) %(color:green)(%(committerdate:relative))%(color:reset) by%(color:blue bold) %(authorname)%(color:reset) - %(contents:subject)'"
alias gba="git branch -l --sort=-committerdate --format='%(HEAD) %(color:red)%(objectname:short)%(color:reset) %(color:yellow)%(refname:short)%(color:reset) %(color:green)(%(committerdate:relative))%(color:reset) by%(color:blue bold) %(authorname)%(color:reset) - %(contents:subject)' && echo ' =====' && git branch -r --sort=-committerdate --format='%(HEAD) %(color:red)%(objectname:short)%(color:reset) %(color:yellow)%(refname:short)%(color:reset) %(color:green)(%(committerdate:relative))%(color:reset) by%(color:blue bold) %(authorname)%(color:reset) - %(contents:subject)' "
alias gfa="git fetch --all --prune --tags"
alias gitl="git log --graph --decorate --pretty=format:'%Cred%h%Creset %Cgreen(%cr) %C(bold blue)<%an>%Creset%C(yellow)%d%Creset %s %Creset' --abbrev-commit -20"
alias gitla="git log --graph --decorate --pretty=format:'%Cred%h%Creset %Cgreen(%cD) %C(bold blue)<%an>%Creset%C(yellow)%d%Creset %s %Creset' --abbrev-commit --branches --remotes --tags "
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -286,12 +286,12 @@ daicard-bundle: types utils store client $(shell find modules/daicard $(find_opt

bot-bundle: types utils channel-provider messaging store contracts cf-core apps client $(shell find modules/bot $(find_options))
$(log_start)
$(docker_run) "cd modules/bot && npm run build && npm run build-bundle"
$(docker_run) "cd modules/bot && npm run build"
$(log_finish) && mv -f $(totalTime) .flags/$@

node-bundle: types utils messaging store contracts cf-core apps client $(shell find modules/node $(find_options))
$(log_start)
$(docker_run) "cd modules/node && npm run build && npm run build-bundle && touch src/main.ts"
$(docker_run) "cd modules/node && npm run build && touch src/main.ts"
$(log_finish) && mv -f $(totalTime) .flags/$@

test-runner-bundle: types utils channel-provider messaging store contracts cf-core apps client $(shell find modules/test-runner $(find_options))
Expand Down
10 changes: 5 additions & 5 deletions modules/apps/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@connext/apps",
"version": "7.1.1",
"version": "7.3.0",
"description": "Connext Counterfactual Apps",
"main": "dist/index.js",
"module": "dist/index.esm.js",
Expand All @@ -18,11 +18,11 @@
"clean": "rm -rf ./dist"
},
"devDependencies": {
"@connext/contracts": "3.4.1",
"@connext/types": "7.1.1",
"@connext/utils": "7.1.1",
"@connext/contracts": "3.4.5",
"@connext/types": "7.3.0",
"@connext/utils": "7.3.0",
"@rollup/plugin-json": "4.1.0",
"ethers": "5.0.7",
"ethers": "5.0.8",
"rollup": "2.23.0",
"rollup-plugin-typescript2": "0.27.1",
"typescript": "3.9.7"
Expand Down
8 changes: 7 additions & 1 deletion modules/apps/src/SimpleLinkedTransferApp/registry.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import {
OnlineLinkedTransferAppName,
OutcomeType,
SimpleLinkedTransferAppName,
SimpleLinkedTransferAppActionEncoding,
SimpleLinkedTransferAppName,
SimpleLinkedTransferAppStateEncoding,
} from "@connext/types";
import { constants } from "ethers";
Expand All @@ -18,5 +19,10 @@ export const SimpleLinkedTransferAppRegistryInfo: AppRegistryInfo = {
stateEncoding: SimpleLinkedTransferAppStateEncoding,
};

export const OnlineLinkedTransferAppRegistryInfo: AppRegistryInfo = {
...SimpleLinkedTransferAppRegistryInfo,
name: OnlineLinkedTransferAppName,
};

// timeout default values
export const LINKED_TRANSFER_STATE_TIMEOUT = Zero;
3 changes: 2 additions & 1 deletion modules/apps/src/registry.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { AppRegistryType } from "./shared";
import { DepositAppRegistryInfo } from "./DepositApp";
import { HashLockTransferAppRegistryInfo } from "./HashLockTransferApp";
import { SimpleLinkedTransferAppRegistryInfo } from "./SimpleLinkedTransferApp";
import { OnlineLinkedTransferAppRegistryInfo, SimpleLinkedTransferAppRegistryInfo } from "./SimpleLinkedTransferApp";
import { SimpleSignedTransferAppRegistryInfo } from "./SimpleSignedTransferApp";
import { GraphBatchSignedTransferAppRegistryInfo } from "./GraphBatchedTransferApp";
import { SimpleTwoPartySwapAppRegistryInfo } from "./SimpleTwoPartySwapApp";
Expand All @@ -10,6 +10,7 @@ import { GraphSignedTransferAppRegistryInfo } from "./GraphSignedTransferApp";

export const AppRegistry: AppRegistryType = [
SimpleLinkedTransferAppRegistryInfo,
OnlineLinkedTransferAppRegistryInfo,
SimpleSignedTransferAppRegistryInfo,
GraphSignedTransferAppRegistryInfo,
GraphBatchSignedTransferAppRegistryInfo,
Expand Down
2 changes: 1 addition & 1 deletion modules/bot/ops/entry.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ if [[ -d "modules/bot" ]]
then cd modules/bot
fi

node dist/bundle.js $@
node dist/cli.js $@
2 changes: 1 addition & 1 deletion modules/bot/ops/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ module.exports = {

output: {
path: path.join(__dirname, "../dist"),
filename: `bundle.js`,
filename: `cli.js`,
},

module: {
Expand Down
15 changes: 7 additions & 8 deletions modules/bot/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,21 @@
"description": "",
"main": "dist/src/index.js",
"scripts": {
"build": "rm -rf dist && tsc --project tsconfig.json",
"build-bundle": "webpack --config ops/webpack.config.js",
"build": "rm -rf dist && webpack --config ops/webpack.config.js",
"start": "node --inspect=0.0.0.0:9229 dist/src/index.js",
"start:registry": "node dist/src/registry.js"
},
"author": "",
"license": "ISC",
"dependencies": {
"@connext/client": "7.1.1",
"@connext/contracts": "3.4.1",
"@connext/store": "7.1.1",
"@connext/types": "7.1.1",
"@connext/utils": "7.1.1",
"@connext/client": "7.3.0",
"@connext/contracts": "3.4.5",
"@connext/store": "7.3.0",
"@connext/types": "7.3.0",
"@connext/utils": "7.3.0",
"axios": "0.19.2",
"body-parser": "1.19.0",
"ethers": "5.0.7",
"ethers": "5.0.8",
"express": "4.17.1",
"interval-promise": "1.4.0",
"yargs": "15.4.1"
Expand Down
1 change: 0 additions & 1 deletion modules/bot/src/agents/bot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,6 @@ export const startBot = async (
const numberPayments = Object.keys(elapsed).length;
if (numberPayments < limit) {
log.error(`Only able to run ${numberPayments}/${limit} requested payments before exiting.`);
exitCode += 1;
}
log.info(`Payment times: ${stringify(elapsed)}`);
const average = Object.values(elapsed).reduce((prev, curr) => prev + curr, 0) / numberPayments;
Expand Down
23 changes: 14 additions & 9 deletions modules/bot/src/e2e.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
import { abrv, ChannelSigner, ColorfulLogger, getRandomPrivateKey } from "@connext/utils";
import { constants, providers, utils, Wallet, Contract, BigNumber } from "ethers";
import {
abrv,
ChannelSigner,
ColorfulLogger,
getEthProvider,
getGasPrice,
getRandomPrivateKey,
} from "@connext/utils";
import { constants, utils, Wallet, Contract, BigNumber } from "ethers";
import { Argv } from "yargs";

import { env } from "./env";
Expand Down Expand Up @@ -40,10 +47,7 @@ export const command = {
});
},
handler: async (argv: { [key: string]: any } & Argv["argv"]) => {
const ethProvider = new providers.JsonRpcProvider(
env.ethProviderUrl,
argv.chainId === 61 ? "classic" : argv.chainId,
);
const ethProvider = getEthProvider(env.ethProviderUrl, argv.chainId);
const sugarDaddy = Wallet.fromMnemonic(argv.funderMnemonic).connect(ethProvider);
const assetId = getAddress(argv.tokenAddress);
const startEthBalance = await sugarDaddy.getBalance();
Expand All @@ -53,9 +57,10 @@ export const command = {
: new Contract(assetId, Token.abi, sugarDaddy).balanceOf(addr);
};
const sendChainBalance = (addr: string, amount: BigNumber) => {
const gasPrice = getGasPrice(ethProvider, argv.chainId);
return assetId === AddressZero
? sugarDaddy.sendTransaction({ to: addr, value: amount })
: new Contract(assetId, Token.abi, sugarDaddy).transfer(addr, amount);
? sugarDaddy.sendTransaction({ to: addr, value: amount, gasPrice })
: new Contract(assetId, Token.abi, sugarDaddy).transfer(addr, amount, { gasPrice });
};
const startingAssetBalance = await getChainBalance(sugarDaddy.address);

Expand All @@ -64,7 +69,7 @@ export const command = {
const DEPOSIT_AMT = parseEther("0.001"); // Note: max amount in signer address is 1 eth

if (startEthBalance.lt(TRANSFER_AMT)) {
throw new Error(`Account ${sugarDaddy.address} does not have sufficient eth for gas`);
console.log(`Warning: account ${sugarDaddy.address} might not have sufficient eth for gas`);
}

// Abort if sugarDaddy doesn't have enough gas + asset to fund all the bots
Expand Down
16 changes: 8 additions & 8 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.1.1",
"version": "7.3.0",
"main": "dist/index.js",
"iife": "dist/index.iife.js",
"types": "dist/index.d.ts",
Expand All @@ -18,21 +18,21 @@
"watch": "ts-mocha --bail --check-leaks --global wallet,networks --exit --timeout 60000 --require src/testing/global-hooks.ts 'src/**/**/*.spec.ts'"
},
"dependencies": {
"@connext/contracts": "3.4.1",
"@connext/contracts": "3.4.5",
"@connext/pure-evm-wasm": "0.1.4",
"@connext/types": "7.1.1",
"@connext/utils": "7.1.1",
"@connext/types": "7.3.0",
"@connext/utils": "7.3.0",
"@openzeppelin/contracts": "3.0.2",
"async-mutex": "0.2.4",
"ethers": "5.0.7",
"ethers": "5.0.8",
"eventemitter3": "4.0.4",
"memoizee": "0.4.14",
"p-queue": "6.6.0",
"uuid": "8.3.0"
},
"devDependencies": {
"@babel/core": "7.11.0",
"@connext/store": "7.1.1",
"@babel/core": "7.11.1",
"@connext/store": "7.3.0",
"@ethereum-waffle/chai": "3.0.2",
"@types/chai": "4.2.12",
"@types/chai-as-promised": "7.1.3",
Expand All @@ -43,7 +43,7 @@
"chai": "4.2.0",
"chai-as-promised": "7.1.1",
"chai-subset": "1.6.0",
"mocha": "8.1.0",
"mocha": "8.1.1",
"ts-mocha": "7.0.0",
"typescript": "3.9.7"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
MinimalTransaction,
TransactionReceipt,
} from "@connext/types";
import { delay, getSignerAddressFromPublicIdentifier, stringify } from "@connext/utils";
import { delay, getGasPrice, getSignerAddressFromPublicIdentifier, stringify } from "@connext/utils";
import { Contract, Signer, utils, constants, providers } from "ethers";

import {
Expand Down Expand Up @@ -164,7 +164,7 @@ export class DeployStateDepositController extends MethodController {
const tx: providers.TransactionResponse = await signer.sendTransaction({
...minTx,
gasLimit: CREATE_PROXY_AND_SETUP_GAS,
gasPrice: provider.getGasPrice(),
gasPrice: getGasPrice(provider),
nonce,
});
memoryNonce = nonce + 1;
Expand Down
Loading

0 comments on commit 6ce60df

Please sign in to comment.