diff --git a/packages/cf.js/src/legacy/node/index.ts b/packages/cf.js/src/legacy/node/index.ts index 580456f89..fb8a0eb9a 100644 --- a/packages/cf.js/src/legacy/node/index.ts +++ b/packages/cf.js/src/legacy/node/index.ts @@ -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", diff --git a/packages/machine/src/flows/metachannel-install-app.ts b/packages/machine/src/flows/install-virtual-app.ts similarity index 97% rename from packages/machine/src/flows/metachannel-install-app.ts rename to packages/machine/src/flows/install-virtual-app.ts index 841311327..8a296ac39 100644 --- a/packages/machine/src/flows/metachannel-install-app.ts +++ b/packages/machine/src/flows/install-virtual-app.ts @@ -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 diff --git a/packages/machine/src/instruction-executor.ts b/packages/machine/src/instruction-executor.ts index f4181975b..4c12768be 100644 --- a/packages/machine/src/instruction-executor.ts +++ b/packages/machine/src/instruction-executor.ts @@ -144,7 +144,7 @@ export class InstructionExecutor { ); } - public runInstallMetachannelAppProtocol( + public runInstallVirtualAppProtocol( fromAddress: string, toAddress: string, intermediaryAddress: string, @@ -152,14 +152,14 @@ export class InstructionExecutor { ) { 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, diff --git a/packages/machine/src/instructions.ts b/packages/machine/src/instructions.ts index b35f0fc87..9a160beca 100644 --- a/packages/machine/src/instructions.ts +++ b/packages/machine/src/instructions.ts @@ -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"; @@ -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 }; diff --git a/packages/machine/test/integration/lifecycle/three-player-lifecycle.spec.ts b/packages/machine/test/integration/lifecycle/three-player-lifecycle.spec.ts index 118aaa86a..688e753d5 100644 --- a/packages/machine/test/integration/lifecycle/three-player-lifecycle.spec.ts +++ b/packages/machine/test/integration/lifecycle/three-player-lifecycle.spec.ts @@ -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 ); }); diff --git a/packages/machine/test/integration/test-response-sink.ts b/packages/machine/test/integration/test-response-sink.ts index 029843023..876503759 100644 --- a/packages/machine/test/integration/test-response-sink.ts +++ b/packages/machine/test/integration/test-response-sink.ts @@ -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, @@ -146,7 +146,7 @@ export class TestResponseSink implements cf.legacy.node.ResponseSink { const promise = new Promise((resolve, reject) => { this.runProtocolContinuation = resolve; }); - this.instructionExecutor.runInstallMetachannelAppProtocol( + this.instructionExecutor.runInstallVirtualAppProtocol( fromAddress, toAddress, intermediary, multisigAddress); return promise; }