mirror of https://github.com/embarklabs/embark.git
fix using promise
This commit is contained in:
parent
67b3dff1ba
commit
8724c46924
|
@ -126,15 +126,12 @@ class ENS {
|
|||
});
|
||||
},
|
||||
function setContent(resolver, defaultAccount, next) {
|
||||
resolver.methods.setContent(hashedName, contentHash).send({from: defaultAccount}).then((err, transaction) => {
|
||||
if (err) {
|
||||
return next(err);
|
||||
}
|
||||
resolver.methods.setContent(hashedName, contentHash).send({from: defaultAccount}).then((transaction) => {
|
||||
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();
|
||||
});
|
||||
}).catch(next);
|
||||
}
|
||||
], cb);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue