maidsafe-archive / safe_examples

examples showcasing various features of the SAFE Network
BSD 3-Clause "New" or "Revised" License
82 stars 50 forks source link

MAID-2374: refactor promises using async/await #295

Closed hunterlester closed 6 years ago

hunterlester commented 6 years ago

Testing using SAFE_FAKE_AUTH. There are potentially pieces of functions that are only engaged in non-testing environment, otherwise, everything is working so far.

Just need to figure out how to successfully refactor setupAccount. Not sure how this works:

.then((encryptedAddr) => pubNamesMd.decrypt(encryptedAddr.buf)
        .then((servicesXorName) => createEmailService(app, servicesXorName, serviceInfo))
      , (err) => { // ...if not then create it
        if (err.code !== SAFE_APP_ERROR_CODES.ERR_NO_SUCH_ENTRY) {
          throw err;
        }
maidsafe-highfive commented 6 years ago

r? @krishnaIndia

(maidsafe_highfive has picked a reviewer for you, use r? to override)