Skip to content

Commit da9f0fe

Browse files
author
Grégory Saive
authored
Merge pull request #192 from rg911/task/g186_reset_versions
[Elephant] Issue #186 Reset transaction versions to 1 (36865)
2 parents 61dd0f0 + d02f5fe commit da9f0fe

22 files changed

+196
-205
lines changed

e2e/infrastructure/transaction/CreateTransactionFromDTO.spec.ts

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ describe('CreateTransactionFromDTO', () => {
3939
// tslint:disable-next-line:max-line-length
4040
signature: '7442156D839A3AC900BC0299E8701ECDABA674DCF91283223450953B005DE72C538EA54236F5E089530074CE78067CD3325CF53750B9118154C08B20A5CDC00D',
4141
signer: '2FC3872A792933617D70E02AFF8FBDE152821A0DF0CA5FB04CB56FC3D21C8863',
42-
version: 36867,
42+
version: 36865,
4343
type: 16724,
4444
maxFee: [0, 0],
4545
deadline: [3362498678, 22],
@@ -78,7 +78,7 @@ describe('CreateTransactionFromDTO', () => {
7878
// tslint:disable-next-line:max-line-length
7979
signature: '7442156D839A3AC900BC0299E8701ECDABA674DCF91283223450953B005DE72C538EA54236F5E089530074CE78067CD3325CF53750B9118154C08B20A5CDC00D',
8080
signer: '2FC3872A792933617D70E02AFF8FBDE152821A0DF0CA5FB04CB56FC3D21C8863',
81-
version: 36867,
81+
version: 36865,
8282
type: 16724,
8383
maxFee: [0, 0],
8484
deadline: [3362498678, 22],
@@ -160,12 +160,12 @@ describe('CreateTransactionFromDTO', () => {
160160
recipient: '9050B9837EFAB4BBE8A4B9BB32D812F9885C00D8FC1650E142',
161161
signer: 'B4F12E7C9F6946091E2CB8B6D3A12B50D17CCBBF646386EA27CE2946A7423DCF',
162162
type: 16724,
163-
version: 36867,
163+
version: 36865,
164164
},
165165
},
166166
],
167167
type: 16705,
168-
version: 36866,
168+
version: 36865,
169169
},
170170
};
171171

@@ -212,7 +212,7 @@ describe('CreateTransactionFromDTO', () => {
212212
'2F6EE63025FEEBCED3293B622AF8581334D0BDAB7541A9E7411E7EE4EF0BC5D0E',
213213
signer: 'B4F12E7C9F6946091E2CB8B6D3A12B50D17CCBBF646386EA27CE2946A7423DCF',
214214
type: 16718,
215-
version: 36867,
215+
version: 36865,
216216
},
217217
};
218218

@@ -277,12 +277,12 @@ describe('CreateTransactionFromDTO', () => {
277277
namespaceType: 0,
278278
signer: 'B4F12E7C9F6946091E2CB8B6D3A12B50D17CCBBF646386EA27CE2946A7423DCF',
279279
type: 16718,
280-
version: 36867,
280+
version: 36865,
281281
},
282282
},
283283
],
284284
type: 16705,
285-
version: 36867,
285+
version: 36865,
286286
},
287287
};
288288

@@ -331,7 +331,7 @@ describe('CreateTransactionFromDTO', () => {
331331
'E02F6EE63025FEEBCED3293B622AF8581334D0BDAB7541A9E7411E7EE4EF0BC5D0E',
332332
signer: 'B4F12E7C9F6946091E2CB8B6D3A12B50D17CCBBF646386EA27CE2946A7423DCF',
333333
type: 16718,
334-
version: 36867,
334+
version: 36865,
335335
},
336336
};
337337
const transferTransaction = CreateTransactionFromDTO(registerNamespaceTransactionDTO);
@@ -395,12 +395,12 @@ describe('CreateTransactionFromDTO', () => {
395395
],
396396
signer: 'B4F12E7C9F6946091E2CB8B6D3A12B50D17CCBBF646386EA27CE2946A7423DCF',
397397
type: 16718,
398-
version: 36867,
398+
version: 36865,
399399
},
400400
},
401401
],
402402
type: 16705,
403-
version: 36867,
403+
version: 36865,
404404
},
405405
};
406406

@@ -470,7 +470,7 @@ describe('CreateTransactionFromDTO', () => {
470470
'EBCED3293B622AF8581334D0BDAB7541A9E7411E7EE4EF0BC5D0E',
471471
signer: 'B4F12E7C9F6946091E2CB8B6D3A12B50D17CCBBF646386EA27CE2946A7423DCF',
472472
type: 16717,
473-
version: 36867,
473+
version: 36865,
474474
},
475475
};
476476

@@ -556,12 +556,12 @@ describe('CreateTransactionFromDTO', () => {
556556
],
557557
signer: 'B4F12E7C9F6946091E2CB8B6D3A12B50D17CCBBF646386EA27CE2946A7423DCF',
558558
type: 16717,
559-
version: 36867,
559+
version: 36865,
560560
},
561561
},
562562
],
563563
type: 16705,
564-
version: 36867,
564+
version: 36865,
565565
},
566566
};
567567

@@ -608,7 +608,7 @@ describe('CreateTransactionFromDTO', () => {
608608
'2F6EE63025FEEBCED3293B622AF8581334D0BDAB7541A9E7411E7EE4EF0BC5D0E',
609609
signer: 'B4F12E7C9F6946091E2CB8B6D3A12B50D17CCBBF646386EA27CE2946A7423DCF',
610610
type: 16973,
611-
version: 36867,
611+
version: 36865,
612612
},
613613
};
614614

@@ -672,12 +672,12 @@ describe('CreateTransactionFromDTO', () => {
672672
],
673673
signer: 'B4F12E7C9F6946091E2CB8B6D3A12B50D17CCBBF646386EA27CE2946A7423DCF',
674674
type: 16973,
675-
version: 36867,
675+
version: 36865,
676676
},
677677
},
678678
],
679679
type: 16705,
680-
version: 36867,
680+
version: 36865,
681681
},
682682
};
683683

@@ -723,7 +723,7 @@ describe('CreateTransactionFromDTO', () => {
723723
'2F6EE63025FEEBCED3293B622AF8581334D0BDAB7541A9E7411E7EE4EF0BC5D0E',
724724
signer: 'B4F12E7C9F6946091E2CB8B6D3A12B50D17CCBBF646386EA27CE2946A7423DCF',
725725
type: 16725,
726-
version: 36867,
726+
version: 36865,
727727
},
728728
};
729729

@@ -788,12 +788,12 @@ describe('CreateTransactionFromDTO', () => {
788788
],
789789
signer: 'B4F12E7C9F6946091E2CB8B6D3A12B50D17CCBBF646386EA27CE2946A7423DCF',
790790
type: 16725,
791-
version: 36867,
791+
version: 36865,
792792
},
793793
},
794794
],
795795
type: 16705,
796-
version: 36867,
796+
version: 36865,
797797
},
798798
};
799799

src/infrastructure/builders/AccountLinkTransaction.ts

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,12 @@
1818
* @module transactions/AccountLinkTransaction
1919
*/
2020
import { Convert as convert } from '../../core/format';
21+
import { TransactionType } from '../../model/transaction/TransactionType';
2122
import AccountLinkTransactionBufferPackage from '../buffers/AccountLinkTransactionBuffer';
2223
import AccountLinkTransactionSchema from '../schemas/AccountLinkTransactionSchema';
23-
import {
24-
VerifiableTransaction,
25-
} from './VerifiableTransaction';
24+
import {VerifiableTransaction} from './VerifiableTransaction';
2625

27-
const {
28-
flatbuffers,
29-
} = require('flatbuffers');
26+
import {flatbuffers} from 'flatbuffers';
3027

3128
const {
3229
AccountLinkTransactionBuffer,
@@ -40,20 +37,19 @@ export class AccountLinkTransaction extends VerifiableTransaction {
4037

4138
// tslint:disable-next-line:max-classes-per-file
4239
export class Builder {
43-
fee: any;
40+
maxFee: any;
4441
version: any;
4542
type: any;
4643
deadline: any;
4744
remoteAccountKey: any;
4845
linkAction: any;
4946
constructor() {
50-
this.fee = [0, 0];
51-
this.version = 36867;
52-
this.type = 0x414C;
47+
this.maxFee = [0, 0];
48+
this.type = TransactionType.LINK_ACCOUNT;
5349
}
5450

55-
addFee(fee) {
56-
this.fee = fee;
51+
addFee(maxFee) {
52+
this.maxFee = maxFee;
5753
return this;
5854
}
5955

@@ -89,7 +85,7 @@ export class Builder {
8985
.createSignatureVector(builder, Array(...Array(64)).map(Number.prototype.valueOf, 0));
9086
const signerVector = AccountLinkTransactionBuffer.createSignerVector(builder, Array(...Array(32)).map(Number.prototype.valueOf, 0));
9187
const deadlineVector = AccountLinkTransactionBuffer.createDeadlineVector(builder, this.deadline);
92-
const feeVector = AccountLinkTransactionBuffer.createFeeVector(builder, this.fee);
88+
const feeVector = AccountLinkTransactionBuffer.createFeeVector(builder, this.maxFee);
9389
const remoteAccountKeyVector = AccountLinkTransactionBuffer.createRemoteAccountKeyVector(builder, this.remoteAccountKey);
9490

9591
AccountLinkTransactionBuffer.startAccountLinkTransactionBuffer(builder);

src/infrastructure/builders/AccountPropertiesAddressTransaction.ts

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
* @module transactions/AccountPropertiesAddressTransaction
1919
*/
2020
import { RawAddress as address } from '../../core/format';
21+
import { TransactionType } from '../../model/transaction/TransactionType';
2122
import AccountPropertiesAddressTransactionBufferPackage from '../buffers/AccountPropertiesAddressTransactionBuffer';
2223
import AccountPropertiesAddressModificationTransactionSchema from '../schemas/AccountPropertiesAddressModificationTransactionSchema';
2324
import { VerifiableTransaction } from './VerifiableTransaction';
@@ -26,9 +27,7 @@ const {
2627
PropertyAddressModificationBuffer,
2728
} = AccountPropertiesAddressTransactionBufferPackage.Buffers;
2829

29-
const {
30-
flatbuffers
31-
} = require('flatbuffers');
30+
import {flatbuffers} from 'flatbuffers';
3231

3332
export default class AccountPropertiesAddressTransaction extends VerifiableTransaction {
3433
constructor(bytes) {
@@ -38,20 +37,19 @@ export default class AccountPropertiesAddressTransaction extends VerifiableTrans
3837

3938
// tslint:disable-next-line:max-classes-per-file
4039
export class Builder {
41-
fee: any;
40+
maxFee: any;
4241
version: any;
4342
type: any;
4443
deadline: any;
4544
propertyType: any;
4645
modifications: any;
4746
constructor() {
48-
this.fee = [0, 0];
49-
this.version = 36865;
50-
this.type = 0x4150;
47+
this.maxFee = [0, 0];
48+
this.type = TransactionType.MODIFY_ACCOUNT_PROPERTY_ADDRESS;
5149
}
5250

53-
addFee(fee) {
54-
this.fee = fee;
51+
addFee(maxFee) {
52+
this.maxFee = maxFee;
5553
return this;
5654
}
5755

@@ -85,7 +83,7 @@ export class Builder {
8583

8684
// Create modifications
8785
const modificationsArray: any = [];
88-
this.modifications.forEach(modification => {
86+
this.modifications.forEach((modification) => {
8987
const addressModificationVector = PropertyAddressModificationBuffer
9088
.createValueVector(builder, address.stringToAddress(modification.value));
9189
PropertyAddressModificationBuffer.startPropertyAddressModificationBuffer(builder);
@@ -102,7 +100,7 @@ export class Builder {
102100
const deadlineVector = AccountPropertiesAddressTransactionBuffer
103101
.createDeadlineVector(builder, this.deadline);
104102
const feeVector = AccountPropertiesAddressTransactionBuffer
105-
.createFeeVector(builder, this.fee);
103+
.createFeeVector(builder, this.maxFee);
106104
const modificationVector = AccountPropertiesAddressTransactionBuffer
107105
.createModificationsVector(builder, modificationsArray);
108106

src/infrastructure/builders/AccountPropertiesEntityTypeTransaction.ts

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
/**
1818
* @module transactions/AccountPropertiesEntityTypeTransaction
1919
*/
20+
import { TransactionType } from '../../model/transaction/TransactionType';
2021
import AccountPropertiesEntityTypeTransactionBufferPackage from '../buffers/AccountPropertiesEntityTypeTransactionBuffer';
2122
import AccountPropertiesEntityTypeModificationTransactionSchema from '../schemas/AccountPropertiesEntityTypeModificationTransactionSchema';
2223
import { VerifiableTransaction } from './VerifiableTransaction';
@@ -26,9 +27,7 @@ const {
2627
PropertyEntityTypeModificationBuffer,
2728
} = AccountPropertiesEntityTypeTransactionBufferPackage.Buffers;
2829

29-
const {
30-
flatbuffers
31-
} = require('flatbuffers');
30+
import {flatbuffers} from 'flatbuffers';
3231

3332
export default class AccountPropertiesEntityTypeTransaction extends VerifiableTransaction {
3433
constructor(bytes) {
@@ -38,20 +37,19 @@ export default class AccountPropertiesEntityTypeTransaction extends VerifiableTr
3837

3938
// tslint:disable-next-line:max-classes-per-file
4039
export class Builder {
41-
fee: any;
40+
maxFee: any;
4241
version: any;
4342
type: any;
4443
deadline: any;
4544
propertyType: any;
4645
modifications: any;
4746
constructor() {
48-
this.fee = [0, 0];
49-
this.version = 36865;
50-
this.type = 0x4350;
47+
this.maxFee = [0, 0];
48+
this.type = TransactionType.MODIFY_ACCOUNT_PROPERTY_ENTITY_TYPE;
5149
}
5250

53-
addFee(fee) {
54-
this.fee = fee;
51+
addFee(maxFee) {
52+
this.maxFee = maxFee;
5553
return this;
5654
}
5755

@@ -85,7 +83,7 @@ export class Builder {
8583

8684
// Create modifications
8785
const modificationsArray: any = [];
88-
this.modifications.forEach(modification => {
86+
this.modifications.forEach((modification) => {
8987
PropertyEntityTypeModificationBuffer.startPropertyEntityTypeModificationBuffer(builder);
9088
PropertyEntityTypeModificationBuffer.addModificationType(builder, modification.type);
9189
PropertyEntityTypeModificationBuffer.addValue(builder, modification.value);
@@ -100,7 +98,7 @@ export class Builder {
10098
const deadlineVector = AccountPropertiesEntityTypeTransactionBuffer
10199
.createDeadlineVector(builder, this.deadline);
102100
const feeVector = AccountPropertiesEntityTypeTransactionBuffer
103-
.createFeeVector(builder, this.fee);
101+
.createFeeVector(builder, this.maxFee);
104102
const modificationVector = AccountPropertiesEntityTypeTransactionBuffer
105103
.createModificationsVector(builder, modificationsArray);
106104

src/infrastructure/builders/AccountPropertiesMosaicTransaction.ts

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
/**
1818
* @module transactions/AccountPropertiesMosaicTransaction
1919
*/
20+
import { TransactionType } from '../../model/transaction/TransactionType';
2021
import AccountPropertiesMosaicTransactionBufferPackage from '../buffers/AccountPropertiesMosaicTransactionBuffer';
2122
import AccountPropertiesMosaicModificationTransactionSchema from '../schemas/AccountPropertiesMosaicModificationTransactionSchema';
2223
import { VerifiableTransaction } from './VerifiableTransaction';
@@ -26,9 +27,7 @@ const {
2627
PropertyMosaicModificationBuffer,
2728
} = AccountPropertiesMosaicTransactionBufferPackage.Buffers;
2829

29-
const {
30-
flatbuffers,
31-
} = require('flatbuffers');
30+
import {flatbuffers} from 'flatbuffers';
3231

3332
export default class AccountPropertiesMosaicTransaction extends VerifiableTransaction {
3433
constructor(bytes) {
@@ -38,20 +37,19 @@ export default class AccountPropertiesMosaicTransaction extends VerifiableTransa
3837

3938
// tslint:disable-next-line:max-classes-per-file
4039
export class Builder {
41-
fee: any;
40+
maxFee: any;
4241
version: any;
4342
type: any;
4443
deadline: any;
4544
propertyType: any;
4645
modifications: any;
4746
constructor() {
48-
this.fee = [0, 0];
49-
this.version = 36865;
50-
this.type = 0x4250;
47+
this.maxFee = [0, 0];
48+
this.type = TransactionType.MODIFY_ACCOUNT_PROPERTY_MOSAIC;
5149
}
5250

53-
addFee(fee) {
54-
this.fee = fee;
51+
addFee(maxFee) {
52+
this.maxFee = maxFee;
5553
return this;
5654
}
5755

@@ -85,7 +83,7 @@ export class Builder {
8583

8684
// Create modifications
8785
const modificationsArray: any = [];
88-
this.modifications.forEach(modification => {
86+
this.modifications.forEach((modification) => {
8987
const addressModificationVector = PropertyMosaicModificationBuffer
9088
.createValueVector(builder, modification.value);
9189
PropertyMosaicModificationBuffer.startPropertyMosaicModificationBuffer(builder);
@@ -102,7 +100,7 @@ export class Builder {
102100
const deadlineVector = AccountPropertiesMosaicTransactionBuffer
103101
.createDeadlineVector(builder, this.deadline);
104102
const feeVector = AccountPropertiesMosaicTransactionBuffer
105-
.createFeeVector(builder, this.fee);
103+
.createFeeVector(builder, this.maxFee);
106104
const modificationVector = AccountPropertiesMosaicTransactionBuffer
107105
.createModificationsVector(builder, modificationsArray);
108106

0 commit comments

Comments
 (0)