@@ -23,6 +23,7 @@ import (
2323 "testing"
2424 "time"
2525
26+ "github.com/hyperledger/firefly-common/pkg/ffapi"
2627 "github.com/hyperledger/firefly-common/pkg/fftypes"
2728 "github.com/hyperledger/firefly/mocks/databasemocks"
2829 "github.com/hyperledger/firefly/pkg/core"
@@ -178,11 +179,11 @@ func TestPersistMWBatchIdempotencyAllFail(t *testing.T) {
178179 }).Return (nil )
179180 mdi .On ("InsertDataArray" , customCtx , append (m1d , m2d ... )).Return (nil )
180181 mdi .On ("InsertMessages" , customCtx , []* core.Message {m1 , m2 }).Return (fmt .Errorf ("various keys were not unique" ))
181- mdi .On ("GetMessages" , mock .Anything , "ns1" , mock .MatchedBy (func (f database .Filter ) bool {
182+ mdi .On ("GetMessages" , mock .Anything , "ns1" , mock .MatchedBy (func (f ffapi .Filter ) bool {
182183 ff , _ := f .Finalize ()
183184 return strings .Contains (ff .String (), "idem1" )
184185 })).Return ([]* core.Message {m1 }, nil , nil )
185- mdi .On ("GetMessages" , mock .Anything , "ns1" , mock .MatchedBy (func (f database .Filter ) bool {
186+ mdi .On ("GetMessages" , mock .Anything , "ns1" , mock .MatchedBy (func (f ffapi .Filter ) bool {
186187 ff , _ := f .Finalize ()
187188 return strings .Contains (ff .String (), "idem2" )
188189 })).Return ([]* core.Message {m2 }, nil , nil )
@@ -237,11 +238,11 @@ func TestPersistMWBatchHalfFailResubmit(t *testing.T) {
237238 }).Return (nil )
238239 mdi .On ("InsertDataArray" , customCtx , append (m1d , m2d ... )).Return (nil )
239240 mdi .On ("InsertMessages" , customCtx , []* core.Message {m1 , m2 }).Return (fmt .Errorf ("various keys were not unique" ))
240- mdi .On ("GetMessages" , mock .Anything , "ns1" , mock .MatchedBy (func (f database .Filter ) bool {
241+ mdi .On ("GetMessages" , mock .Anything , "ns1" , mock .MatchedBy (func (f ffapi .Filter ) bool {
241242 ff , _ := f .Finalize ()
242243 return strings .Contains (ff .String (), "idem1" )
243244 })).Return ([]* core.Message {}, nil , nil ) // no result
244- mdi .On ("GetMessages" , mock .Anything , "ns1" , mock .MatchedBy (func (f database .Filter ) bool {
245+ mdi .On ("GetMessages" , mock .Anything , "ns1" , mock .MatchedBy (func (f ffapi .Filter ) bool {
245246 ff , _ := f .Finalize ()
246247 return strings .Contains (ff .String (), "idem2" )
247248 })).Return ([]* core.Message {m2 }, nil , nil ) // found result
@@ -286,7 +287,7 @@ func TestPersistMWBatchFailIdemCheck(t *testing.T) {
286287 }).Return (nil )
287288 mdi .On ("InsertDataArray" , customCtx , m1d ).Return (nil )
288289 mdi .On ("InsertMessages" , customCtx , []* core.Message {m1 }).Return (fmt .Errorf ("failure1... which leads to..." ))
289- mdi .On ("GetMessages" , mock .Anything , "ns1" , mock .MatchedBy (func (f database .Filter ) bool {
290+ mdi .On ("GetMessages" , mock .Anything , "ns1" , mock .MatchedBy (func (f ffapi .Filter ) bool {
290291 ff , _ := f .Finalize ()
291292 return strings .Contains (ff .String (), "idem1" )
292293 })).Return ([]* core.Message {}, nil , fmt .Errorf ("failure1" ))
@@ -359,7 +360,7 @@ func TestWriteMessageNoWorkersIdempotencyDuplicate(t *testing.T) {
359360 rag .Return (args [1 ].(func (context.Context ) error )(customCtx ))
360361 }).Return (nil )
361362 mdi .On ("InsertMessages" , customCtx , []* core.Message {& m1 .Message }).Return (fmt .Errorf ("failure1... which leads to..." ))
362- mdi .On ("GetMessages" , mock .Anything , "ns1" , mock .MatchedBy (func (f database .Filter ) bool {
363+ mdi .On ("GetMessages" , mock .Anything , "ns1" , mock .MatchedBy (func (f ffapi .Filter ) bool {
363364 ff , _ := f .Finalize ()
364365 return strings .Contains (ff .String (), "idem1" )
365366 })).Return ([]* core.Message {
0 commit comments