Skip to content

Commit

Permalink
feat: 馃幐 use a more specific type for onStatusChange in txBase (#829)
Browse files Browse the repository at this point in the history
use GenericPolymeshTransaction<ReturnValue, TransformedReturnValue> in
onStatusChange handler defined in PolymeshTransactionBase. This makes it
easier to define functions to be passed to it
  • Loading branch information
polymath-eric committed Aug 24, 2022
1 parent 7d5a11b commit 32bf5d9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/base/PolymeshTransactionBase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { latestProcessedBlock } from '~/middleware/queries';
import { Query } from '~/middleware/types';
import {
ErrorCode,
GenericPolymeshTransaction,
PayingAccount,
PayingAccountFees,
PayingAccountType,
Expand Down Expand Up @@ -346,7 +347,9 @@ export abstract class PolymeshTransactionBase<
*
* @returns unsubscribe function
*/
public onStatusChange(listener: (transaction: PolymeshTransactionBase) => void): UnsubCallback {
public onStatusChange(
listener: (transaction: GenericPolymeshTransaction<ReturnValue, TransformedReturnValue>) => void
): UnsubCallback {
const { emitter } = this;

emitter.on(Event.StatusChange, listener);
Expand Down

0 comments on commit 32bf5d9

Please sign in to comment.