Skip to content

Commit c724c95

Browse files
author
Grégory Saive
authored
Merge pull request #162 from rg911/master
Fixed bug on transaction serliazation due to Dto definition changed
2 parents 9a4cd82 + 1f9669f commit c724c95

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

src/infrastructure/transaction/SerializeTransactionToJSON.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,11 @@ export const SerializeTransactionToJSON = (transaction: Transaction): any => {
4343
case TransactionType.LINK_ACCOUNT:
4444
return {
4545
remoteAccountKey: (transaction as AccountLinkTransaction).remoteAccountKey,
46-
linkAction: (transaction as AccountLinkTransaction).linkAction,
46+
action: (transaction as AccountLinkTransaction).linkAction,
4747
};
4848
case TransactionType.ADDRESS_ALIAS:
4949
return {
50-
aliasAction: (transaction as AddressAliasTransaction).actionType,
50+
action: (transaction as AddressAliasTransaction).actionType,
5151
namespaceId: (transaction as AddressAliasTransaction).namespaceId.toDTO(),
5252
address: (transaction as AddressAliasTransaction).address.toDTO(),
5353
};
@@ -101,7 +101,7 @@ export const SerializeTransactionToJSON = (transaction: Transaction): any => {
101101
};
102102
case TransactionType.MOSAIC_ALIAS:
103103
return {
104-
aliasAction: (transaction as MosaicAliasTransaction).actionType,
104+
action: (transaction as MosaicAliasTransaction).actionType,
105105
namespaceId: (transaction as MosaicAliasTransaction).namespaceId.toDTO(),
106106
mosaicId: (transaction as MosaicAliasTransaction).mosaicId.toDTO(),
107107
};

src/model/transaction/AccountPropertyModification.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ export class AccountPropertyModification<T> {
7676
toDTO() {
7777
return {
7878
value: this.value,
79-
modificationType: this.modificationType,
79+
type: this.modificationType,
8080
};
8181
}
8282
}

test/infrastructure/SerializeTransactionToJSON.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ describe('SerializeTransactionToJSON', () => {
7272
const json = accountLinkTransaction.toJSON();
7373

7474
expect(json.transaction.remoteAccountKey).to.be.equal(account.publicKey);
75-
expect(json.transaction.linkAction).to.be.equal(LinkAction.Link);
75+
expect(json.transaction.action).to.be.equal(LinkAction.Link);
7676
});
7777

7878
it('should create AccountPropertyAddressTransaction', () => {
@@ -149,7 +149,7 @@ describe('SerializeTransactionToJSON', () => {
149149
const json = addressAliasTransaction.toJSON();
150150

151151
expect(json.transaction.type).to.be.equal(TransactionType.ADDRESS_ALIAS);
152-
expect(json.transaction.aliasAction).to.be.equal(AliasActionType.Link);
152+
expect(json.transaction.action).to.be.equal(AliasActionType.Link);
153153
});
154154

155155
it('should create MosaicAliasTransaction', () => {
@@ -165,7 +165,7 @@ describe('SerializeTransactionToJSON', () => {
165165
const json = mosaicAliasTransaction.toJSON();
166166

167167
expect(json.transaction.type).to.be.equal(TransactionType.MOSAIC_ALIAS);
168-
expect(json.transaction.aliasAction).to.be.equal(AliasActionType.Link);
168+
expect(json.transaction.action).to.be.equal(AliasActionType.Link);
169169

170170
});
171171

0 commit comments

Comments
 (0)