Skip to content

Commit ff6b578

Browse files
author
Grégory Saive
authored
Merge branch 'master' into export-EncryptedMessage-class
2 parents 87ee3ef + fa69d07 commit ff6b578

File tree

5 files changed

+70
-11
lines changed

5 files changed

+70
-11
lines changed

e2e/infrastructure/transaction/CreateTransactionFromDTO.spec.ts

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,53 @@ describe('CreateTransactionFromDTO', () => {
7171
ValidateTransaction.validateStandaloneTx(transferTransaction, transferTransactionDTO);
7272
});
7373

74+
it('standalone without message', () => {
75+
const transferTransactionDTO = {
76+
meta: {
77+
hash: '18C036C20B32348D63684E09A13128A2C18F6A75650D3A5FB43853D716E5E219',
78+
height: [
79+
1,
80+
0,
81+
],
82+
id: '59FDA0733F17CF0001772CA7',
83+
index: 19,
84+
merkleComponentHash: '18C036C20B32348D63684E09A13128A2C18F6A75650D3A5FB43853D716E5E219',
85+
},
86+
transaction: {
87+
deadline: [
88+
10000,
89+
0,
90+
],
91+
fee: [
92+
0,
93+
0,
94+
],
95+
mosaics: [
96+
{
97+
amount: [
98+
3863990592,
99+
95248,
100+
],
101+
id: [
102+
3646934825,
103+
3576016193,
104+
],
105+
},
106+
],
107+
recipient: '9050B9837EFAB4BBE8A4B9BB32D812F9885C00D8FC1650E142',
108+
signature: '553E696EB4A54E43A11D180EBA57E4B89D0048C9DD2604A9E0608120018B9E0' +
109+
'2F6EE63025FEEBCED3293B622AF8581334D0BDAB7541A9E7411E7EE4EF0BC5D0E',
110+
signer: 'B4F12E7C9F6946091E2CB8B6D3A12B50D17CCBBF646386EA27CE2946A7423DCF',
111+
type: 16724,
112+
version: 36867,
113+
},
114+
};
115+
116+
const transferTransaction = CreateTransactionFromDTO(transferTransactionDTO);
117+
118+
ValidateTransaction.validateStandaloneTx(transferTransaction, transferTransactionDTO);
119+
});
120+
74121
it('aggregate', () => {
75122
const aggregateTransferTransactionDTO = {
76123
meta: {

src/infrastructure/QueryParams.ts

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,15 @@
1414
* limitations under the License.
1515
*/
1616

17+
/**
18+
* @since 0.11.3
19+
*/
20+
export enum Order {
21+
ASC = 'id',
22+
DESC = '-id',
23+
}
24+
25+
1726
/**
1827
* The query params structure describes pagination params for requests.
1928
*
@@ -34,7 +43,14 @@ export class QueryParams {
3443
/**
3544
* Id after which we want objects to be returned
3645
*/
37-
public readonly id?: string) {
46+
public readonly id?: string,
47+
/**
48+
* Order of transactions.
49+
* DESC. Newer to older.
50+
* ASC. Older to newer.
51+
*/
52+
public readonly order: Order = Order.DESC,
53+
) {
3854
this.pageSize = (pageSize >= 10 && pageSize <= 100) ? pageSize : 10;
3955
this.id = id;
4056
}

src/infrastructure/transaction/CreateTransactionFromDTO.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ const CreateStandaloneTransactionFromDTO = (transactionDTO, transactionInfo): Tr
125125
UInt64.fromUint(transactionDTO.maxFee || 0),
126126
extractRecipient(transactionDTO.recipient),
127127
extractMosaics(transactionDTO.mosaics),
128-
extractMessage(transactionDTO.message.payload),
128+
extractMessage(transactionDTO.message !== undefined ? transactionDTO.message.payload : undefined),
129129
transactionDTO.signature,
130130
transactionDTO.signer ? PublicAccount.createFromPublicKey(transactionDTO.signer,
131131
extractNetworkType(transactionDTO.version)) : undefined,

src/model/transaction/AddressAliasTransaction.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,11 @@ import { TransactionVersion } from './TransactionVersion';
3434
export class AddressAliasTransaction extends Transaction {
3535

3636
/**
37-
* Create a mosaic supply change transaction object
37+
* Create a address alias transaction object
3838
* @param deadline - The deadline to include the transaction.
39-
* @param actionType - The namespace id.
39+
* @param actionType - The alias action type.
4040
* @param namespaceId - The namespace id.
41-
* @param mosaicId - The mosaic id.
41+
* @param address - The address.
4242
* @param networkType - The network type.
4343
* @param maxFee - (Optional) Max fee defined by the sender
4444
* @returns {AddressAliasTransaction}

src/model/transaction/MosaicAliasTransaction.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,12 @@ import { TransactionInfo } from './TransactionInfo';
2727
import { TransactionType } from './TransactionType';
2828
import { TransactionVersion } from './TransactionVersion';
2929

30-
/**
31-
* In case a mosaic has the flag 'supplyMutable' set to true, the creator of the mosaic can change the supply,
32-
* i.e. increase or decrease the supply.
33-
*/
3430
export class MosaicAliasTransaction extends Transaction {
3531

3632
/**
37-
* Create a mosaic supply change transaction object
33+
* Create a mosaic alias transaction object
3834
* @param deadline - The deadline to include the transaction.
39-
* @param actionType - The namespace id.
35+
* @param actionType - The alias action type.
4036
* @param namespaceId - The namespace id.
4137
* @param mosaicId - The mosaic id.
4238
* @param networkType - The network type.

0 commit comments

Comments
 (0)