diff --git a/search-api/src/main/kotlin/fund/cyber/api/common/Func.kt b/search-api/src/main/kotlin/fund/cyber/api/common/Func.kt deleted file mode 100644 index 01f96f63..00000000 --- a/search-api/src/main/kotlin/fund/cyber/api/common/Func.kt +++ /dev/null @@ -1,13 +0,0 @@ -package fund.cyber.api.common - -const val HASH_PREFIX = "0x" - -fun String.toSearchHashFormat(): String { - - var formattedHash: String = this - if (startsWith(HASH_PREFIX, true).not()) { - formattedHash = HASH_PREFIX + formattedHash - } - - return formattedHash.toLowerCase() -} diff --git a/search-api/src/main/kotlin/fund/cyber/api/ethereum/ContractHandlers.kt b/search-api/src/main/kotlin/fund/cyber/api/ethereum/ContractHandlers.kt index 4ce6963b..78fb4700 100644 --- a/search-api/src/main/kotlin/fund/cyber/api/ethereum/ContractHandlers.kt +++ b/search-api/src/main/kotlin/fund/cyber/api/ethereum/ContractHandlers.kt @@ -28,6 +28,8 @@ class EthereumContractHandlersConfiguration { @Autowired private lateinit var applicationContext: GenericApplicationContext +//0.722901489983285700 +//0.722901489982963896 @Bean fun ethereumContractById(): RouterFunction { diff --git a/search-api/src/main/kotlin/fund/cyber/api/ethereum/TxHandlers.kt b/search-api/src/main/kotlin/fund/cyber/api/ethereum/TxHandlers.kt index cabc2c9e..6f977e66 100644 --- a/search-api/src/main/kotlin/fund/cyber/api/ethereum/TxHandlers.kt +++ b/search-api/src/main/kotlin/fund/cyber/api/ethereum/TxHandlers.kt @@ -1,10 +1,10 @@ package fund.cyber.api.ethereum import fund.cyber.api.common.asSingleRouterFunction -import fund.cyber.api.common.toSearchHashFormat import fund.cyber.cassandra.configuration.REPOSITORY_NAME_DELIMETER import fund.cyber.cassandra.ethereum.model.CqlEthereumTx import fund.cyber.cassandra.ethereum.repository.EthereumTxRepository +import fund.cyber.common.toSearchHashFormat import org.springframework.beans.factory.annotation.Autowired import org.springframework.context.annotation.Bean import org.springframework.context.annotation.Configuration diff --git a/search-api/src/main/kotlin/fund/cyber/api/ethereum/UncleHandlers.kt b/search-api/src/main/kotlin/fund/cyber/api/ethereum/UncleHandlers.kt index ffdedc2f..35e16068 100644 --- a/search-api/src/main/kotlin/fund/cyber/api/ethereum/UncleHandlers.kt +++ b/search-api/src/main/kotlin/fund/cyber/api/ethereum/UncleHandlers.kt @@ -1,10 +1,10 @@ package fund.cyber.api.ethereum import fund.cyber.api.common.asSingleRouterFunction -import fund.cyber.api.common.toSearchHashFormat import fund.cyber.cassandra.configuration.REPOSITORY_NAME_DELIMETER import fund.cyber.cassandra.ethereum.model.CqlEthereumUncle import fund.cyber.cassandra.ethereum.repository.EthereumUncleRepository +import fund.cyber.common.toSearchHashFormat import org.springframework.beans.factory.annotation.Autowired import org.springframework.context.annotation.Bean import org.springframework.context.annotation.Configuration diff --git a/search-api/src/main/kotlin/fund/cyber/api/ethereum/functions/ContractBlocksByHash.kt b/search-api/src/main/kotlin/fund/cyber/api/ethereum/functions/ContractBlocksByHash.kt index be057649..93c62955 100644 --- a/search-api/src/main/kotlin/fund/cyber/api/ethereum/functions/ContractBlocksByHash.kt +++ b/search-api/src/main/kotlin/fund/cyber/api/ethereum/functions/ContractBlocksByHash.kt @@ -1,8 +1,8 @@ package fund.cyber.api.ethereum.functions -import fund.cyber.api.common.toSearchHashFormat import fund.cyber.cassandra.ethereum.model.CqlEthereumContractMinedBlock import fund.cyber.cassandra.ethereum.repository.PageableEthereumContractMinedBlockRepository +import fund.cyber.common.toSearchHashFormat import org.springframework.data.cassandra.core.query.CassandraPageRequest import org.springframework.web.reactive.function.server.HandlerFunction import org.springframework.web.reactive.function.server.ServerRequest diff --git a/search-api/src/main/kotlin/fund/cyber/api/ethereum/functions/ContractTxesByHash.kt b/search-api/src/main/kotlin/fund/cyber/api/ethereum/functions/ContractTxesByHash.kt index dc901b08..6f1c00a7 100644 --- a/search-api/src/main/kotlin/fund/cyber/api/ethereum/functions/ContractTxesByHash.kt +++ b/search-api/src/main/kotlin/fund/cyber/api/ethereum/functions/ContractTxesByHash.kt @@ -1,8 +1,8 @@ package fund.cyber.api.ethereum.functions -import fund.cyber.api.common.toSearchHashFormat import fund.cyber.cassandra.ethereum.model.CqlEthereumContractTxPreview import fund.cyber.cassandra.ethereum.repository.PageableEthereumContractTxRepository +import fund.cyber.common.toSearchHashFormat import org.springframework.data.cassandra.core.query.CassandraPageRequest import org.springframework.web.reactive.function.server.HandlerFunction import org.springframework.web.reactive.function.server.ServerRequest diff --git a/search-api/src/main/kotlin/fund/cyber/api/ethereum/functions/ContractUnclesByHash.kt b/search-api/src/main/kotlin/fund/cyber/api/ethereum/functions/ContractUnclesByHash.kt index c20ac760..531e75b6 100644 --- a/search-api/src/main/kotlin/fund/cyber/api/ethereum/functions/ContractUnclesByHash.kt +++ b/search-api/src/main/kotlin/fund/cyber/api/ethereum/functions/ContractUnclesByHash.kt @@ -1,8 +1,8 @@ package fund.cyber.api.ethereum.functions -import fund.cyber.api.common.toSearchHashFormat import fund.cyber.cassandra.ethereum.model.CqlEthereumContractMinedUncle import fund.cyber.cassandra.ethereum.repository.PageableEthereumContractMinedUncleRepository +import fund.cyber.common.toSearchHashFormat import org.springframework.data.cassandra.core.query.CassandraPageRequest import org.springframework.web.reactive.function.server.HandlerFunction import org.springframework.web.reactive.function.server.ServerRequest diff --git a/search-api/src/test/kotlin/fund/cyber/api/common/FuncTest.kt b/search-api/src/test/kotlin/fund/cyber/api/common/FuncTest.kt deleted file mode 100644 index 025de0bb..00000000 --- a/search-api/src/test/kotlin/fund/cyber/api/common/FuncTest.kt +++ /dev/null @@ -1,30 +0,0 @@ -package fund.cyber.api.common - -import org.assertj.core.api.Assertions -import org.junit.jupiter.api.Test - -class FuncTest { - - @Test - fun searchHashFormatTest() { - - Assertions.assertThat("0x2429135b30134862b19497ba973546ef2029b170".toSearchHashFormat()) - .isEqualTo("0x2429135b30134862b19497ba973546ef2029b170") - - Assertions.assertThat("2429135b30134862b19497ba973546ef2029b170".toSearchHashFormat()) - .isEqualTo("0x2429135b30134862b19497ba973546ef2029b170") - - Assertions.assertThat("0x2429135B30134862B19497BA973546EF2029B170".toSearchHashFormat()) - .isEqualTo("0x2429135b30134862b19497ba973546ef2029b170") - - Assertions.assertThat("2429135B30134862B19497BA973546EF2029B170".toSearchHashFormat()) - .isEqualTo("0x2429135b30134862b19497ba973546ef2029b170") - - Assertions.assertThat("0X2429135B30134862B19497BA973546EF2029B170".toSearchHashFormat()) - .isEqualTo("0x2429135b30134862b19497ba973546ef2029b170") - - Assertions.assertThat("0X2429135b30134862b19497ba973546ef2029b170".toSearchHashFormat()) - .isEqualTo("0x2429135b30134862b19497ba973546ef2029b170") - } - -}