mirror of
https://github.com/embarklabs/embark.git
synced 2025-02-20 09:28:37 +00:00
fix ens setProvider
This commit is contained in:
parent
76277ace2b
commit
a4cb8615ce
@ -76,17 +76,15 @@ class ENS {
|
||||
this.initated = false;
|
||||
|
||||
this.events.request("namesystem:node:register", "ens", (readyCb) => {
|
||||
this.events.setCommandHandler("ens:resolve", this.ensResolve.bind(this));
|
||||
this.events.setCommandHandler("ens:isENSName", (name, cb) => {
|
||||
setImmediate(cb, this.isENSName(name));
|
||||
});
|
||||
|
||||
this.embark.events.setCommandHandler("module:namesystem:reset", (cb) => {
|
||||
this.reset();
|
||||
this.init(cb);
|
||||
});
|
||||
this.init(readyCb);
|
||||
readyCb();
|
||||
});
|
||||
|
||||
this.events.setCommandHandler("ens:resolve", this.ensResolve.bind(this));
|
||||
this.events.setCommandHandler("ens:isENSName", (name, cb) => {
|
||||
setImmediate(cb, this.isENSName(name));
|
||||
});
|
||||
|
||||
this.init(() => {});
|
||||
}
|
||||
|
||||
get web3() {
|
||||
@ -120,12 +118,12 @@ class ENS {
|
||||
this.enabled = true;
|
||||
this.doSetENSProvider = this.config.namesystemConfig.provider === 'ens';
|
||||
|
||||
this.registerEmbarkJSNaming();
|
||||
this.registerEvents();
|
||||
this.registerConsoleCommands();
|
||||
this.events.request2("runcode:whitelist", 'eth-ens-namehash');
|
||||
this.events.request2("runcode:whitelist", 'embarkjs');
|
||||
this.events.request2("runcode:whitelist", 'embarkjs-ens');
|
||||
await this.registerEmbarkJSNaming();
|
||||
this.initated = true;
|
||||
cb();
|
||||
}
|
||||
@ -456,7 +454,7 @@ class ENS {
|
||||
}
|
||||
|
||||
async connectEmbarkJSProvider(config) {
|
||||
let providerCode = `\nEmbarkJS.Names.setProviders(${JSON.stringify(config)});`;
|
||||
let providerCode = `\nEmbarkJS.Names.setProvider('ens', ${JSON.stringify(config)});`;
|
||||
await this.events.request2('runcode:eval', providerCode);
|
||||
}
|
||||
|
||||
|
@ -187,6 +187,7 @@ class Swarm {
|
||||
}
|
||||
|
||||
async connectEmbarkJSProvider() {
|
||||
// TODO: should initialize its own object web3 instead of relying on a global one
|
||||
let providerCode = `\nEmbarkJS.Storage.setProviders(${JSON.stringify(this.embark.config.storageConfig.dappConnection || [])}, {web3});`;
|
||||
await this.events.request2('runcode:eval', providerCode);
|
||||
}
|
||||
|
@ -24,10 +24,8 @@ class Blockchain {
|
||||
// const clientName = this.blockchainConfig.client;
|
||||
const client = this.blockchainNodes[clientName];
|
||||
if (!client) return cb("client " + clientName + " not found");
|
||||
console.log('starting', clientName, 'blockchain client');
|
||||
|
||||
let onStart = () => {
|
||||
console.log("blockchain onStart being called");
|
||||
this.events.emit("blockchain:started", clientName);
|
||||
cb();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user