-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: serialize API3 reports and send to the blockchain
- Loading branch information
Mateusz Czeladka
committed
Jan 17, 2025
1 parent
a34074b
commit 5643664
Showing
22 changed files
with
907 additions
and
289 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
...n/java/org/cardanofoundation/lob/app/blockchain_common/config/BlockchainCommonConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package org.cardanofoundation.lob.app.blockchain_common.config; | ||
|
||
import com.fasterxml.jackson.databind.ObjectMapper; | ||
import lombok.val; | ||
import org.cardanofoundation.lob.app.blockchain_common.service_assistance.JsonSchemaMetadataChecker; | ||
import org.cardanofoundation.lob.app.blockchain_common.service_assistance.MetadataChecker; | ||
import org.springframework.beans.factory.annotation.Qualifier; | ||
import org.springframework.beans.factory.annotation.Value; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.core.io.Resource; | ||
|
||
@Configuration | ||
public class BlockchainCommonConfig { | ||
|
||
@Value("${lob.l1.transaction.metadata.validation.enable:true}") | ||
private boolean enableChecker; | ||
|
||
@Bean | ||
@Qualifier("api1JsonSchemaMetadataChecker") | ||
public MetadataChecker api1JsonSchemaMetadataChecker(ObjectMapper objectMapper, | ||
@Value("classpath:api1_lob_blockchain_transaction_metadata_schema.json") Resource metadataSchemaResource | ||
) { | ||
val checker = new JsonSchemaMetadataChecker(objectMapper); | ||
checker.setMetadataSchemaResource(metadataSchemaResource); | ||
checker.setEnableChecker(enableChecker); | ||
|
||
return checker; | ||
} | ||
|
||
@Bean | ||
@Qualifier("api3JsonSchemaMetadataChecker") | ||
public MetadataChecker api3JsonSchemaMetadataChecker(ObjectMapper objectMapper, | ||
@Value("classpath:api3_lob_blockchain_transaction_metadata_schema.json") Resource metadataSchemaResource | ||
) { | ||
val checker = new JsonSchemaMetadataChecker(objectMapper); | ||
checker.setMetadataSchemaResource(metadataSchemaResource); | ||
checker.setEnableChecker(enableChecker); | ||
|
||
return checker; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.