Skip to content

Commit

Permalink
fix: RA-43 fix getType for mapper, fix h2 start (#95)
Browse files Browse the repository at this point in the history
  • Loading branch information
shleger authored Mar 21, 2024
1 parent 77e1033 commit 4c8cc3d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .env.h2
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#Use envfile plugin for IDEA
#https://plugins.jetbrains.com/plugin/7861-envfile

API_SPRING_PROFILES_ACTIVE=devh2
API_SPRING_PROFILES_ACTIVE=h2

NETWORK=devkit # devkit, mainnet, testnet, preprod
PROTOCOL_MAGIC=42
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import java.util.ArrayList;
import java.util.List;
import java.util.Optional;

import lombok.AllArgsConstructor;

Expand Down Expand Up @@ -34,8 +35,9 @@ public class BlockToBlockResponse {
*/
public BlockResponse toDto(Block model) {

return modelMapper
.createTypeMap(Block.class, BlockResponse.class)
return Optional
.ofNullable(modelMapper.getTypeMap(Block.class, BlockResponse.class))
.orElseGet(() -> modelMapper.createTypeMap(Block.class, BlockResponse.class))
.addMappings(mapper -> {
mapper.<String>map(Block::getHash, (dest, v) -> currentId(dest).setHash(v));
mapper.<Long>map(Block::getNumber, (dest, v) -> currentId(dest).setIndex(v));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ spring:
driver-class-name: org.h2.Driver
username: ${DB_ADMIN_USER_NAME:rosetta_db_admin}
password: ${DB_ADMIN_USER_SECRET:weakpwd#123_d}
url: jdbc:h2:tcp://localhost:9090/mem:rosetta-java-preprod
url: jdbc:h2:tcp://localhost:9090/mem:${DB_NAME:rosetta-java-preprod}
jpa:
properties:
hibernate:
Expand Down

0 comments on commit 4c8cc3d

Please sign in to comment.