Browse Source

PR comment

Leszek Wiesner 3 years ago
parent
commit
cef0c6d840
2 changed files with 7 additions and 2 deletions
  1. 6 1
      cli/src/base/ApiCommandBase.ts
  2. 1 1
      cli/tsconfig.json

+ 6 - 1
cli/src/base/ApiCommandBase.ts

@@ -431,8 +431,13 @@ export default abstract class ApiCommandBase extends StateAwareCommandBase {
     return await this.sendAndFollowTx(account, tx, warnOnly)
   }
 
+  // TODO:
+  // Switch to:
+  // public findEvent<S extends keyof AugmentedEvents<'promise'> & string, M extends keyof AugmentedEvents<'promise'>[S] & string>
+  //          (result: SubmittableResult, section: S, method: M): Event | undefined {
+  // Once augment-api is supported
   public findEvent(result: SubmittableResult, section: string, method: string): Event | undefined {
-    return result.events.find((record) => record.event.section === section && record.event.method === method)?.event
+    return result.findRecord(section, method)?.event
   }
 
   async buildAndSendExtrinsic(

+ 1 - 1
cli/tsconfig.json

@@ -12,7 +12,7 @@
     "noUnusedLocals": true,
     "baseUrl": ".",
     "paths": {
-      "@polkadot/types/augment": ["../types/augment-codec/augment-types.ts"],
+      "@polkadot/types/augment": ["../types/augment-codec/augment-types.ts"]
     },
     "resolveJsonModule": true,
     "skipLibCheck": true