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

Commit

Permalink
Deploy indra-2.3.18
Browse files Browse the repository at this point in the history
  • Loading branch information
LayneHaber committed Dec 22, 2019
2 parents 09446e0 + 599d0aa commit ce8855b
Show file tree
Hide file tree
Showing 127 changed files with 2,175 additions and 2,925 deletions.
14 changes: 5 additions & 9 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
name: CD

on:
push:
branches:
- master
- staging
on: [push]

jobs:
test-ssh:
Expand Down Expand Up @@ -75,7 +71,7 @@ jobs:
env:
DOCKER_USER: ${{ secrets.DOCKER_USER }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
if: endsWith(github.ref, 'staging')
if: endsWith(github.ref, '/staging')
needs: [test-node, test-cf, test-bot, test-daicard]
runs-on: ubuntu-latest
steps:
Expand All @@ -89,7 +85,7 @@ jobs:
env:
DOCKER_USER: ${{ secrets.DOCKER_USER }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
if: endsWith(github.ref, 'master')
if: endsWith(github.ref, '/master')
needs: [test-node, test-cf, test-bot, test-daicard]
runs-on: ubuntu-latest
steps:
Expand All @@ -107,7 +103,7 @@ jobs:
SSH_DIR: $HOME/.ssh
SSH_KEY: ${{ secrets.SSH_KEY }}
STAGING_DOMAINNAME: staging.indra.connext.network
if: endsWith(github.ref, 'staging')
if: endsWith(github.ref, '/staging')
needs: [push-latest]
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -154,7 +150,7 @@ jobs:
RINKEBY_ETH_PROVIDER: ${{ secrets.RINKEBY_ETH_PROVIDER }}
SSH_DIR: $HOME/.ssh
SSH_KEY: ${{ secrets.SSH_KEY }}
if: endsWith(github.ref, 'master')
if: endsWith(github.ref, '/master')
needs: [push-versioned]
runs-on: ubuntu-latest
steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:

jobs:
quick-test:
runs-on: self-hosted
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- run: make clean && make reset
Expand Down
8 changes: 1 addition & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ cf-adjudicator-contracts=$(cwd)/modules/cf-adjudicator-contracts
cf-apps=$(cwd)/modules/cf-apps
cf-funding-protocol-contracts=$(cwd)/modules/cf-funding-protocol-contracts
cf-core=$(cwd)/modules/cf-core
cf-types=$(cwd)/modules/cf-types
client=$(cwd)/modules/client
contracts=$(cwd)/modules/contracts
daicard=$(cwd)/modules/daicard
Expand Down Expand Up @@ -208,11 +207,6 @@ cf-funding-protocol-contracts: node-modules $(shell find $(cf-funding-protocol-c
$(docker_run) "cd modules/cf-funding-protocol-contracts && npm run build"
$(log_finish) && mv -f $(totalTime) $(flags)/$@

cf-types: node-modules $(shell find $(cf-types)/src $(cf-types)/tsconfig.json $(find_options))
$(log_start)
$(docker_run) "cd modules/cf-types && npm run build"
$(log_finish) && mv -f $(totalTime) $(flags)/$@

client: cf-core contracts types messaging $(shell find $(client)/src $(client)/tsconfig.json $(find_options))
$(log_start)
$(docker_run) "cd modules/client && npm run build"
Expand Down Expand Up @@ -279,7 +273,7 @@ indra-proxy-prod: daicard-prod dashboard-prod ws-tcp-relay $(shell find $(proxy)
docker build --file $(proxy)/indra.connext.network/prod.dockerfile --tag $(project)_proxy:latest .
$(log_finish) && mv -f $(totalTime) $(flags)/$@

types: node-modules cf-types $(shell find $(types)/src $(find_options))
types: node-modules $(shell find $(types)/src $(find_options))
$(log_start)
$(docker_run) "cd modules/types && npm run build"
$(log_finish) && mv -f $(totalTime) $(flags)/$@
Expand Down
8 changes: 7 additions & 1 deletion cypress/tests/daicard.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ describe("Daicard", () => {
my.closeIntroModal();
});

describe("WalletConnext", () => {
it(`should open a modal when activated`, () => {
my.activateWalletConnext();
});
});

describe("Deposit", () => {
it(`should accept an Eth deposit to displayed address`, () => {
my.deposit(depositEth);
Expand Down Expand Up @@ -163,7 +169,7 @@ describe("Daicard", () => {
my.depositToken(depositToken).then(tokensDeposited => {
my.getOnchainTokenBalance().then(balanceBefore => {
my.cashoutToken()
my.depositToken(`${depositToken}1`).then(tokensDeposited => {
my.depositToken(`${depositToken}.1`).then(tokensDeposited => {
my.getOnchainTokenBalance().then(balanceBefore => {
my.cashoutToken();
cy.resolve(my.getOnchainTokenBalance).should(balanceAfter => {
Expand Down
11 changes: 11 additions & 0 deletions cypress/tests/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ my.xpubRegex = /^xpub[a-zA-Z0-9]{107}/i;
my.isStarting = () => cy.contains("span", /starting/i).should("exist");
my.doneStarting = () => cy.contains("span", /starting/i).should("not.exist");

my.isWalletConnecting = () => cy.contains(/walletconnect/i).should("exist");

//Dashboard
my.goToDebug = () => cy.get(`a[href="/debug"]`).click()
my.goToDebugChannel = () => cy.get(`a[href="/dashboard/debug/channel"]`).click()
Expand All @@ -39,6 +41,15 @@ my.goBack = () => cy.contains("button", /^back$/i).click();
my.goNextIntro = () => cy.contains("button", /^next$/i).click();
my.goCloseIntro = () => cy.contains("button", /^got it!$/i).click();

my.activateWalletConnext = () => {
my.goToSettings();
cy.contains("button", /walletconnext/i).click();
my.isStarting();
my.isWalletConnecting();
// TODO: make this actually activate wallet connect
// my.doneStarting();
}

my.closeIntroModal = () => {
my.isStarting();
my.doneStarting();
Expand Down
2 changes: 1 addition & 1 deletion modules/cf-adjudicator-contracts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"solidity"
],
"devDependencies": {
"@connext/types": "1.3.14",
"@connext/types": "1.4.1",
"@connext/cf-types": "1.3.14",
"@types/node": "12.12.14",
"@types/chai": "4.2.6",
Expand Down
4 changes: 2 additions & 2 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": "1.3.14",
"version": "1.4.1",
"main": "dist/src/index.js",
"iife": "dist/src/index.iife.js",
"types": "dist/src/index.d.ts",
Expand All @@ -19,7 +19,7 @@
"dependencies": {
"@connext/cf-adjudicator-contracts": "0.4.1",
"@connext/cf-funding-protocol-contracts": "0.4.1",
"@connext/types": "1.3.14",
"@connext/types": "1.4.1",
"ethers": "4.0.40",
"eventemitter3": "4.0.0",
"loglevel": "1.6.6",
Expand Down
2 changes: 1 addition & 1 deletion modules/cf-core/src/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ const controllers = [

/**
* Converts the array of connected controllers into a map of
* Node.MethodNames to the _executeMethod_ method of a controller.
* CFCoreTypes.MethodNames to the _executeMethod_ method of a controller.
*
* Throws a runtime error when package is imported if multiple
* controllers overlap (should be caught by compiler anyway).
Expand Down
4 changes: 2 additions & 2 deletions modules/cf-core/src/ethereum/multisig-commitment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
} from "ethers/utils";

import { MinimumViableMultisig } from "../contracts";
import { Node } from "../types";
import { CFCoreTypes } from "../types";
import { sortSignaturesBySignerAddress } from "../utils";

import { EthereumCommitment, MultisigTransaction } from "./types";
Expand All @@ -23,7 +23,7 @@ export abstract class MultisigCommitment extends EthereumCommitment {

abstract getTransactionDetails(): MultisigTransaction;

public getSignedTransaction(sigs: Signature[]): Node.MinimalTransaction {
public getSignedTransaction(sigs: Signature[]): CFCoreTypes.MinimalTransaction {
const multisigInput = this.getTransactionDetails();

const signaturesList = sortSignaturesBySignerAddress(
Expand Down
4 changes: 2 additions & 2 deletions modules/cf-core/src/ethereum/set-state-commitment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { ChallengeRegistry } from "../contracts";
import {
AppIdentity,
NetworkContext,
Node,
CFCoreTypes,
SignedStateHashUpdate
} from "../types";
import { sortSignaturesBySignerAddress } from "../utils";
Expand Down Expand Up @@ -46,7 +46,7 @@ export class SetStateCommitment extends EthereumCommitment {
);
}

public getSignedTransaction(sigs: Signature[]): Node.MinimalTransaction {
public getSignedTransaction(sigs: Signature[]): CFCoreTypes.MinimalTransaction {
return {
to: this.networkContext.ChallengeRegistry,
value: 0,
Expand Down
6 changes: 3 additions & 3 deletions modules/cf-core/src/ethereum/types.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Signature } from "ethers/utils";

import { Node } from "../types";
import { CFCoreTypes } from "../types";

export abstract class EthereumCommitment {
// todo(xuanji): EthereumCommitment was designed under the assumption that
Expand All @@ -14,7 +14,7 @@ export abstract class EthereumCommitment {
public abstract getSignedTransaction(
signatures: Signature[],
intermediarySignature?: Signature,
): Node.MinimalTransaction;
): CFCoreTypes.MinimalTransaction;
}

export enum MultisigOperation {
Expand All @@ -27,6 +27,6 @@ export enum MultisigOperation {
Create = 2,
}

export type MultisigTransaction = Node.MinimalTransaction & {
export type MultisigTransaction = CFCoreTypes.MinimalTransaction & {
operation: MultisigOperation;
};
6 changes: 5 additions & 1 deletion modules/cf-core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,8 @@ export {
WithdrawFailedMessage,
WithdrawStartedMessage
} from "./types";
export { getCreate2MultisigAddress } from "./utils";
export {
getCreate2MultisigAddress,
bigNumberifyJson,
deBigNumberifyJson
} from "./utils";
23 changes: 5 additions & 18 deletions modules/cf-core/src/methods/app-instance/get-all/controller.ts
Original file line number Diff line number Diff line change
@@ -1,39 +1,26 @@
import { jsonRpcMethod } from "rpc-server";

import { RequestHandler } from "../../../request-handler";
import { Node, AppInstanceJson } from "../../../types";
import { CFCoreTypes, AppInstanceJson } from "../../../types";
import { NodeController } from "../../controller";
import { StateChannel } from "../../../models";
import { prettyPrintObject } from "../../../utils";

/**
* Gets all installed appInstances across all of the channels open on
* this Node.
*/
export default class GetAppInstancesController extends NodeController {
@jsonRpcMethod(Node.RpcMethodName.GET_APP_INSTANCES)
@jsonRpcMethod(CFCoreTypes.RpcMethodNames.chan_getAppInstances)
public executeMethod = super.executeMethod;

protected async executeMethodImplementation(
requestHandler: RequestHandler,
params: Node.GetAppInstancesParams
): Promise<Node.GetAppInstancesResult> {
params: CFCoreTypes.GetAppInstancesParams
): Promise<CFCoreTypes.GetAppInstancesResult> {
const { store } = requestHandler;
const { multisigAddress } = params;

const channels = await store.getStateChannelsMap();

const appInstances = Array.from(channels.values()).reduce(
(acc: AppInstanceJson[], channel: StateChannel) => {
acc.push(
...Array.from(channel.appInstances.values()).map(appInstance =>
appInstance.toJson()
)
);
return acc;
},
[]
);

return {
appInstances: await store.getAppInstances(multisigAddress)
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { jsonRpcMethod } from "rpc-server";

import { RequestHandler } from "../../../request-handler";
import { Node } from "../../../types";
import { CFCoreTypes } from "../../../types";
import { NodeController } from "../../controller";
import { NO_APP_INSTANCE_ID_TO_GET_DETAILS } from "../../errors";

Expand All @@ -11,11 +11,11 @@ import { NO_APP_INSTANCE_ID_TO_GET_DETAILS } from "../../errors";
* @param params
*/
export default class GetAppInstanceDetailsController extends NodeController {
@jsonRpcMethod(Node.RpcMethodName.GET_APP_INSTANCE_DETAILS)
@jsonRpcMethod(CFCoreTypes.RpcMethodNames.chan_getAppInstance)
protected async executeMethodImplementation(
requestHandler: RequestHandler,
params: Node.GetAppInstanceDetailsParams,
): Promise<Node.GetAppInstanceDetailsResult> {
params: CFCoreTypes.GetAppInstanceDetailsParams,
): Promise<CFCoreTypes.GetAppInstanceDetailsResult> {
const { store } = requestHandler;
const { appInstanceId } = params;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@ import { jsonRpcMethod } from "rpc-server";

import { CONVENTION_FOR_ETH_TOKEN_ADDRESS } from "../../../constants";
import { RequestHandler } from "../../../request-handler";
import { Node } from "../../../types";
import { CFCoreTypes } from "../../../types";
import { NodeController } from "../../controller";

export default class GetFreeBalanceController extends NodeController {
@jsonRpcMethod(Node.RpcMethodName.GET_FREE_BALANCE_STATE)
@jsonRpcMethod(CFCoreTypes.RpcMethodNames.chan_getFreeBalanceState)
public executeMethod = super.executeMethod;

protected async executeMethodImplementation(
requestHandler: RequestHandler,
params: Node.GetFreeBalanceStateParams
): Promise<Node.GetFreeBalanceStateResult> {
params: CFCoreTypes.GetFreeBalanceStateParams
): Promise<CFCoreTypes.GetFreeBalanceStateResult> {
const { store } = requestHandler;
const { multisigAddress, tokenAddress: tokenAddressParam } = params;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { jsonRpcMethod } from "rpc-server";

import { RequestHandler } from "../../../request-handler";
import { Node } from "../../../types";
import { CFCoreTypes } from "../../../types";
import { NodeController } from "../../controller";
import { NO_APP_INSTANCE_ID_FOR_GET_STATE } from "../../errors";

Expand All @@ -11,11 +11,11 @@ import { NO_APP_INSTANCE_ID_FOR_GET_STATE } from "../../errors";
* @param params
*/
export default class GetStateController extends NodeController {
@jsonRpcMethod(Node.RpcMethodName.GET_STATE)
@jsonRpcMethod(CFCoreTypes.RpcMethodNames.chan_getState)
protected async executeMethodImplementation(
requestHandler: RequestHandler,
params: Node.GetStateParams,
): Promise<Node.GetStateResult> {
params: CFCoreTypes.GetStateParams,
): Promise<CFCoreTypes.GetStateResult> {
const { store } = requestHandler;
const { appInstanceId } = params;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import { jsonRpcMethod } from "rpc-server";

import { RequestHandler } from "../../../request-handler";
import { Node } from "../../../types";
import { CFCoreTypes } from "../../../types";
import { NodeController } from "../../controller";

export default class GetTokenIndexedFreeBalancesController extends NodeController {
@jsonRpcMethod(Node.RpcMethodName.GET_TOKEN_INDEXED_FREE_BALANCE_STATES)
@jsonRpcMethod(CFCoreTypes.RpcMethodNames.chan_getTokenIndexedFreeBalanceStates)
public executeMethod = super.executeMethod;

protected async executeMethodImplementation(
requestHandler: RequestHandler,
params: Node.GetTokenIndexedFreeBalanceStatesParams,
): Promise<Node.GetTokenIndexedFreeBalanceStatesResult> {
params: CFCoreTypes.GetTokenIndexedFreeBalanceStatesParams,
): Promise<CFCoreTypes.GetTokenIndexedFreeBalanceStatesResult> {
const { store } = requestHandler;
const { multisigAddress } = params;

Expand Down
Loading

0 comments on commit ce8855b

Please sign in to comment.