Skip to content

Commit 1d7a18b

Browse files
authored
Merge pull request #269 from rg911/task/g267_cosignatory_issue_in_ws
WS listener cosignatory and block channel issue and other small issues fixes
2 parents 7952d24 + 88b28b7 commit 1d7a18b

File tree

3 files changed

+14
-15
lines changed

3 files changed

+14
-15
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,4 +87,5 @@ modules.xml
8787
# End of https://www.gitignore.io/api/intellij+iml
8888
dist/
8989
ts-docs
90-
docs/
90+
docs/
91+
.vscode/launch.json

src/infrastructure/Listener.ts

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -126,16 +126,16 @@ export class Listener {
126126
channelName: ListenerChannelName.block, message: new BlockInfo(
127127
message.meta.hash,
128128
message.meta.generationHash,
129-
message.meta.totalFee ? new UInt64(message.meta.totalFee) : new UInt64([0, 0]),
129+
message.meta.totalFee ? UInt64.fromNumericString(message.meta.totalFee) : new UInt64([0, 0]),
130130
message.meta.numTransactions,
131131
message.block.signature,
132132
PublicAccount.createFromPublicKey(message.block.signerPublicKey, networkType),
133133
networkType,
134134
parseInt(message.block.version.toString(16).substr(2, 2), 16), // Tx version
135135
message.block.type,
136-
new UInt64(message.block.height),
137-
new UInt64(message.block.timestamp),
138-
new UInt64(message.block.difficulty),
136+
UInt64.fromNumericString(message.block.height),
137+
UInt64.fromNumericString(message.block.timestamp),
138+
UInt64.fromNumericString(message.block.difficulty),
139139
message.block.feeMultiplier,
140140
message.block.previousBlockHash,
141141
message.block.blockTransactionsHash,
@@ -151,13 +151,13 @@ export class Listener {
151151
message.status,
152152
Deadline.createFromDTO(message.deadline)),
153153
});
154-
} else if (message.meta) {
155-
this.messageSubject.next({channelName: message.meta.channelName, message: message.meta.hash});
156154
} else if (message.parentHash) {
157155
this.messageSubject.next({
158156
channelName: ListenerChannelName.cosignature,
159157
message: new CosignatureSignedTransaction(message.parentHash, message.signature, message.signerPublicKey),
160158
});
159+
} else if (message.meta && message.meta.hash) {
160+
this.messageSubject.next({channelName: message.meta.channelName, message: message.meta.hash});
161161
}
162162
};
163163
} else {
@@ -371,7 +371,8 @@ export class Listener {
371371
}
372372
});
373373
transaction.innerTransactions.map((innerTransaction: InnerTransaction) => {
374-
if (this.transactionHasSignerOrReceptor(innerTransaction, address)) {
374+
if (this.transactionHasSignerOrReceptor(innerTransaction, address) ||
375+
this.accountAddedToMultiSig(innerTransaction, address)) {
375376
transactionFromAddress = true;
376377
}
377378
});
@@ -405,14 +406,11 @@ export class Listener {
405406
* @param address - Address
406407
* @returns boolean
407408
*/
408-
// tslint:disable-next-line:adjacent-overload-signatures
409409
private accountAddedToMultiSig(transaction: Transaction, address: Address): boolean {
410410
if (transaction instanceof MultisigAccountModificationTransaction) {
411-
transaction.modifications.map((_: MultisigCosignatoryModification) => {
412-
if (_.modificiationType === CosignatoryModificationAction.Add && _.cosignatoryPublicAccount.address.equals(address)) {
413-
return true;
414-
}
415-
});
411+
return transaction.modifications.find((_: MultisigCosignatoryModification) =>
412+
_.modificiationType === CosignatoryModificationAction.Add &&
413+
_.cosignatoryPublicAccount.address.equals(address)) !== undefined;
416414
}
417415
return false;
418416
}

src/model/transaction/MosaicGlobalRestrictionTransaction.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ export class MosaicGlobalRestrictionTransaction extends Transaction {
5858
* @param previousRestrictionValue - The previous restriction value.
5959
* @param previousRestrictionType - The previous restriction type.
6060
* @param newRestrictionValue - The new restriction value.
61-
* @param previousRestrictionType - The previous restriction tpye.
61+
* @param newRestrictionType - The new restriction tpye.
6262
* @param networkType - The network type.
6363
* @param referenceMosaicId - (Optional) The mosaic id providing the restriction key.
6464
* @param maxFee - (Optional) Max fee defined by the sender

0 commit comments

Comments
 (0)