Make change of async payment spendable (#324)

* Drop unused ComputeOutputScript & use ParseTaprootScript internally

* Add pending field to vtxo domain

* Add check to handle async change as claimed vtxo & Move check to prevent spending penidng vtxos to app level

* Rename utils.go to parser.go & Fixes

* Ignore sent-and-reversible vtxos in ListVtxos

* Fixes

Co-authored-by: Louis Singer <louisinger@users.noreply.github.com>

* Fix e2e test

Co-authored-by: Louis Singer <louisinger@users.noreply.github.com>
Co-authored-by: João Bordalo <bordalix@users.noreply.github.com>

* Fix

* Add PendingChange field to vtxo

* Add PendingChange field to Transaction

* Fixes

* Remove logs

---------

Co-authored-by: Louis Singer <louisinger@users.noreply.github.com>
Co-authored-by: João Bordalo <bordalix@users.noreply.github.com>
This commit is contained in:
Pietralberto Mazza
2024-09-19 19:44:22 +02:00
committed by GitHub
parent 10ef0dbffa
commit 5c2065ad47
34 changed files with 569 additions and 1054 deletions

View File

@@ -21,18 +21,19 @@ type PaymentReceiverVw struct {
}
type PaymentVtxoVw struct {
Txid sql.NullString
Vout sql.NullInt64
Amount sql.NullInt64
PoolTx sql.NullString
SpentBy sql.NullString
Spent sql.NullBool
Redeemed sql.NullBool
Swept sql.NullBool
ExpireAt sql.NullInt64
PaymentID sql.NullString
RedeemTx sql.NullString
Descriptor sql.NullString
Txid sql.NullString
Vout sql.NullInt64
Amount sql.NullInt64
PoolTx sql.NullString
SpentBy sql.NullString
Spent sql.NullBool
Redeemed sql.NullBool
Swept sql.NullBool
ExpireAt sql.NullInt64
PaymentID sql.NullString
RedeemTx sql.NullString
Descriptor sql.NullString
PendingChange sql.NullBool
}
type Receiver struct {
@@ -103,16 +104,17 @@ type UncondForfeitTxVw struct {
}
type Vtxo struct {
Txid string
Vout int64
Amount int64
PoolTx string
SpentBy string
Spent bool
Redeemed bool
Swept bool
ExpireAt int64
PaymentID sql.NullString
RedeemTx sql.NullString
Descriptor sql.NullString
Txid string
Vout int64
Amount int64
PoolTx string
SpentBy string
Spent bool
Redeemed bool
Swept bool
ExpireAt int64
PaymentID sql.NullString
RedeemTx sql.NullString
Descriptor sql.NullString
PendingChange sql.NullBool
}