Skip to content

Commit

Permalink
Improve error message for missing utxo in newm-chain
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewWestberg committed Sep 5, 2024
1 parent 2d849a5 commit df810d1
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -398,9 +398,11 @@ class NewmChainService : NewmChainGrpcKt.NewmChainCoroutineImplBase() {
} else {
utxos.sumOf { utxo ->
val scriptRefHexLength =
ledgerRepository
.queryUtxosByOutputRef(utxo.hash, utxo.ix.toInt())
.first()
requireNotNull(
ledgerRepository
.queryUtxosByOutputRef(utxo.hash, utxo.ix.toInt())
.firstOrNull()
) { "Utxo not found in ledger: ${utxo.hash}#${utxo.ix}" }
.scriptRef
?.length
?.toLong()
Expand Down

0 comments on commit df810d1

Please sign in to comment.