Skip to content

Commit 8b0be19

Browse files
committed
changed to use object spread opterator
1 parent e06e039 commit 8b0be19

10 files changed

+39
-50
lines changed

src/model/transaction/AccountAddressRestrictionTransaction.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -199,14 +199,13 @@ export class AccountAddressRestrictionTransaction extends Transaction {
199199
*/
200200
resolveAliases(statement: Statement, aggregateTransactionIndex: number = 0): AccountAddressRestrictionTransaction {
201201
const transactionInfo = this.checkTransactionHeightAndIndex();
202-
return Object.assign({__proto__: Object.getPrototypeOf(this)}, this,
203-
{
202+
return {...Object.getPrototypeOf(this),
204203
restrictionAdditions:
205204
this.restrictionAdditions.map((addition) => statement.resolveAddress(addition, transactionInfo.height.toString(),
206205
transactionInfo.index, aggregateTransactionIndex)),
207206
restrictionDeletions:
208207
this.restrictionDeletions.map((deletion) => statement.resolveAddress(deletion, transactionInfo.height.toString(),
209208
transactionInfo.index, aggregateTransactionIndex)),
210-
});
209+
};
211210
}
212211
}

src/model/transaction/AccountMosaicRestrictionTransaction.ts

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -199,14 +199,13 @@ export class AccountMosaicRestrictionTransaction extends Transaction {
199199
*/
200200
resolveAliases(statement: Statement, aggregateTransactionIndex: number = 0): AccountMosaicRestrictionTransaction {
201201
const transactionInfo = this.checkTransactionHeightAndIndex();
202-
return Object.assign({__proto__: Object.getPrototypeOf(this)}, this,
203-
{
204-
restrictionAdditions:
205-
this.restrictionAdditions.map((addition) => statement.resolveMosaicId(addition, transactionInfo.height.toString(),
206-
transactionInfo.index, aggregateTransactionIndex)),
207-
restrictionDeletions:
208-
this.restrictionDeletions.map((deletion) => statement.resolveMosaicId(deletion, transactionInfo.height.toString(),
209-
transactionInfo.index, aggregateTransactionIndex)),
210-
});
202+
return {...Object.getPrototypeOf(this),
203+
restrictionAdditions:
204+
this.restrictionAdditions.map((addition) => statement.resolveMosaicId(addition, transactionInfo.height.toString(),
205+
transactionInfo.index, aggregateTransactionIndex)),
206+
restrictionDeletions:
207+
this.restrictionDeletions.map((deletion) => statement.resolveMosaicId(deletion, transactionInfo.height.toString(),
208+
transactionInfo.index, aggregateTransactionIndex)),
209+
};
211210
}
212211
}

src/model/transaction/LockFundsTransaction.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -212,9 +212,8 @@ export class LockFundsTransaction extends Transaction {
212212
*/
213213
resolveAliases(statement: Statement, aggregateTransactionIndex: number = 0): LockFundsTransaction {
214214
const transactionInfo = this.checkTransactionHeightAndIndex();
215-
return Object.assign({__proto__: Object.getPrototypeOf(this)}, this,
216-
{
217-
mosaic: statement.resolveMosaic(this.mosaic, transactionInfo.height.toString(),
218-
transactionInfo.index, aggregateTransactionIndex)});
215+
return {...Object.getPrototypeOf(this),
216+
mosaic: statement.resolveMosaic(this.mosaic, transactionInfo.height.toString(),
217+
transactionInfo.index, aggregateTransactionIndex)};
219218
}
220219
}

src/model/transaction/MosaicAddressRestrictionTransaction.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -243,11 +243,10 @@ export class MosaicAddressRestrictionTransaction extends Transaction {
243243
*/
244244
resolveAliases(statement: Statement, aggregateTransactionIndex: number = 0): MosaicAddressRestrictionTransaction {
245245
const transactionInfo = this.checkTransactionHeightAndIndex();
246-
return Object.assign({__proto__: Object.getPrototypeOf(this)}, this,
247-
{
248-
mosaicId: statement.resolveMosaicId(this.mosaicId, transactionInfo.height.toString(),
249-
transactionInfo.index, aggregateTransactionIndex),
250-
targetAddress: statement.resolveAddress(this.targetAddress,
251-
transactionInfo.height.toString(), transactionInfo.index, aggregateTransactionIndex)});
246+
return {...Object.getPrototypeOf(this),
247+
mosaicId: statement.resolveMosaicId(this.mosaicId, transactionInfo.height.toString(),
248+
transactionInfo.index, aggregateTransactionIndex),
249+
targetAddress: statement.resolveAddress(this.targetAddress,
250+
transactionInfo.height.toString(), transactionInfo.index, aggregateTransactionIndex)};
252251
}
253252
}

src/model/transaction/MosaicGlobalRestrictionTransaction.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -253,11 +253,10 @@ export class MosaicGlobalRestrictionTransaction extends Transaction {
253253
*/
254254
resolveAliases(statement: Statement, aggregateTransactionIndex: number = 0): MosaicGlobalRestrictionTransaction {
255255
const transactionInfo = this.checkTransactionHeightAndIndex();
256-
return Object.assign({__proto__: Object.getPrototypeOf(this)}, this,
257-
{
258-
mosaicId: statement.resolveMosaicId(this.mosaicId, transactionInfo.height.toString(),
259-
transactionInfo.index, aggregateTransactionIndex),
260-
referenceMosaicId: statement.resolveMosaicId(this.referenceMosaicId, transactionInfo.height.toString(),
261-
transactionInfo.index, aggregateTransactionIndex)});
256+
return {...Object.getPrototypeOf(this),
257+
mosaicId: statement.resolveMosaicId(this.mosaicId, transactionInfo.height.toString(),
258+
transactionInfo.index, aggregateTransactionIndex),
259+
referenceMosaicId: statement.resolveMosaicId(this.referenceMosaicId, transactionInfo.height.toString(),
260+
transactionInfo.index, aggregateTransactionIndex)};
262261
}
263262
}

src/model/transaction/MosaicMetadataTransaction.ts

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

src/model/transaction/MosaicSupplyChangeTransaction.ts

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

src/model/transaction/SecretLockTransaction.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -240,11 +240,10 @@ export class SecretLockTransaction extends Transaction {
240240
*/
241241
resolveAliases(statement: Statement, aggregateTransactionIndex: number = 0): SecretLockTransaction {
242242
const transactionInfo = this.checkTransactionHeightAndIndex();
243-
return Object.assign({__proto__: Object.getPrototypeOf(this)}, this,
244-
{
245-
recipientAddress: statement.resolveAddress(this.recipientAddress,
246-
transactionInfo.height.toString(), transactionInfo.index, aggregateTransactionIndex),
247-
mosaic: statement.resolveMosaic(this.mosaic, transactionInfo.height.toString(),
248-
transactionInfo.index, aggregateTransactionIndex)});
243+
return {...Object.getPrototypeOf(this),
244+
recipientAddress: statement.resolveAddress(this.recipientAddress,
245+
transactionInfo.height.toString(), transactionInfo.index, aggregateTransactionIndex),
246+
mosaic: statement.resolveMosaic(this.mosaic, transactionInfo.height.toString(),
247+
transactionInfo.index, aggregateTransactionIndex)};
249248
}
250249
}

src/model/transaction/SecretProofTransaction.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -223,9 +223,8 @@ export class SecretProofTransaction extends Transaction {
223223
*/
224224
resolveAliases(statement: Statement, aggregateTransactionIndex: number = 0): SecretProofTransaction {
225225
const transactionInfo = this.checkTransactionHeightAndIndex();
226-
return Object.assign({__proto__: Object.getPrototypeOf(this)}, this,
227-
{
228-
recipientAddress: statement.resolveAddress(this.recipientAddress,
229-
transactionInfo.height.toString(), transactionInfo.index, aggregateTransactionIndex)});
226+
return {...Object.getPrototypeOf(this),
227+
recipientAddress: statement.resolveAddress(this.recipientAddress,
228+
transactionInfo.height.toString(), transactionInfo.index, aggregateTransactionIndex)};
230229
}
231230
}

src/model/transaction/TransferTransaction.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -282,11 +282,9 @@ export class TransferTransaction extends Transaction {
282282
*/
283283
public resolveAliases(statement: Statement, aggregateTransactionIndex: number = 0): TransferTransaction {
284284
const transactionInfo = this.checkTransactionHeightAndIndex();
285-
return Object.assign({__proto__: Object.getPrototypeOf(this)}, this,
286-
{
287-
recipientAddress: statement.resolveAddress(this.recipientAddress,
285+
return {...Object.getPrototypeOf(this), recipientAddress: statement.resolveAddress(this.recipientAddress,
288286
transactionInfo.height.toString(), transactionInfo.index, aggregateTransactionIndex),
289287
mosaics: this.mosaics.map((mosaic) => statement.resolveMosaic(mosaic, transactionInfo.height.toString(),
290-
transactionInfo.index, aggregateTransactionIndex))});
288+
transactionInfo.index, aggregateTransactionIndex))};
291289
}
292290
}

0 commit comments

Comments
 (0)