mirror of
https://github.com/embarklabs/embark.git
synced 2025-02-02 17:03:36 +00:00
fix(@cockpit/ens): ensure default account is set when registering subdomains
Prior to this commit, registering ENS subdomains would fail due to `defaultAccount` being null. This is because the underlying API was still relying on `blockchain:defaultAccount:get`. However since the bigger refactor, every plugin/module is in charge of creating its own blockchain connector instance and ensuring it has a default account. This commit makes use of ENS' module's `webDefaultAccount` async getter to ensure a valid default account is set when registering an ENS subdomain.
This commit is contained in:
parent
e72aeba892
commit
9839e92584
@ -469,10 +469,9 @@ class ENS {
|
|||||||
ENSFunctions.lookupAddress(address, this.ensContract, namehash, this.createResolverContract.bind(this), cb);
|
ENSFunctions.lookupAddress(address, this.ensContract, namehash, this.createResolverContract.bind(this), cb);
|
||||||
}
|
}
|
||||||
|
|
||||||
ensRegisterSubdomain(subdomain, address, cb) {
|
async ensRegisterSubdomain(subdomain, address, cb) {
|
||||||
this.events.request("blockchain:defaultAccount:get", (_err, defaultAccount) => {
|
const defaultAccount = await this.web3DefaultAccount;
|
||||||
this.safeRegisterSubDomain(subdomain, address, defaultAccount, cb);
|
this.safeRegisterSubDomain(subdomain, address, defaultAccount, cb);
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
isENSName(name) {
|
isENSName(name) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user