Skip to content

Commit 190caa4

Browse files
committed
loopout/test: refactor test
1 parent 4da4738 commit 190caa4

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

client_test.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -179,10 +179,16 @@ func testResume(t *testing.T, expired, preimageRevealed, expectSuccess bool) {
179179
var receiverKey [33]byte
180180
copy(receiverKey[:], receiverPubKey.SerializeCompressed())
181181

182-
state := loopdb.StateInitiated
182+
update := loopdb.LoopEvent{
183+
SwapStateData: loopdb.SwapStateData{
184+
State: loopdb.StateInitiated,
185+
},
186+
}
187+
183188
if preimageRevealed {
184-
state = loopdb.StatePreimageRevealed
189+
update.State = loopdb.StatePreimageRevealed
185190
}
191+
186192
pendingSwap := &loopdb.LoopOut{
187193
Contract: &loopdb.LoopOutContract{
188194
DestAddr: dest,
@@ -201,14 +207,8 @@ func testResume(t *testing.T, expired, preimageRevealed, expectSuccess bool) {
201207
},
202208
},
203209
Loop: loopdb.Loop{
204-
Events: []*loopdb.LoopEvent{
205-
{
206-
SwapStateData: loopdb.SwapStateData{
207-
State: state,
208-
},
209-
},
210-
},
211-
Hash: hash,
210+
Events: []*loopdb.LoopEvent{&update},
211+
Hash: hash,
212212
},
213213
}
214214

0 commit comments

Comments
 (0)