Skip to content

Commit

Permalink
fix: fixed wrong mapping of block creator (#114)
Browse files Browse the repository at this point in the history
* fix: fixed wrong mapping of block creator

* fix: adjusted test. Slotleader will be mapped to createdBy
  • Loading branch information
Kammerlo authored Apr 9, 2024
1 parent 1f9497e commit 9a0729c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public Block fromEntity(BlockEntity entity) {
.orElseGet(() -> modelMapper.createTypeMap(BlockEntity.class, Block.class))
.addMappings(mapper -> {

mapper.map(BlockEntity::getIssuerVkey, Block::setCreatedBy);
mapper.map(BlockEntity::getSlotLeader, Block::setCreatedBy);
mapper.map(BlockEntity::getNoOfTxs, Block::setTransactionsCount);
mapper.map(BlockEntity::getEpochNumber, Block::setEpochNo);
mapper.map(BlockEntity::getSlot, Block::setSlotNo);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ void fromEntity_Test() {

assertThat(into.getTransactionsCount()).isEqualTo(from.getNoOfTxs());
assertThat(into.getSize()).isEqualTo(Math.toIntExact(from.getBlockBodySize()));
assertThat(into.getCreatedBy()).isEqualTo(from.getIssuerVkey());
assertThat(into.getCreatedBy()).isEqualTo(from.getSlotLeader());
assertThat(into.getEpochNo()).isEqualTo(from.getEpochNumber());
assertThat(into.getSlotNo()).isEqualTo(from.getSlot());

Expand Down

0 comments on commit 9a0729c

Please sign in to comment.