diff --git a/client_test.go b/client_test.go index 911732a..d0c5bfd 100644 --- a/client_test.go +++ b/client_test.go @@ -179,10 +179,16 @@ func testResume(t *testing.T, expired, preimageRevealed, expectSuccess bool) { var receiverKey [33]byte copy(receiverKey[:], receiverPubKey.SerializeCompressed()) - state := loopdb.StateInitiated + update := loopdb.LoopEvent{ + SwapStateData: loopdb.SwapStateData{ + State: loopdb.StateInitiated, + }, + } + if preimageRevealed { - state = loopdb.StatePreimageRevealed + update.State = loopdb.StatePreimageRevealed } + pendingSwap := &loopdb.LoopOut{ Contract: &loopdb.LoopOutContract{ DestAddr: dest, @@ -201,14 +207,8 @@ func testResume(t *testing.T, expired, preimageRevealed, expectSuccess bool) { }, }, Loop: loopdb.Loop{ - Events: []*loopdb.LoopEvent{ - { - SwapStateData: loopdb.SwapStateData{ - State: state, - }, - }, - }, - Hash: hash, + Events: []*loopdb.LoopEvent{&update}, + Hash: hash, }, }