1- // Copyright © 2022 Kaleido, Inc.
1+ // Copyright © 2024 Kaleido, Inc.
22//
33// SPDX-License-Identifier: Apache-2.0
44//
@@ -342,15 +342,15 @@ func TestGoodSuccessReceipt(t *testing.T) {
342342 cb .SetHandler ("ns1" , mcb )
343343 mcb .On ("OperationUpdate" , "ns1" , mock .Anything ).Return ()
344344
345- err := HandleReceipt (context .Background (), nil , & reply , cb )
345+ err := HandleReceipt (context .Background (), "" , nil , & reply , cb )
346346 assert .NoError (t , err )
347347
348348 reply .Headers .ReplyType = "TransactionUpdate"
349- err = HandleReceipt (context .Background (), nil , & reply , cb )
349+ err = HandleReceipt (context .Background (), "" , nil , & reply , cb )
350350 assert .NoError (t , err )
351351
352352 reply .Headers .ReplyType = "TransactionFailed"
353- err = HandleReceipt (context .Background (), nil , & reply , cb )
353+ err = HandleReceipt (context .Background (), "" , nil , & reply , cb )
354354 assert .NoError (t , err )
355355}
356356
@@ -365,7 +365,7 @@ func TestReceiptMarshallingError(t *testing.T) {
365365 cb .SetHandler ("ns1" , mcb )
366366 mcb .On ("OperationUpdate" , "ns1" , mock .Anything ).Return ()
367367
368- err := HandleReceipt (context .Background (), nil , & reply , cb )
368+ err := HandleReceipt (context .Background (), "" , nil , & reply , cb )
369369 assert .Error (t , err )
370370 assert .Regexp (t , ".*[^n]marshalling error.*" , err )
371371}
@@ -384,10 +384,19 @@ func TestBadReceipt(t *testing.T) {
384384 data := fftypes .JSONAnyPtr (`{}` )
385385 err := json .Unmarshal (data .Bytes (), & reply )
386386 assert .NoError (t , err )
387- err = HandleReceipt (context .Background (), nil , & reply , nil )
387+ err = HandleReceipt (context .Background (), "" , nil , & reply , nil )
388388 assert .Error (t , err )
389389}
390390
391+ func TestWrongNamespaceReceipt (t * testing.T ) {
392+ var reply BlockchainReceiptNotification
393+ data := fftypes .JSONAnyPtr (`{}` )
394+ err := json .Unmarshal (data .Bytes (), & reply )
395+ assert .NoError (t , err )
396+ err = HandleReceipt (context .Background (), "wrong" , nil , & reply , nil )
397+ assert .NoError (t , err )
398+ }
399+
391400func TestErrorWrappingConflict (t * testing.T ) {
392401 ctx := context .Background ()
393402 res := & resty.Response {
0 commit comments