change to new new api

This commit is contained in:
Jonathan Rainville 2018-12-13 13:25:29 -05:00
parent cf8f7720d0
commit 9c657c310b
2 changed files with 15 additions and 11 deletions

View File

@ -216,10 +216,11 @@ class Console {
this.embark.registerConsoleCommand({ this.embark.registerConsoleCommand({
description: __("display console commands history"), description: __("display console commands history"),
matches: ["history"], matches: ["history"],
use: "history <optionalLength>", process: (cmd: string, callback: any) => {
}, (cmd: string, callback: any) => {
const [_cmdName, length] = cmd.split(" "); const [_cmdName, length] = cmd.split(" ");
this.getHistory(length, callback); this.getHistory(length, callback);
},
use: "history <optionalLength>",
}); });
} }

View File

@ -95,10 +95,11 @@ class ENS {
matches: (cmd) => { matches: (cmd) => {
let [cmdName] = cmd.split(' '); let [cmdName] = cmd.split(' ');
return cmdName === 'resolve'; return cmdName === 'resolve';
} },
}, (cmd, cb) => { process: (cmd, cb) => {
let [_cmdName, domain] = cmd.split(' '); let [_cmdName, domain] = cmd.split(' ');
global.EmbarkJS.Names.resolve(domain, cb); global.EmbarkJS.Names.resolve(domain, cb);
}
}); });
this.embark.registerConsoleCommand({ this.embark.registerConsoleCommand({
@ -107,10 +108,11 @@ class ENS {
matches: (cmd) => { matches: (cmd) => {
let [cmdName] = cmd.split(' '); let [cmdName] = cmd.split(' ');
return cmdName === 'lookup'; return cmdName === 'lookup';
} },
}, (cmd, cb) => { process: (cmd, cb) => {
let [_cmdName, address] = cmd.split(' '); let [_cmdName, address] = cmd.split(' ');
global.EmbarkJS.Names.lookup(address, cb); global.EmbarkJS.Names.lookup(address, cb);
}
}); });
@ -120,10 +122,11 @@ class ENS {
matches: (cmd) => { matches: (cmd) => {
let [cmdName] = cmd.split(' '); let [cmdName] = cmd.split(' ');
return cmdName === 'registerSubDomain'; return cmdName === 'registerSubDomain';
} },
}, (cmd, cb) => { process: (cmd, cb) => {
let [_cmdName, name, address] = cmd.split(' '); let [_cmdName, name, address] = cmd.split(' ');
global.EmbarkJS.Names.registerSubDomain(name, address, cb); global.EmbarkJS.Names.registerSubDomain(name, address, cb);
}
}); });
} }