Skip to content

Commit

Permalink
itest: verify group virtual transaction can be derived from PSBT
Browse files Browse the repository at this point in the history
Adds a test to ensure the new PSBT field introduced in the previous
commit can be used to derive a transaction identical to the group
virtual transaction.
  • Loading branch information
ffranr committed Nov 22, 2024
1 parent 461ff73 commit 871ab0f
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions itest/mint_fund_seal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -618,6 +618,17 @@ func unmarshalPendingAssetGroup(t *testing.T,
virtualTx, err := taprpc.UnmarshalGroupVirtualTx(a.GroupVirtualTx)
require.NoError(t, err)

// Ensure that the group virtual tx is the same as the grouped virtual
// PSBT.
groupVmPsbt, err := psbt.NewFromRawBytes(
bytes.NewReader(a.GroupVirtualPsbt), false,
)
require.NoError(t, err)
require.NotNil(t, groupVmPsbt)

require.Equal(t, *groupVmPsbt.UnsignedTx, virtualTx.Tx)

// Unmarshal group key request.
require.NotNil(t, a.GroupKeyRequest)
keyReq, err := taprpc.UnmarshalGroupKeyRequest(a.GroupKeyRequest)
require.NoError(t, err)
Expand Down

0 comments on commit 871ab0f

Please sign in to comment.