This commit is contained in:
Mitra Ardron 2019-03-21 11:36:38 -07:00
commit 8d77901fc6

View File

@ -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 .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 ) { if( this.wolk.ecdsaKey == undefined || this.wolk.ecdsaKey == null ) {
var wolkName = "user" + Math.floor((Math.random() * 1000) + 1); var wolkName = "user" + Math.floor((Math.random() * 1000) + 1);
debug("createAccount because ecsaKey null"); debug("WOLK: createAccount because ecdsaKey null")
await this.wolk.createAccount(wolkName, (err, hash) => { //TODO-WOLK check - is this correct (it might be), async await, but has a callback? return await this.wolk.createAccount(wolkName)
if(err) { throw new Error("Error Creating Account: " + err); } .then( hash => {
debug("Account Created: [%s] hash: %s KEY: %s", wolkName, ,this.wolk.ecdsaKey); debug("[WOLK] Account Created: [" + wolkName + "] hash: " + hash + " KEY: " + this.wolk.ecdsaKey)
}) })
.catch( err => {
throw new Error("Error Creating Account: " + err);
})
} }
}); });
try { try {