github.com/gnolang/gno@v0.0.0-20240520182011-228e9d0192ce/tm2/pkg/bft/rpc/lib/client/batch/mock_test.go (about)

     1  package batch
     2  
     3  import (
     4  	"context"
     5  
     6  	types "github.com/gnolang/gno/tm2/pkg/bft/rpc/lib/types"
     7  )
     8  
     9  type sendBatchDelegate func(context.Context, types.RPCRequests) (types.RPCResponses, error)
    10  
    11  type mockClient struct {
    12  	sendBatchFn sendBatchDelegate
    13  }
    14  
    15  func (m *mockClient) SendBatch(ctx context.Context, requests types.RPCRequests) (types.RPCResponses, error) {
    16  	if m.sendBatchFn != nil {
    17  		return m.sendBatchFn(ctx, requests)
    18  	}
    19  
    20  	return nil, nil
    21  }