Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion e2e/infrastructure/Listener.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { TransactionRepository } from '../../src/infrastructure/TransactionRepos
import { Account } from '../../src/model/account/Account';
import { NetworkType } from '../../src/model/blockchain/NetworkType';
import { PlainMessage } from '../../src/model/message/PlainMessage';
import { Address, CosignatureTransaction, LockFundsTransaction, Mosaic, SignedTransaction, UInt64, } from '../../src/model/model';
import { Address, CosignatureTransaction, LockFundsTransaction, Mosaic, SignedTransaction, UInt64 } from '../../src/model/model';
import { MosaicId } from '../../src/model/mosaic/MosaicId';
import { NetworkCurrencyMosaic } from '../../src/model/mosaic/NetworkCurrencyMosaic';
import { NamespaceId } from '../../src/model/namespace/NamespaceId';
Expand Down
3 changes: 2 additions & 1 deletion e2e/infrastructure/TransactionHttp.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,8 @@ describe('TransactionHttp', () => {

describe('Get network currency mosaic id', () => {
it('get mosaicId', async () => {
networkCurrencyMosaicId = (await namespaceRepository.getLinkedMosaicId(new NamespaceId('cat.currency')).toPromise()) as MosaicId;
networkCurrencyMosaicId =
(await namespaceRepository.getLinkedMosaicId(new NamespaceId('cat.currency')).toPromise()) as MosaicId;
});
});

Expand Down
2 changes: 1 addition & 1 deletion src/core/utils/TransactionMapping.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import { CreateTransactionFromDTO } from '../../infrastructure/transaction/CreateTransactionFromDTO';
import {
CreateTransactionFromInnerPayload,
CreateTransactionFromPayload
CreateTransactionFromPayload,
} from '../../infrastructure/transaction/CreateTransactionFromPayload';
import { Transaction } from '../../model/transaction/Transaction';

Expand Down
2 changes: 1 addition & 1 deletion src/infrastructure/Listener.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import { TransactionStatusError } from '../model/transaction/TransactionStatusEr
import { TransferTransaction } from '../model/transaction/TransferTransaction';
import { UInt64 } from '../model/UInt64';
import { IListener } from './IListener';
import { CreateTransactionFromDTO, extractBeneficiary, } from './transaction/CreateTransactionFromDTO';
import { CreateTransactionFromDTO, extractBeneficiary } from './transaction/CreateTransactionFromDTO';

enum ListenerChannelName {
block = 'block',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ import {
SecretLockTransactionBuilder,
SecretProofTransactionBuilder,
TransactionHelper,
TransferTransactionBuilder
TransferTransactionBuilder,
} from 'catbuffer';
import { Convert, Convert as convert } from '../../core/format';
import { Deadline, PublicAccount, UInt64 } from '../../model/model';
Expand Down Expand Up @@ -215,6 +215,3 @@ export const CreateTransactionFromEmbeddedTransactionBuilder = (builder: Embedde

return toBuilder().toAggregate(signer);
};



5 changes: 3 additions & 2 deletions src/model/transaction/AccountAddressRestrictionTransaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ export class AccountAddressRestrictionTransaction extends Transaction {
* @param maxFee the preloaded max fee
* @returns {Transaction}
*/
public static createFromBodyBuilder(builder: AccountAddressRestrictionTransactionBuilder | EmbeddedAccountAddressRestrictionTransactionBuilder,
public static createFromBodyBuilder(builder: AccountAddressRestrictionTransactionBuilder |
EmbeddedAccountAddressRestrictionTransactionBuilder,
networkType: NetworkType,
deadline: Deadline,
maxFee: UInt64): Transaction {
Expand All @@ -116,7 +117,7 @@ export class AccountAddressRestrictionTransaction extends Transaction {
return UnresolvedMapping.toUnresolvedAddress(Convert.uint8ToHex(deletion.unresolvedAddress));
}),
networkType,
maxFee
maxFee,
);
}

Expand Down
1 change: 0 additions & 1 deletion src/model/transaction/AccountLinkTransaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ export class AccountLinkTransaction extends Transaction {
super(TransactionType.ACCOUNT_LINK, networkType, version, deadline, maxFee, signature, signer, transactionInfo);
}


/**
* Creates a transaction from catbuffer body builders.
* @internal
Expand Down
2 changes: 1 addition & 1 deletion src/model/transaction/AccountMetadataTransaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ export class AccountMetadataTransaction extends Transaction {
builder.getValueSizeDelta(),
Convert.uint8ToUtf8(builder.getValue()),
networkType,
maxFee
maxFee,
);
}

Expand Down
5 changes: 3 additions & 2 deletions src/model/transaction/AccountMosaicRestrictionTransaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ export class AccountMosaicRestrictionTransaction extends Transaction {
* @param maxFee the preloaded max fee
* @returns {Transaction}
*/
public static createFromBodyBuilder(builder: AccountMosaicRestrictionTransactionBuilder | EmbeddedAccountMosaicRestrictionTransactionBuilder,
public static createFromBodyBuilder(builder: AccountMosaicRestrictionTransactionBuilder |
EmbeddedAccountMosaicRestrictionTransactionBuilder,
networkType: NetworkType,
deadline: Deadline,
maxFee: UInt64): Transaction {
Expand All @@ -115,7 +116,7 @@ export class AccountMosaicRestrictionTransaction extends Transaction {
builder.getRestrictionDeletions().map((deletion) => {
return UnresolvedMapping.toUnresolvedMosaic(new UInt64(deletion.unresolvedMosaicId).toHex());
}),
networkType, maxFee
networkType, maxFee,
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,15 +96,16 @@ export class AccountOperationRestrictionTransaction extends Transaction {
* @param maxFee the preloaded max fee
* @returns {Transaction}
*/
public static createFromBodyBuilder(builder: AccountOperationRestrictionTransactionBuilder | EmbeddedAccountOperationRestrictionTransactionBuilder,
public static createFromBodyBuilder(builder: AccountOperationRestrictionTransactionBuilder |
EmbeddedAccountOperationRestrictionTransactionBuilder,
networkType: NetworkType,
deadline: Deadline,
maxFee: UInt64): Transaction {
return AccountOperationRestrictionTransaction.create(deadline,
builder.getRestrictionFlags().valueOf(),
builder.getRestrictionAdditions(),
builder.getRestrictionDeletions(),
networkType, maxFee
networkType, maxFee,
);
}

Expand Down
7 changes: 3 additions & 4 deletions src/model/transaction/AggregateTransaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,17 +159,16 @@ export class AggregateTransaction extends Transaction {
innerTransactions,
networkType,
consignatures,
maxFee
maxFee,
) : AggregateTransaction.createBonded(
deadline,
innerTransactions,
networkType,
consignatures,
maxFee
maxFee,
);
}


/**
* @description add inner transactions to current list
* @param {Transaction[]} transactions the transactions to be added
Expand Down Expand Up @@ -386,7 +385,7 @@ export class AggregateTransaction extends Transaction {
return DtoMapping.assign(this,
{
innerTransactions: this.innerTransactions.map((tx) => tx.resolveAliases(statement, transactionInfo.index))
.sort((a, b) => a.transactionInfo!.index - b.transactionInfo!.index)
.sort((a, b) => a.transactionInfo!.index - b.transactionInfo!.index),
});
}
}
2 changes: 1 addition & 1 deletion src/model/transaction/LockFundsTransaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ export class LockFundsTransaction extends Transaction {
),
new UInt64(builder.getDuration().blockDuration),
new SignedTransaction('', Convert.uint8ToHex(builder.getHash().hash256), '', TransactionType.AGGREGATE_BONDED, networkType),
networkType, maxFee
networkType, maxFee,
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ export class MosaicAddressRestrictionTransaction extends Transaction {
new UInt64(builder.getNewRestrictionValue()),
networkType,
new UInt64(builder.getPreviousRestrictionValue()),
maxFee
maxFee,
);
}

Expand Down
1 change: 0 additions & 1 deletion src/model/transaction/MosaicAliasTransaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ export class MosaicAliasTransaction extends Transaction {
super(TransactionType.MOSAIC_ALIAS, networkType, version, deadline, maxFee, signature, signer, transactionInfo);
}


/**
* Creates a transaction from catbuffer body builders.
* @internal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ export class MosaicGlobalRestrictionTransaction extends Transaction {
builder.getNewRestrictionType().valueOf(),
networkType,
UnresolvedMapping.toUnresolvedMosaic(new UInt64(builder.getReferenceMosaicId().unresolvedMosaicId).toHex()),
maxFee
maxFee,
);
}

Expand Down
2 changes: 1 addition & 1 deletion src/model/transaction/MosaicMetadataTransaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ export class MosaicMetadataTransaction extends Transaction {
builder.getValueSizeDelta(),
Convert.uint8ToUtf8(builder.getValue()),
networkType,
maxFee
maxFee,
);
}

Expand Down
2 changes: 0 additions & 2 deletions src/model/transaction/MosaicSupplyChangeTransaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,6 @@ export class MosaicSupplyChangeTransaction extends Transaction {
super(TransactionType.MOSAIC_SUPPLY_CHANGE, networkType, version, deadline, maxFee, signature, signer, transactionInfo);
}



/**
* Creates a transaction from catbuffer body builders.
* @internal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,8 @@ export class MultisigAccountModificationTransaction extends Transaction {
* @param maxFee the preloaded max fee
* @returns {Transaction}
*/
public static createFromBodyBuilder(builder: MultisigAccountModificationTransactionBuilder | EmbeddedMultisigAccountModificationTransactionBuilder,
public static createFromBodyBuilder(builder: MultisigAccountModificationTransactionBuilder |
EmbeddedMultisigAccountModificationTransactionBuilder,
networkType: NetworkType,
deadline: Deadline,
maxFee: UInt64): Transaction {
Expand All @@ -133,7 +134,7 @@ export class MultisigAccountModificationTransaction extends Transaction {
return PublicAccount.createFromPublicKey(Convert.uint8ToHex(deletion.getKey()), networkType);
}),
networkType,
maxFee
maxFee,
);
}

Expand Down
2 changes: 1 addition & 1 deletion src/model/transaction/NamespaceMetadataTransaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ export class NamespaceMetadataTransaction extends Transaction {
builder.getValueSizeDelta(),
Convert.uint8ToUtf8(builder.getValue()),
networkType,
maxFee
maxFee,
);
}

Expand Down
2 changes: 1 addition & 1 deletion src/model/transaction/SecretProofTransaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ export class SecretProofTransaction extends Transaction {
UnresolvedMapping.toUnresolvedAddress(Convert.uint8ToHex(builder.getRecipientAddress().unresolvedAddress)),
Convert.uint8ToHex(builder.getProof()),
networkType,
maxFee
maxFee,
);
}

Expand Down
2 changes: 1 addition & 1 deletion src/model/transaction/TransferTransaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ export class TransferTransaction extends Transaction {
messageType === MessageType.PlainMessage ?
PlainMessage.createFromPayload(messageHex) :
EncryptedMessage.createFromPayload(messageHex),
networkType, maxFee
networkType, maxFee,
);
}

Expand Down
6 changes: 2 additions & 4 deletions test/model/transaction/AggregateTransaction.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,7 @@ describe('AggregateTransaction', () => {
Deadline.create(),
[transferTransaction.toAggregate(account.publicAccount)],
networkType,
[]
[],
).setMaxFee(2);
expect(aggregateTransaction.maxFee.compact()).to.be.equal(560);
Expand Down Expand Up @@ -624,7 +624,6 @@ describe('AggregateTransaction', () => {
expect(signedTransaction.hash).not.to.be.undefined;
});


it('Test aggregate serialization', () => {
const transferTransaction1 = new TransferTransaction(
networkType,
Expand Down Expand Up @@ -653,7 +652,7 @@ describe('AggregateTransaction', () => {
new AggregateTransactionCosignature('AAA9366406ACA952B88BADF5F1E9BE6CE4968141035A60BE503273EA65456111AAA9366406ACA952B88BADF5F1E9BE6CE4968141035A60BE503273EA65456111',
PublicAccount.createFromPublicKey('9A49366406ACA952B88BADF5F1E9BE6CE4968141035A60BE503273EA65456111', networkType)),
new AggregateTransactionCosignature('BBB9366406ACA952B88BADF5F1E9BE6CE4968141035A60BE503273EA65456222BBB9366406ACA952B88BADF5F1E9BE6CE4968141035A60BE503273EA65456222',
PublicAccount.createFromPublicKey('9A49366406ACA952B88BADF5F1E9BE6CE4968141035A60BE503273EA65456111', networkType))
PublicAccount.createFromPublicKey('9A49366406ACA952B88BADF5F1E9BE6CE4968141035A60BE503273EA65456111', networkType)),
];

const aggregateTransaction = AggregateTransaction.createComplete(
Expand All @@ -667,7 +666,6 @@ describe('AggregateTransaction', () => {

const parsedTransaction = CreateTransactionFromPayload(expected) as AggregateTransaction;


expect(parsedTransaction.deadline.toString()).to.be.equal(aggregateTransaction.deadline.toString());
expect(parsedTransaction.maxFee.toHex()).to.be.equal(aggregateTransaction.maxFee.toHex());
expect(parsedTransaction.cosignatures.length).to.be.equal(2);
Expand Down