diff --git a/service/src/main/kotlin/io/provenance/explorer/domain/extensions/FeeExtensions.kt b/service/src/main/kotlin/io/provenance/explorer/domain/extensions/FeeExtensions.kt index 98b689f3..09ba303d 100644 --- a/service/src/main/kotlin/io/provenance/explorer/domain/extensions/FeeExtensions.kt +++ b/service/src/main/kotlin/io/provenance/explorer/domain/extensions/FeeExtensions.kt @@ -45,12 +45,24 @@ fun Abci.TxResponse.getSuccessTotalBaseFee(msgFeeClient: MsgFeeGrpcClient, heigh this.eventsList .firstOrNull { it.type == "tx" && it.attributesList.map { attr -> attr.key.toStringUtf8() }.contains("basefee") } ?.attributesList?.first { it.key.toStringUtf8() == "basefee" } - ?.value?.toStringUtf8()?.denomAmountToPair()?.first?.toBigDecimal() + ?.value?.toStringUtf8()?.denomAmountToPair()?.first?.let { + try { + it.toBigDecimal() + } catch (e: NumberFormatException) { + return BigDecimal.ZERO + } + } ?: ( this.eventsList .firstOrNull { it.type == "tx" && it.attributesList.map { attr -> attr.key.toStringUtf8() }.contains("fee") } ?.attributesList?.first { it.key.toStringUtf8() == "fee" } - ?.value?.toStringUtf8()?.denomAmountToPair()?.first?.toBigDecimal() + ?.value?.toStringUtf8()?.denomAmountToPair()?.first?.let { + try { + it.toBigDecimal() + } catch (e: NumberFormatException) { + return BigDecimal.ZERO + } + } ?: this.getFeeTotalPaid() ) } diff --git a/service/src/main/kotlin/io/provenance/explorer/service/async/AsyncCachingV2.kt b/service/src/main/kotlin/io/provenance/explorer/service/async/AsyncCachingV2.kt index e12354c9..f439c5a1 100644 --- a/service/src/main/kotlin/io/provenance/explorer/service/async/AsyncCachingV2.kt +++ b/service/src/main/kotlin/io/provenance/explorer/service/async/AsyncCachingV2.kt @@ -303,7 +303,7 @@ class AsyncCachingV2( val txUpdate = TxUpdate(tx) val txInfo = TxData(proposerRec.blockHeight, null, res.txResponse.txhash, blockTime) saveMessages(txInfo, res, txUpdate) - // saveTxFees(res, txInfo, txUpdate, proposerRec) + saveTxFees(res, txInfo, txUpdate, proposerRec) val addrs = saveAddresses(txInfo, res, txUpdate) val markers = saveMarkers(txInfo, res, txUpdate) saveNftData(txInfo, res, txUpdate)