@@ -210,7 +210,7 @@ func TestScriptAuthAmIAnAuditor(t *testing.T) {
210210
211211func TestScriptAuthIssued (t * testing.T ) {
212212 sa := htlc .NewScriptAuth (nil )
213- require .False (t , sa .Issued (context . Background (), nil , & token3.Token {}))
213+ require .False (t , sa .Issued (t . Context (), nil , & token3.Token {}))
214214}
215215
216216func TestScriptAuthOwnerType (t * testing.T ) {
@@ -287,21 +287,21 @@ func TestScriptAuthIsMine(t *testing.T) {
287287
288288 t .Run ("sender owns token" , func (t * testing.T ) {
289289 sa := htlc .NewScriptAuth (stubWalletService ("wallet1" , "" ))
290- _ , ids , mine := sa .IsMine (context . Background (), tok )
290+ _ , ids , mine := sa .IsMine (t . Context (), tok )
291291 require .True (t , mine )
292292 require .Contains (t , ids , "htlc.senderwallet1" )
293293 })
294294
295295 t .Run ("recipient owns token" , func (t * testing.T ) {
296296 sa := htlc .NewScriptAuth (stubWalletService ("" , "wallet2" ))
297- _ , ids , mine := sa .IsMine (context . Background (), tok )
297+ _ , ids , mine := sa .IsMine (t . Context (), tok )
298298 require .True (t , mine )
299299 require .Contains (t , ids , "htlc.recipientwallet2" )
300300 })
301301
302302 t .Run ("both own token" , func (t * testing.T ) {
303303 sa := htlc .NewScriptAuth (stubWalletService ("wallet1" , "wallet2" ))
304- _ , ids , mine := sa .IsMine (context . Background (), tok )
304+ _ , ids , mine := sa .IsMine (t . Context (), tok )
305305 require .True (t , mine )
306306 require .Len (t , ids , 2 )
307307 require .Contains (t , ids , "htlc.senderwallet1" )
@@ -310,7 +310,7 @@ func TestScriptAuthIsMine(t *testing.T) {
310310
311311 t .Run ("neither owns token" , func (t * testing.T ) {
312312 sa := htlc .NewScriptAuth (stubWalletService ("" , "" ))
313- _ , ids , mine := sa .IsMine (context . Background (), tok )
313+ _ , ids , mine := sa .IsMine (t . Context (), tok )
314314 require .False (t , mine )
315315 require .Empty (t , ids )
316316 })
@@ -321,7 +321,7 @@ func TestScriptAuthIsMineEdgeCases(t *testing.T) {
321321
322322 t .Run ("invalid owner bytes" , func (t * testing.T ) {
323323 tok := & token3.Token {Owner : []byte ("garbage" ), Type : "USD" , Quantity : "100" }
324- _ , _ , mine := sa .IsMine (context . Background (), tok )
324+ _ , _ , mine := sa .IsMine (t . Context (), tok )
325325 require .False (t , mine )
326326 })
327327
@@ -331,7 +331,7 @@ func TestScriptAuthIsMineEdgeCases(t *testing.T) {
331331 Type : "USD" ,
332332 Quantity : "100" ,
333333 }
334- _ , _ , mine := sa .IsMine (context . Background (), tok )
334+ _ , _ , mine := sa .IsMine (t . Context (), tok )
335335 require .False (t , mine )
336336 })
337337
@@ -341,13 +341,13 @@ func TestScriptAuthIsMineEdgeCases(t *testing.T) {
341341 Type : "USD" ,
342342 Quantity : "100" ,
343343 }
344- _ , _ , mine := sa .IsMine (context . Background (), tok )
344+ _ , _ , mine := sa .IsMine (t . Context (), tok )
345345 require .False (t , mine )
346346 })
347347
348348 t .Run ("nil sender and recipient" , func (t * testing.T ) {
349349 tok := makeHTLCToken (t , nil , nil )
350- _ , _ , mine := sa .IsMine (context . Background (), tok )
350+ _ , _ , mine := sa .IsMine (t . Context (), tok )
351351 require .False (t , mine )
352352 })
353353}
0 commit comments