From 9c657c310bd84af2b895825ff5439bef368855d6 Mon Sep 17 00:00:00 2001 From: Jonathan Rainville Date: Thu, 13 Dec 2018 13:25:29 -0500 Subject: [PATCH] change to new new api --- src/lib/modules/console/index.ts | 7 ++++--- src/lib/modules/ens/index.js | 19 +++++++++++-------- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/src/lib/modules/console/index.ts b/src/lib/modules/console/index.ts index 5deaa0c0d..7be8ac741 100644 --- a/src/lib/modules/console/index.ts +++ b/src/lib/modules/console/index.ts @@ -216,10 +216,11 @@ class Console { this.embark.registerConsoleCommand({ description: __("display console commands history"), matches: ["history"], + process: (cmd: string, callback: any) => { + const [_cmdName, length] = cmd.split(" "); + this.getHistory(length, callback); + }, use: "history ", - }, (cmd: string, callback: any) => { - const [_cmdName, length] = cmd.split(" "); - this.getHistory(length, callback); }); } diff --git a/src/lib/modules/ens/index.js b/src/lib/modules/ens/index.js index 99a394240..354039bc8 100644 --- a/src/lib/modules/ens/index.js +++ b/src/lib/modules/ens/index.js @@ -95,10 +95,11 @@ class ENS { matches: (cmd) => { let [cmdName] = cmd.split(' '); return cmdName === 'resolve'; - } - }, (cmd, cb) => { + }, + process: (cmd, cb) => { let [_cmdName, domain] = cmd.split(' '); global.EmbarkJS.Names.resolve(domain, cb); + } }); this.embark.registerConsoleCommand({ @@ -107,10 +108,11 @@ class ENS { matches: (cmd) => { let [cmdName] = cmd.split(' '); return cmdName === 'lookup'; - } - }, (cmd, cb) => { - let [_cmdName, address] = cmd.split(' '); + }, + process: (cmd, cb) => { + let [_cmdName, address] = cmd.split(' '); global.EmbarkJS.Names.lookup(address, cb); + } }); @@ -120,10 +122,11 @@ class ENS { matches: (cmd) => { let [cmdName] = cmd.split(' '); return cmdName === 'registerSubDomain'; + }, + process: (cmd, cb) => { + let [_cmdName, name, address] = cmd.split(' '); + global.EmbarkJS.Names.registerSubDomain(name, address, cb); } - }, (cmd, cb) => { - let [_cmdName, name, address] = cmd.split(' '); - global.EmbarkJS.Names.registerSubDomain(name, address, cb); }); }