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) {
|
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