Skip to content

Commit 379e43a

Browse files
committed
Optimised address filter
1 parent 24c923f commit 379e43a

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/infrastructure/Listener.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,9 +351,9 @@ export class Listener implements IListener {
351351
return this.messageSubject.asObservable().pipe(
352352
filter((_) => _.channelName === ListenerChannelName.status),
353353
filter((_) => _.message instanceof TransactionStatusError),
354+
filter((_) => _.channelParam.toUpperCase() === address.plain()),
354355
map((_) => _.message as TransactionStatusError),
355356
filter((_) => !transactionHash || _.hash.toUpperCase() == transactionHash.toUpperCase()),
356-
filter((_) => address.equals(_.address)),
357357
);
358358
}
359359

@@ -417,6 +417,7 @@ export class Listener implements IListener {
417417
return this.messageSubject.asObservable().pipe(
418418
filter((_) => _.channelName.toUpperCase() === ListenerChannelName.cosignature.toUpperCase()),
419419
filter((_) => _.message instanceof CosignatureSignedTransaction),
420+
filter((_) => _.channelParam.toUpperCase() === address.plain()),
420421
map((_) => _.message as CosignatureSignedTransaction),
421422
);
422423
}

test/infrastructure/Listener.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ describe('Listener', () => {
115115
}
116116

117117
const statusInfoErrorDTO = {
118-
topic: 'status',
118+
topic: `status/${errorAddress.plain()}`,
119119
data: {
120120
address: errorEncodedAddress,
121121
deadline: '1010',
@@ -159,7 +159,7 @@ describe('Listener', () => {
159159
}
160160

161161
const statusInfoErrorDTO = {
162-
topic: 'status',
162+
topic: `status/${errorAddress.plain()}`,
163163
data: {
164164
address: errorEncodedAddress,
165165
deadline: '1010',

0 commit comments

Comments
 (0)