Skip to content

Commit 4c656b2

Browse files
committed
Fixed #390 Spread operator does not assign super class methods
1 parent b26694b commit 4c656b2

27 files changed

+95
-22
lines changed

src/model/transaction/AccountAddressRestrictionTransaction.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,13 +199,13 @@ export class AccountAddressRestrictionTransaction extends Transaction {
199199
*/
200200
resolveAliases(statement: Statement, aggregateTransactionIndex: number = 0): AccountAddressRestrictionTransaction {
201201
const transactionInfo = this.checkTransactionHeightAndIndex();
202-
return {...Object.getPrototypeOf(this),
202+
return Object.assign({__proto__: Object.getPrototypeOf(this)}, this, {
203203
restrictionAdditions:
204204
this.restrictionAdditions.map((addition) => statement.resolveAddress(addition, transactionInfo.height.toString(),
205205
transactionInfo.index, aggregateTransactionIndex)),
206206
restrictionDeletions:
207207
this.restrictionDeletions.map((deletion) => statement.resolveAddress(deletion, transactionInfo.height.toString(),
208208
transactionInfo.index, aggregateTransactionIndex)),
209-
};
209+
});
210210
}
211211
}

src/model/transaction/AccountMosaicRestrictionTransaction.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,13 +199,13 @@ export class AccountMosaicRestrictionTransaction extends Transaction {
199199
*/
200200
resolveAliases(statement: Statement, aggregateTransactionIndex: number = 0): AccountMosaicRestrictionTransaction {
201201
const transactionInfo = this.checkTransactionHeightAndIndex();
202-
return {...Object.getPrototypeOf(this),
202+
return Object.assign({__proto__: Object.getPrototypeOf(this)}, this, {
203203
restrictionAdditions:
204204
this.restrictionAdditions.map((addition) => statement.resolveMosaicId(addition, transactionInfo.height.toString(),
205205
transactionInfo.index, aggregateTransactionIndex)),
206206
restrictionDeletions:
207207
this.restrictionDeletions.map((deletion) => statement.resolveMosaicId(deletion, transactionInfo.height.toString(),
208208
transactionInfo.index, aggregateTransactionIndex)),
209-
};
209+
});
210210
}
211211
}

src/model/transaction/LockFundsTransaction.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,8 +211,8 @@ export class LockFundsTransaction extends Transaction {
211211
*/
212212
resolveAliases(statement: Statement, aggregateTransactionIndex: number = 0): LockFundsTransaction {
213213
const transactionInfo = this.checkTransactionHeightAndIndex();
214-
return {...Object.getPrototypeOf(this),
214+
return Object.assign({__proto__: Object.getPrototypeOf(this)}, this, {
215215
mosaic: statement.resolveMosaic(this.mosaic, transactionInfo.height.toString(),
216-
transactionInfo.index, aggregateTransactionIndex)};
216+
transactionInfo.index, aggregateTransactionIndex)});
217217
}
218218
}

src/model/transaction/MosaicAddressRestrictionTransaction.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,10 +243,10 @@ export class MosaicAddressRestrictionTransaction extends Transaction {
243243
*/
244244
resolveAliases(statement: Statement, aggregateTransactionIndex: number = 0): MosaicAddressRestrictionTransaction {
245245
const transactionInfo = this.checkTransactionHeightAndIndex();
246-
return {...Object.getPrototypeOf(this),
246+
return Object.assign({__proto__: Object.getPrototypeOf(this)}, this, {
247247
mosaicId: statement.resolveMosaicId(this.mosaicId, transactionInfo.height.toString(),
248248
transactionInfo.index, aggregateTransactionIndex),
249249
targetAddress: statement.resolveAddress(this.targetAddress,
250-
transactionInfo.height.toString(), transactionInfo.index, aggregateTransactionIndex)};
250+
transactionInfo.height.toString(), transactionInfo.index, aggregateTransactionIndex)});
251251
}
252252
}

src/model/transaction/MosaicGlobalRestrictionTransaction.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,10 +253,10 @@ export class MosaicGlobalRestrictionTransaction extends Transaction {
253253
*/
254254
resolveAliases(statement: Statement, aggregateTransactionIndex: number = 0): MosaicGlobalRestrictionTransaction {
255255
const transactionInfo = this.checkTransactionHeightAndIndex();
256-
return {...Object.getPrototypeOf(this),
256+
return Object.assign({__proto__: Object.getPrototypeOf(this)}, this, {
257257
mosaicId: statement.resolveMosaicId(this.mosaicId, transactionInfo.height.toString(),
258258
transactionInfo.index, aggregateTransactionIndex),
259259
referenceMosaicId: statement.resolveMosaicId(this.referenceMosaicId, transactionInfo.height.toString(),
260-
transactionInfo.index, aggregateTransactionIndex)};
260+
transactionInfo.index, aggregateTransactionIndex)});
261261
}
262262
}

src/model/transaction/MosaicMetadataTransaction.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,8 +219,8 @@ export class MosaicMetadataTransaction extends Transaction {
219219
*/
220220
resolveAliases(statement: Statement, aggregateTransactionIndex: number = 0): MosaicMetadataTransaction {
221221
const transactionInfo = this.checkTransactionHeightAndIndex();
222-
return {...Object.getPrototypeOf(this),
222+
return Object.assign({__proto__: Object.getPrototypeOf(this)}, this, {
223223
targetMosaicId: statement.resolveMosaicId(this.targetMosaicId, transactionInfo.height.toString(),
224-
transactionInfo.index, aggregateTransactionIndex)};
224+
transactionInfo.index, aggregateTransactionIndex)});
225225
}
226226
}

src/model/transaction/MosaicSupplyChangeTransaction.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,8 +193,8 @@ export class MosaicSupplyChangeTransaction extends Transaction {
193193
*/
194194
resolveAliases(statement: Statement, aggregateTransactionIndex: number = 0): MosaicSupplyChangeTransaction {
195195
const transactionInfo = this.checkTransactionHeightAndIndex();
196-
return {...Object.getPrototypeOf(this),
196+
return Object.assign({__proto__: Object.getPrototypeOf(this)}, this, {
197197
mosaicId: statement.resolveMosaicId(this.mosaicId, transactionInfo.height.toString(),
198-
transactionInfo.index, aggregateTransactionIndex)};
198+
transactionInfo.index, aggregateTransactionIndex)});
199199
}
200200
}

src/model/transaction/SecretLockTransaction.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,10 +240,10 @@ export class SecretLockTransaction extends Transaction {
240240
*/
241241
resolveAliases(statement: Statement, aggregateTransactionIndex: number = 0): SecretLockTransaction {
242242
const transactionInfo = this.checkTransactionHeightAndIndex();
243-
return {...Object.getPrototypeOf(this),
243+
return Object.assign({__proto__: Object.getPrototypeOf(this)}, this, {
244244
recipientAddress: statement.resolveAddress(this.recipientAddress,
245245
transactionInfo.height.toString(), transactionInfo.index, aggregateTransactionIndex),
246246
mosaic: statement.resolveMosaic(this.mosaic, transactionInfo.height.toString(),
247-
transactionInfo.index, aggregateTransactionIndex)};
247+
transactionInfo.index, aggregateTransactionIndex)});
248248
}
249249
}

src/model/transaction/SecretProofTransaction.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,8 +217,8 @@ export class SecretProofTransaction extends Transaction {
217217
*/
218218
resolveAliases(statement: Statement, aggregateTransactionIndex: number = 0): SecretProofTransaction {
219219
const transactionInfo = this.checkTransactionHeightAndIndex();
220-
return {...Object.getPrototypeOf(this),
220+
return Object.assign({__proto__: Object.getPrototypeOf(this)}, this, {
221221
recipientAddress: statement.resolveAddress(this.recipientAddress,
222-
transactionInfo.height.toString(), transactionInfo.index, aggregateTransactionIndex)};
222+
transactionInfo.height.toString(), transactionInfo.index, aggregateTransactionIndex)});
223223
}
224224
}

src/model/transaction/Transaction.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ export abstract class Transaction {
200200
* @returns {TransferTransaction}
201201
*/
202202
public setMaxFee(feeMultiplier: number): Transaction {
203-
return {...Object.getPrototypeOf(this), maxFee: UInt64.fromUint(this.size * feeMultiplier)};
203+
return Object.assign({__proto__: Object.getPrototypeOf(this)}, this, {maxFee: UInt64.fromUint(this.size * feeMultiplier)});
204204
}
205205

206206
/**

0 commit comments

Comments
 (0)