Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion round/actor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1174,14 +1174,26 @@ func TestActorBuffersEarlyQuote(t *testing.T) {
roundID := testRoundID("early-quote")

// Send the quote BEFORE RoundJoined.
//
// We have a single boarding input of 50_000 sat and a single
// matching VTXO output. The lone output is implicit change
// under the #270 protocol, so the server may quote a residual
// below the intent's target. Quote it down by 1_000 sat so
// the realised fee (Σinputs−Σoutputs) agrees with
// OperatorFeeSat — see #379.
vtxoQuotes := make([]VTXOQuoteEntry, len(vtxos))
for i, v := range vtxos {
script, err := v.EffectivePkScript()
require.NoError(t, err)

amount := int64(v.Amount)
if i == 0 {
amount -= 1_000
}

vtxoQuotes[i] = VTXOQuoteEntry{
PkScript: script,
AmountSat: int64(v.Amount),
AmountSat: amount,
RecipientKey: v.SigningKey.PubKey.SerializeCompressed(),
}
}
Expand Down
Loading
Loading