instantout/reservation: adapt hardening tests to protocol FSM

The security tests use the pre-feature helper names. Update them for
the client-requested reservation manager API after combining both PR
stacks.
This commit is contained in:
Slyghtning 2026-08-11 15:01:50 +02:00
parent 08a06a1914
commit fb6e6101e8
No known key found for this signature in database
GPG key ID: F82D456EA023C9BF

View file

@ -123,8 +123,8 @@ func TestManagerContinuesAfterInvalidNotification(t *testing.T) {
<-initChan
// A malformed ID is rejected by newReservation. The manager should log
// the error and continue processing the stream.
// A malformed ID is rejected by newReservationFromNtfn. The manager
// should log the error and continue processing the stream.
testContext.reservationNotificationChan <- &swapserverrpc.ServerReservationNotification{
ReservationId: []byte{1},
}
@ -163,12 +163,12 @@ func TestManagerRejectsDuplicateReservation(t *testing.T) {
defaultExpiry,
}
firstFSM, err := testContext.manager.newReservation(
firstFSM, err := testContext.manager.newReservationFromNtfn(
ctx, uint32(testContext.mockLnd.Height), req,
)
require.NoError(t, err)
secondFSM, err := testContext.manager.newReservation(
secondFSM, err := testContext.manager.newReservationFromNtfn(
ctx, uint32(testContext.mockLnd.Height), req,
)
require.ErrorIs(t, err, ErrReservationAlreadyExists)
@ -189,11 +189,11 @@ func TestManagerLimitsActiveReservations(t *testing.T) {
id[0] = byte(i)
id[1] = byte(i >> 8)
testContext.manager.activeReservations[id] = NewFSM(
testContext.manager.cfg,
testContext.manager.cfg, ProtocolVersionServerInitiated,
)
}
reservationFSM, err := testContext.manager.newReservation(
reservationFSM, err := testContext.manager.newReservationFromNtfn(
t.Context(), uint32(testContext.mockLnd.Height),
&swapserverrpc.ServerReservationNotification{
ReservationId: defaultReservationId[:],