mirror of
https://github.com/fluencelabs/dweb-transports
synced 2025-04-24 22:32:16 +00:00
Merge pull request #15 from rodneywitcher/master
Resolves callback vs promise inconsistency
This commit is contained in:
commit
0960047785
@ -54,11 +54,14 @@ class TransportWOLK extends Transport {
|
||||
.then( async () => { //TODO-WOLK check - I'm just not familiar with this construct - an async function inside a .then
|
||||
if( this.wolk.ecdsaKey == undefined || this.wolk.ecdsaKey == null ) {
|
||||
var wolkName = "user" + Math.floor((Math.random() * 1000) + 1);
|
||||
debug("createAccount because ecsaKey null");
|
||||
await this.wolk.createAccount(wolkName, (err, hash) => { //TODO-WOLK check - is this correct (it might be), async await, but has a callback?
|
||||
if(err) { throw new Error("Error Creating Account: " + err); }
|
||||
debug("Account Created: [%s] hash: %s KEY: %s", wolkName, ,this.wolk.ecdsaKey);
|
||||
})
|
||||
debug("WOLK: createAccount because ecdsaKey null")
|
||||
return await this.wolk.createAccount(wolkName)
|
||||
.then( hash => {
|
||||
debug("[WOLK] Account Created: [" + wolkName + "] hash: " + hash + " KEY: " + this.wolk.ecdsaKey)
|
||||
})
|
||||
.catch( err => {
|
||||
throw new Error("Error Creating Account: " + err);
|
||||
})
|
||||
}
|
||||
});
|
||||
try {
|
||||
|
Loading…
x
Reference in New Issue
Block a user