Skip to content

Commit 67e1a50

Browse files
authored
Merge pull request #465 from NEMStudios/task/g464_num_statement
Added numStatements
2 parents b0c5b1a + d87e6b0 commit 67e1a50

File tree

4 files changed

+11
-1
lines changed

4 files changed

+11
-1
lines changed

e2e/infrastructure/BlockHttp.spec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ describe('BlockHttp', () => {
9696
expect(blockInfo.timestamp.lower).to.be.equal(0);
9797
expect(blockInfo.timestamp.higher).to.be.equal(0);
9898
expect(blockInfo.beneficiaryPublicKey).not.to.be.undefined;
99+
expect(blockInfo.numStatements).not.to.be.undefined;
99100
});
100101
});
101102

src/infrastructure/BlockHttp.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ export class BlockHttp extends Http implements BlockRepository {
123123
dto.block.receiptsHash,
124124
dto.block.stateHash,
125125
dto.block.beneficiaryPublicKey ? PublicAccount.createFromPublicKey(dto.block.beneficiaryPublicKey, networkType) : undefined,
126+
dto.meta.numStatements,
126127
);
127128
}
128129

src/model/blockchain/BlockInfo.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ export class BlockInfo {
4242
* @param blockReceiptsHash
4343
* @param blockStateHash
4444
* @param beneficiaryPublicKey
45+
* @param numStatements
4546
*/
4647
constructor(/**
4748
* The block hash.
@@ -117,7 +118,11 @@ export class BlockInfo {
117118
/**
118119
* The beneficiary public key.
119120
*/
120-
public readonly beneficiaryPublicKey?: PublicAccount | undefined) {
121+
public readonly beneficiaryPublicKey?: PublicAccount | undefined,
122+
/**
123+
* The number of statements included.
124+
*/
125+
public readonly numStatements?: number) {
121126

122127
}
123128
}

test/model/blockchain/BlockInfo.spec.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ describe('BlockInfo', () => {
4545
generationHash: '57F7DA205008026C776CB6AED843393F04CD458E0AA2D9F1D5F31A402072B2D6',
4646
hash: '24E92B511B54EDB48A4850F9B42485FDD1A30589D92C775632DDDD71D7D1D691',
4747
numTransactions: 25,
48+
numStatements: 1,
4849
totalFee: new UInt64([ 0, 0 ]),
4950
},
5051
};
@@ -68,6 +69,7 @@ describe('BlockInfo', () => {
6869
blockDTO.block.blockReceiptsHash,
6970
blockDTO.block.stateHash,
7071
PublicAccount.createFromPublicKey(blockDTO.block.beneficiaryPublicKey, blockDTO.block.network),
72+
blockDTO.meta.numStatements,
7173
);
7274

7375
expect(blockInfo.hash).to.be.equal(blockDTO.meta.hash);
@@ -88,6 +90,7 @@ describe('BlockInfo', () => {
8890
expect(blockInfo.blockReceiptsHash).to.be.equal(blockDTO.block.blockReceiptsHash);
8991
expect(blockInfo.stateHash).to.be.equal(blockDTO.block.stateHash);
9092
expect((blockInfo.beneficiaryPublicKey as PublicAccount).publicKey).to.be.equal(blockDTO.block.beneficiaryPublicKey);
93+
expect(blockInfo.numStatements).to.be.equal(blockDTO.meta.numStatements);
9194

9295
});
9396
});

0 commit comments

Comments
 (0)