mirror of
https://github.com/bitcoin-s/bitcoin-s.git
synced 2025-03-03 18:47:38 +01:00
Fix lnd OutputDetails for outputs that dont have an address (#4438)
This commit is contained in:
parent
135b9f8a35
commit
678612161b
3 changed files with 3 additions and 3 deletions
|
@ -43,7 +43,7 @@ case class ChannelBalances(
|
||||||
) extends LndModel
|
) extends LndModel
|
||||||
|
|
||||||
case class OutputDetails(
|
case class OutputDetails(
|
||||||
address: BitcoinAddress,
|
addressOpt: Option[BitcoinAddress],
|
||||||
spk: ScriptPubKey,
|
spk: ScriptPubKey,
|
||||||
outputIndex: Long,
|
outputIndex: Long,
|
||||||
amount: CurrencyUnit,
|
amount: CurrencyUnit,
|
||||||
|
|
|
@ -197,7 +197,7 @@ class LndRpcClientPairTest extends DualLndFixture {
|
||||||
|
|
||||||
assert(details.tx == tx)
|
assert(details.tx == tx)
|
||||||
assert(details.txId == tx.txIdBE)
|
assert(details.txId == tx.txIdBE)
|
||||||
assert(details.outputDetails.map(_.address).contains(addr))
|
assert(details.outputDetails.flatMap(_.addressOpt).contains(addr))
|
||||||
assert(details.amount == sendAmt)
|
assert(details.amount == sendAmt)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -72,7 +72,7 @@ trait LndUtils {
|
||||||
implicit def lndOutputDetailToOutputDetails(
|
implicit def lndOutputDetailToOutputDetails(
|
||||||
detail: lnrpc.OutputDetail): OutputDetails = {
|
detail: lnrpc.OutputDetail): OutputDetails = {
|
||||||
OutputDetails(
|
OutputDetails(
|
||||||
address = BitcoinAddress.fromString(detail.address),
|
addressOpt = BitcoinAddress.fromStringOpt(detail.address),
|
||||||
spk = ScriptPubKey.fromAsmHex(detail.pkScript),
|
spk = ScriptPubKey.fromAsmHex(detail.pkScript),
|
||||||
outputIndex = detail.outputIndex,
|
outputIndex = detail.outputIndex,
|
||||||
amount = Satoshis(detail.amount),
|
amount = Satoshis(detail.amount),
|
||||||
|
|
Loading…
Add table
Reference in a new issue