Skip to content

Commit b233871

Browse files
committed
Re-applied latest OpenAPI generated code (v.0.7.18)
1 parent 3a75c1e commit b233871

File tree

220 files changed

+10797
-1335
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

220 files changed

+10797
-1335
lines changed

e2e/infrastructure/BlockHttp.spec.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,7 @@ describe('BlockHttp', () => {
145145
it('should return Merkle Receipts', (done) => {
146146
blockHttp.getMerkleReceipts(chainHeight, blockReceiptHash)
147147
.subscribe((merkleReceipts) => {
148-
expect(merkleReceipts.type).not.to.be.null;
149-
expect(merkleReceipts.payload).not.to.be.null;
148+
expect(merkleReceipts.merklePath).not.to.be.null;
150149
done();
151150
});
152151
});
@@ -155,8 +154,7 @@ describe('BlockHttp', () => {
155154
it('should return Merkle Transaction', (done) => {
156155
blockHttp.getMerkleTransaction(chainHeight, blockTransactionHash)
157156
.subscribe((merkleTransactionss) => {
158-
expect(merkleTransactionss.type).not.to.be.null;
159-
expect(merkleTransactionss.payload).not.to.be.null;
157+
expect(merkleTransactionss.merklePath).not.to.be.null;
160158
done();
161159
});
162160
});

e2e/infrastructure/ChainHttp.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ describe('ChainHttp', () => {
4343

4444
describe('getBlockchainScore', () => {
4545
it('should return blockchain score', (done) => {
46-
chainHttp.getBlockchainScore()
46+
chainHttp.getChainScore()
4747
.subscribe((blockchainScore) => {
4848
expect(blockchainScore.scoreLow).to.not.be.equal(undefined);
4949
expect(blockchainScore.scoreHigh.lower).to.be.equal(0);

src/infrastructure/AccountHttp.ts

Lines changed: 32 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import { DtoMapping } from '../core/utils/DtoMapping';
2121
import {AccountInfo} from '../model/account/AccountInfo';
2222
import { AccountNames } from '../model/account/AccountNames';
2323
import { AccountRestrictionsInfo } from '../model/account/AccountRestrictionsInfo';
24+
import { ActivityBucket } from '../model/account/ActivityBucket';
2425
import {Address} from '../model/account/Address';
2526
import {MultisigAccountGraphInfo} from '../model/account/MultisigAccountGraphInfo';
2627
import {MultisigAccountInfo} from '../model/account/MultisigAccountInfo';
@@ -79,11 +80,20 @@ export class AccountHttp extends Http implements AccountRepository {
7980
map((response: { response: ClientResponse; body: AccountInfoDTO; }) => {
8081
const accountInfoDTO = response.body;
8182
return new AccountInfo(
82-
accountInfoDTO.meta,
8383
Address.createFromEncoded(accountInfoDTO.account.address),
8484
new UInt64(accountInfoDTO.account.addressHeight),
8585
accountInfoDTO.account.publicKey,
8686
new UInt64(accountInfoDTO.account.publicKeyHeight),
87+
accountInfoDTO.account.accountType.valueOf(),
88+
accountInfoDTO.account.linkedAccountKey,
89+
accountInfoDTO.account.activityBuckets.map((bucket) => {
90+
return new ActivityBucket(
91+
bucket.startHeight,
92+
bucket.totalFeesPaid,
93+
bucket.beneficiaryCount,
94+
bucket.rawScore,
95+
);
96+
}),
8797
accountInfoDTO.account.mosaics.map((mosaicDTO) => new Mosaic(
8898
new MosaicId(mosaicDTO.id),
8999
new UInt64(mosaicDTO.amount),
@@ -147,16 +157,28 @@ export class AccountHttp extends Http implements AccountRepository {
147157
const accountsInfoMetaDataDTO = response.body;
148158
return accountsInfoMetaDataDTO.map((accountInfoDTO: AccountInfoDTO) => {
149159
return new AccountInfo(
150-
accountInfoDTO.meta,
151160
Address.createFromEncoded(accountInfoDTO.account.address),
152161
new UInt64(accountInfoDTO.account.addressHeight),
153162
accountInfoDTO.account.publicKey,
154163
new UInt64(accountInfoDTO.account.publicKeyHeight),
155-
accountInfoDTO.account.mosaics.map((mosaicDTO: MosaicDTO) =>
156-
new Mosaic(new MosaicId(mosaicDTO.id), new UInt64(mosaicDTO.amount))),
164+
accountInfoDTO.account.accountType.valueOf(),
165+
accountInfoDTO.account.linkedAccountKey,
166+
accountInfoDTO.account.activityBuckets.map((bucket) => {
167+
return new ActivityBucket(
168+
bucket.startHeight,
169+
bucket.totalFeesPaid,
170+
bucket.beneficiaryCount,
171+
bucket.rawScore,
172+
);
173+
}),
174+
accountInfoDTO.account.mosaics.map((mosaicDTO) => new Mosaic(
175+
new MosaicId(mosaicDTO.id),
176+
new UInt64(mosaicDTO.amount),
177+
)),
157178
new UInt64(accountInfoDTO.account.importance),
158179
new UInt64(accountInfoDTO.account.importanceHeight),
159180
);
181+
160182
});
161183
}),
162184
catchError((error) => throwError(error)),
@@ -195,12 +217,12 @@ export class AccountHttp extends Http implements AccountRepository {
195217
.pipe(map((response: { response: ClientResponse; body: MultisigAccountInfoDTO; }) => {
196218
const multisigAccountInfoDTO = response.body;
197219
return new MultisigAccountInfo(
198-
PublicAccount.createFromPublicKey(multisigAccountInfoDTO.multisig.account, networkType),
220+
PublicAccount.createFromPublicKey(multisigAccountInfoDTO.multisig.accountPublicKey, networkType),
199221
multisigAccountInfoDTO.multisig.minApproval,
200222
multisigAccountInfoDTO.multisig.minRemoval,
201-
multisigAccountInfoDTO.multisig.cosignatories
223+
multisigAccountInfoDTO.multisig.cosignatoryPublicKeys
202224
.map((cosigner) => PublicAccount.createFromPublicKey(cosigner, networkType)),
203-
multisigAccountInfoDTO.multisig.multisigAccounts
225+
multisigAccountInfoDTO.multisig.multisigPublicKeys
204226
.map((multisigAccount) => PublicAccount.createFromPublicKey(multisigAccount, networkType)),
205227
);
206228
}),
@@ -224,12 +246,12 @@ export class AccountHttp extends Http implements AccountRepository {
224246
multisigAccounts.set(multisigAccountGraphInfoDTO.level,
225247
multisigAccountGraphInfoDTO.multisigEntries.map((multisigAccountInfoDTO) => {
226248
return new MultisigAccountInfo(
227-
PublicAccount.createFromPublicKey(multisigAccountInfoDTO.multisig.account, networkType),
249+
PublicAccount.createFromPublicKey(multisigAccountInfoDTO.multisig.accountPublicKey, networkType),
228250
multisigAccountInfoDTO.multisig.minApproval,
229251
multisigAccountInfoDTO.multisig.minRemoval,
230-
multisigAccountInfoDTO.multisig.cosignatories
252+
multisigAccountInfoDTO.multisig.cosignatoryPublicKeys
231253
.map((cosigner) => PublicAccount.createFromPublicKey(cosigner, networkType)),
232-
multisigAccountInfoDTO.multisig.multisigAccounts
254+
multisigAccountInfoDTO.multisig.multisigPublicKeys
233255
.map((multisigAccountDTO) =>
234256
PublicAccount.createFromPublicKey(multisigAccountDTO, networkType)));
235257
}),

src/infrastructure/BlockHttp.ts

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ import {PublicAccount} from '../model/account/PublicAccount';
2121
import {BlockInfo} from '../model/blockchain/BlockInfo';
2222
import { MerklePathItem } from '../model/blockchain/MerklePathItem';
2323
import { MerkleProofInfo } from '../model/blockchain/MerkleProofInfo';
24-
import { MerkleProofInfoPayload } from '../model/blockchain/MerkleProofInfoPayload';
2524
import { Statement } from '../model/receipt/Statement';
2625
import {Transaction} from '../model/transaction/Transaction';
2726
import {UInt64} from '../model/UInt64';
@@ -90,7 +89,7 @@ export class BlockHttp extends Http implements BlockRepository {
9089
new UInt64(blockDTO.meta.totalFee),
9190
blockDTO.meta.numTransactions,
9291
blockDTO.block.signature,
93-
PublicAccount.createFromPublicKey(blockDTO.block.signer, networkType),
92+
PublicAccount.createFromPublicKey(blockDTO.block.signerPublicKey, networkType),
9493
networkType,
9594
parseInt((blockDTO.block.version as number).toString(16).substr(2, 2), 16), // Tx version
9695
blockDTO.block.type,
@@ -99,8 +98,8 @@ export class BlockHttp extends Http implements BlockRepository {
9998
new UInt64(blockDTO.block.difficulty),
10099
blockDTO.block.feeMultiplier,
101100
blockDTO.block.previousBlockHash,
102-
blockDTO.block.blockTransactionsHash,
103-
blockDTO.block.blockReceiptsHash,
101+
blockDTO.block.transactionsHash,
102+
blockDTO.block.receiptsHash,
104103
blockDTO.block.stateHash,
105104
extractBeneficiary(blockDTO, networkType),
106105
);
@@ -151,7 +150,7 @@ export class BlockHttp extends Http implements BlockRepository {
151150
new UInt64(blockDTO.meta.totalFee),
152151
blockDTO.meta.numTransactions,
153152
blockDTO.block.signature,
154-
PublicAccount.createFromPublicKey(blockDTO.block.signer, networkType),
153+
PublicAccount.createFromPublicKey(blockDTO.block.signerPublicKey, networkType),
155154
networkType,
156155
parseInt((blockDTO.block.version as number).toString(16).substr(2, 2), 16), // Tx version
157156
blockDTO.block.type,
@@ -160,8 +159,8 @@ export class BlockHttp extends Http implements BlockRepository {
160159
new UInt64(blockDTO.block.difficulty),
161160
blockDTO.block.feeMultiplier,
162161
blockDTO.block.previousBlockHash,
163-
blockDTO.block.blockTransactionsHash,
164-
blockDTO.block.blockReceiptsHash,
162+
blockDTO.block.transactionsHash,
163+
blockDTO.block.receiptsHash,
165164
blockDTO.block.stateHash,
166165
extractBeneficiary(blockDTO, networkType),
167166
);
@@ -187,10 +186,8 @@ export class BlockHttp extends Http implements BlockRepository {
187186
map((response: { response: ClientResponse; body: MerkleProofInfoDTO; } ) => {
188187
const merkleProofReceipt = response.body;
189188
return new MerkleProofInfo(
190-
new MerkleProofInfoPayload(
191-
merkleProofReceipt.payload.merklePath!.map(
192-
(payload) => new MerklePathItem(payload.position, payload.hash))),
193-
merkleProofReceipt.type,
189+
merkleProofReceipt.merklePath!.map(
190+
(payload) => new MerklePathItem(payload.position, payload.hash)),
194191
);
195192
}),
196193
catchError((error) => throwError(this.errorHandling(error))),
@@ -213,10 +210,8 @@ export class BlockHttp extends Http implements BlockRepository {
213210
map((response: { response: ClientResponse; body: MerkleProofInfoDTO; } ) => {
214211
const merkleProofTransaction = response.body;
215212
return new MerkleProofInfo(
216-
new MerkleProofInfoPayload(
217-
merkleProofTransaction.payload.merklePath!.map((payload) =>
218-
new MerklePathItem(payload.position, payload.hash))),
219-
merkleProofTransaction.type,
213+
merkleProofTransaction.merklePath!.map(
214+
(payload) => new MerklePathItem(payload.position, payload.hash)),
220215
);
221216
}),
222217
catchError((error) => throwError(this.errorHandling(error))),

src/infrastructure/ChainHttp.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ import {from as observableFrom, Observable, throwError} from 'rxjs';
1919
import {catchError, map} from 'rxjs/operators';
2020
import {BlockchainScore} from '../model/blockchain/BlockchainScore';
2121
import {UInt64} from '../model/UInt64';
22-
import { BlockchainScoreDTO,
23-
ChainRoutesApi,
22+
import { ChainRoutesApi,
2423
HeightInfoDTO } from './api';
2524
import { ChainRepository } from './ChainRepository';
2625
import {Http} from './Http';
26+
import { ChainScoreDTO } from './model/chainScoreDTO';
2727

2828
/**
2929
* Chian http repository.
@@ -64,9 +64,9 @@ export class ChainHttp extends Http implements ChainRepository {
6464
* Gets current blockchain score
6565
* @returns Observable<BlockchainScore>
6666
*/
67-
public getBlockchainScore(): Observable<BlockchainScore> {
68-
return observableFrom(this.chainRoutesApi.getBlockchainScore()).pipe(
69-
map((response: { response: ClientResponse; body: BlockchainScoreDTO; } ) => {
67+
public getChainScore(): Observable<BlockchainScore> {
68+
return observableFrom(this.chainRoutesApi.getChainScore()).pipe(
69+
map((response: { response: ClientResponse; body: ChainScoreDTO; } ) => {
7070
const blockchainScoreDTO = response.body;
7171
return new BlockchainScore(
7272
new UInt64(blockchainScoreDTO.scoreLow),

src/infrastructure/ChainRepository.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,5 @@ export interface ChainRepository {
3434
* Gets current blockchain score
3535
* @returns Observable<BlockchainScore>
3636
*/
37-
getBlockchainScore(): Observable<BlockchainScore>;
37+
getChainScore(): Observable<BlockchainScore>;
3838
}

src/infrastructure/MosaicHttp.ts

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,10 @@ export class MosaicHttp extends Http implements MosaicRepository {
7878
duration = mosaicInfoDTO.mosaic.properties[MosaicPropertyType.Duration].value;
7979
}
8080
return new MosaicInfo(
81-
mosaicInfoDTO.meta.id,
82-
new MosaicId(mosaicInfoDTO.mosaic.mosaicId),
81+
new MosaicId(mosaicInfoDTO.mosaic.id),
8382
new UInt64(mosaicInfoDTO.mosaic.supply),
84-
new UInt64(mosaicInfoDTO.mosaic.height),
85-
PublicAccount.createFromPublicKey(mosaicInfoDTO.mosaic.owner, networkType),
83+
new UInt64(mosaicInfoDTO.mosaic.startHeight),
84+
PublicAccount.createFromPublicKey(mosaicInfoDTO.mosaic.ownerPublicKey, networkType),
8685
mosaicInfoDTO.mosaic.revision,
8786
new MosaicProperties(
8887
mosaicFlag ? new UInt64(mosaicFlag) : UInt64.fromUint(0),
@@ -124,11 +123,10 @@ export class MosaicHttp extends Http implements MosaicRepository {
124123
duration = mosaicInfoDTO.mosaic.properties[MosaicPropertyType.Duration].value;
125124
}
126125
return new MosaicInfo(
127-
mosaicInfoDTO.meta.id,
128-
new MosaicId(mosaicInfoDTO.mosaic.mosaicId),
126+
new MosaicId(mosaicInfoDTO.mosaic.id),
129127
new UInt64(mosaicInfoDTO.mosaic.supply),
130-
new UInt64(mosaicInfoDTO.mosaic.height),
131-
PublicAccount.createFromPublicKey(mosaicInfoDTO.mosaic.owner, networkType),
128+
new UInt64(mosaicInfoDTO.mosaic.startHeight),
129+
PublicAccount.createFromPublicKey(mosaicInfoDTO.mosaic.ownerPublicKey, networkType),
132130
mosaicInfoDTO.mosaic.revision,
133131
new MosaicProperties(
134132
mosaicFlag ? new UInt64(mosaicFlag) : UInt64.fromUint(0),

0 commit comments

Comments
 (0)