mirror of https://github.com/embarklabs/embark.git
fix using promise
This commit is contained in:
parent
212eb79754
commit
ac91ffb967
|
@ -126,15 +126,12 @@ class ENS {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
function setContent(resolver, defaultAccount, next) {
|
function setContent(resolver, defaultAccount, next) {
|
||||||
resolver.methods.setContent(hashedName, contentHash).send({from: defaultAccount}).then((err, transaction) => {
|
resolver.methods.setContent(hashedName, contentHash).send({from: defaultAccount}).then((transaction) => {
|
||||||
if (err) {
|
|
||||||
return next(err);
|
|
||||||
}
|
|
||||||
if (transaction.status !== "0x1" && transaction.status !== "0x01" && transaction.status !== true) {
|
if (transaction.status !== "0x1" && transaction.status !== "0x01" && transaction.status !== true) {
|
||||||
return next('Association failed. Status: ' + transaction.status);
|
return next(new Error('Association failed. Status: ' + transaction.status));
|
||||||
}
|
}
|
||||||
next();
|
next();
|
||||||
});
|
}).catch(next);
|
||||||
}
|
}
|
||||||
], cb);
|
], cb);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue