Skip to content
This repository has been archived by the owner on Dec 13, 2019. It is now read-only.

Commit

Permalink
rename metachannel -> virtual app (#384)
Browse files Browse the repository at this point in the history
  • Loading branch information
ldct authored and snario committed Dec 27, 2018
1 parent 5fdbdd4 commit 0505908
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 12 deletions.
2 changes: 1 addition & 1 deletion packages/cf.js/src/legacy/node/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { ethers } from "ethers";
export enum ActionName {
SETUP = "setup",
INSTALL = "install",
INSTALL_METACHANNEL_APP = "install_metachannel_app",
INSTALL_VIRTUAL_APP = "install_virtual_app",
UPDATE = "update",
UNINSTALL = "uninstall",
DEPOSIT = "deposit",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Context } from "../instruction-executor";
import { Opcode } from "../opcodes";
import { InternalMessage } from "../types";

export const METACHANNEL_INSTALL_APP_FLOW = {
export const INSTALL_VIRTUAL_APP_FLOW = {
0: [
(message: InternalMessage, context: Context, node) => {
// copy client message
Expand Down
8 changes: 4 additions & 4 deletions packages/machine/src/instruction-executor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,22 +144,22 @@ export class InstructionExecutor {
);
}

public runInstallMetachannelAppProtocol(
public runInstallVirtualAppProtocol(
fromAddress: string,
toAddress: string,
intermediaryAddress: string,
multisigAddress: string
) {
this.execute(
new ActionExecution(
cf.legacy.node.ActionName.INSTALL_METACHANNEL_APP,
FLOWS[cf.legacy.node.ActionName.INSTALL_METACHANNEL_APP][0],
cf.legacy.node.ActionName.INSTALL_VIRTUAL_APP,
FLOWS[cf.legacy.node.ActionName.INSTALL_VIRTUAL_APP][0],
{
multisigAddress,
toAddress,
fromAddress,
seq: 0,
action: cf.legacy.node.ActionName.INSTALL_METACHANNEL_APP,
action: cf.legacy.node.ActionName.INSTALL_VIRTUAL_APP,
data: {
initiating: fromAddress,
responding: toAddress,
Expand Down
5 changes: 2 additions & 3 deletions packages/machine/src/instructions.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as cf from "@counterfactual/cf.js";

import { INSTALL_FLOW } from "./flows/install";
import { METACHANNEL_INSTALL_APP_FLOW } from "./flows/metachannel-install-app";
import { INSTALL_VIRTUAL_APP_FLOW } from "./flows/install-virtual-app";
import { SETUP_FLOW } from "./flows/setup";
import { UNINSTALL_FLOW } from "./flows/uninstall";
import { UPDATE_FLOW } from "./flows/update";
Expand All @@ -11,6 +11,5 @@ export const FLOWS = {
[cf.legacy.node.ActionName.SETUP]: SETUP_FLOW,
[cf.legacy.node.ActionName.INSTALL]: INSTALL_FLOW,
[cf.legacy.node.ActionName.UNINSTALL]: UNINSTALL_FLOW,
[cf.legacy.node.ActionName
.INSTALL_METACHANNEL_APP]: METACHANNEL_INSTALL_APP_FLOW
[cf.legacy.node.ActionName.INSTALL_VIRTUAL_APP]: INSTALL_VIRTUAL_APP_FLOW
};
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ describe("Machine State Lifecycle", async () => {
await Depositor.makeDeposits(peerA, peerI);
await SetupProtocol.run(peerI, peerB);
await Depositor.makeDeposits(peerI, peerB);
await peerA.runInstallMetachannelAppProtocol(
await peerA.runInstallVirtualAppProtocol(
A_ADDRESS, B_ADDRESS, I_ADDRESS, UNUSED_FUNDED_ACCOUNT
);
});
Expand Down
4 changes: 2 additions & 2 deletions packages/machine/test/integration/test-response-sink.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ export class TestResponseSink implements cf.legacy.node.ResponseSink {
return promise;
}

public async runInstallMetachannelAppProtocol(
public async runInstallVirtualAppProtocol(
fromAddress: string,
toAddress: string,
intermediary: string,
Expand All @@ -146,7 +146,7 @@ export class TestResponseSink implements cf.legacy.node.ResponseSink {
const promise = new Promise<cf.legacy.node.Response>((resolve, reject) => {
this.runProtocolContinuation = resolve;
});
this.instructionExecutor.runInstallMetachannelAppProtocol(
this.instructionExecutor.runInstallVirtualAppProtocol(
fromAddress, toAddress, intermediary, multisigAddress);
return promise;
}
Expand Down

0 comments on commit 0505908

Please sign in to comment.