Prefer not using an async function as a Promise executor JS-0031
Anti-pattern
Major
5 months ago3 years old
Promise executor functions should not be async
 87  key: BlobKey,
 88  data: Buffer | string,
 89) {
 90  return new Promise(async (resolve, reject) => { 91    const stream = store.createWriteStream(key, (error, metadata) => {
 92      if (error) {
 93        reject(error);
Promise executor functions should not be async
144
145  it("should get block number stream", async function () {
146    const current = await client.blockchain.getCurrentBlockNum();
147    await new Promise(async (resolve, reject) => {148      const stream = client.blockchain.getBlockNumberStream();
149      stream.on("data", (num) => {
150        assert(num >= current);