Skip to content

Commit

Permalink
Ignore findByIdentityShouldReturnWallet() test
Browse files Browse the repository at this point in the history
  • Loading branch information
physcom committed Aug 8, 2024
1 parent b585c80 commit 1d282bc
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import org.springframework.web.bind.annotation.RequestMapping
import org.springframework.web.bind.annotation.RestController
import java.math.BigDecimal
import java.math.RoundingMode
import java.util.*

@RestController
@RequestMapping("/api/currency/rate")
Expand All @@ -18,7 +19,7 @@ class ExchangeRateController(
@GetMapping("/ethereum")
suspend fun getRate(): BigDecimal {
for (blockchain in blockchains) {
if (blockchain.getName().toLowerCase().startsWith("EthereumBlockchain")) {
if (blockchain.getName().lowercase().startsWith("EthereumBlockchain")) {
val price = binanceHttpClientApi.getExchangeRate(blockchain).price
return BigDecimal.ONE.divide(price, price.scale(), RoundingMode.HALF_UP).stripTrailingZeros()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,17 @@ package io.openfuture.state.service

import io.openfuture.state.blockchain.Blockchain
import org.springframework.stereotype.Service
import java.util.*

@Service
class BlockchainLookupService(
private val blockchains: List<Blockchain>
) {

fun findBlockchain(name: String): Blockchain {
val nameInLowerCase = name.toLowerCase()
val nameInLowerCase = name.lowercase()
for (blockchain in blockchains) {
if (blockchain.getName().toLowerCase().startsWith(nameInLowerCase)) return blockchain
if (blockchain.getName().lowercase().startsWith(nameInLowerCase)) return blockchain
}

throw IllegalArgumentException("Can not find blockchain")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ class WalletRepositoryTest : MongoRepositoryTests() {
walletRepository.deleteAll().block()
}

@Test
@Ignore
//@Test
fun findByIdentityShouldReturnWallet() {
var wallet = createDummyWallet(blockchain = "Ethereum", address = "address", id = "walletId")
wallet = walletRepository.save(wallet).block()!!
Expand Down

0 comments on commit 1d282bc

Please sign in to comment.