Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions e2e/infrastructure/BlockHttp.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ describe('BlockHttp', () => {
expect(blockInfo.timestamp.lower).to.be.equal(0);
expect(blockInfo.timestamp.higher).to.be.equal(0);
expect(blockInfo.beneficiaryPublicKey).not.to.be.undefined;
expect(blockInfo.numStatements).not.to.be.undefined;
});
});

Expand Down
1 change: 1 addition & 0 deletions src/infrastructure/BlockHttp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ export class BlockHttp extends Http implements BlockRepository {
dto.block.receiptsHash,
dto.block.stateHash,
dto.block.beneficiaryPublicKey ? PublicAccount.createFromPublicKey(dto.block.beneficiaryPublicKey, networkType) : undefined,
dto.meta.numStatements,
);
}

Expand Down
7 changes: 6 additions & 1 deletion src/model/blockchain/BlockInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ export class BlockInfo {
* @param blockReceiptsHash
* @param blockStateHash
* @param beneficiaryPublicKey
* @param numStatements
*/
constructor(/**
* The block hash.
Expand Down Expand Up @@ -117,7 +118,11 @@ export class BlockInfo {
/**
* The beneficiary public key.
*/
public readonly beneficiaryPublicKey?: PublicAccount | undefined) {
public readonly beneficiaryPublicKey?: PublicAccount | undefined,
/**
* The number of statements included.
*/
public readonly numStatements?: number) {

}
}
3 changes: 3 additions & 0 deletions test/model/blockchain/BlockInfo.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ describe('BlockInfo', () => {
generationHash: '57F7DA205008026C776CB6AED843393F04CD458E0AA2D9F1D5F31A402072B2D6',
hash: '24E92B511B54EDB48A4850F9B42485FDD1A30589D92C775632DDDD71D7D1D691',
numTransactions: 25,
numStatements: 1,
totalFee: new UInt64([ 0, 0 ]),
},
};
Expand All @@ -68,6 +69,7 @@ describe('BlockInfo', () => {
blockDTO.block.blockReceiptsHash,
blockDTO.block.stateHash,
PublicAccount.createFromPublicKey(blockDTO.block.beneficiaryPublicKey, blockDTO.block.network),
blockDTO.meta.numStatements,
);

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

});
});