github.com/koko1123/flow-go-1@v0.29.6/storage/mock/ledger.go (about)

     1  // Code generated by mockery v2.13.1. DO NOT EDIT.
     2  
     3  package mock
     4  
     5  import (
     6  	flow "github.com/koko1123/flow-go-1/model/flow"
     7  	mock "github.com/stretchr/testify/mock"
     8  )
     9  
    10  // Ledger is an autogenerated mock type for the Ledger type
    11  type Ledger struct {
    12  	mock.Mock
    13  }
    14  
    15  // Done provides a mock function with given fields:
    16  func (_m *Ledger) Done() <-chan struct{} {
    17  	ret := _m.Called()
    18  
    19  	var r0 <-chan struct{}
    20  	if rf, ok := ret.Get(0).(func() <-chan struct{}); ok {
    21  		r0 = rf()
    22  	} else {
    23  		if ret.Get(0) != nil {
    24  			r0 = ret.Get(0).(<-chan struct{})
    25  		}
    26  	}
    27  
    28  	return r0
    29  }
    30  
    31  // EmptyStateCommitment provides a mock function with given fields:
    32  func (_m *Ledger) EmptyStateCommitment() flow.StateCommitment {
    33  	ret := _m.Called()
    34  
    35  	var r0 flow.StateCommitment
    36  	if rf, ok := ret.Get(0).(func() flow.StateCommitment); ok {
    37  		r0 = rf()
    38  	} else {
    39  		if ret.Get(0) != nil {
    40  			r0 = ret.Get(0).(flow.StateCommitment)
    41  		}
    42  	}
    43  
    44  	return r0
    45  }
    46  
    47  // GetRegisters provides a mock function with given fields: registerIDs, stateCommitment
    48  func (_m *Ledger) GetRegisters(registerIDs []flow.RegisterID, stateCommitment flow.StateCommitment) ([][]byte, error) {
    49  	ret := _m.Called(registerIDs, stateCommitment)
    50  
    51  	var r0 [][]byte
    52  	if rf, ok := ret.Get(0).(func([]flow.RegisterID, flow.StateCommitment) [][]byte); ok {
    53  		r0 = rf(registerIDs, stateCommitment)
    54  	} else {
    55  		if ret.Get(0) != nil {
    56  			r0 = ret.Get(0).([][]byte)
    57  		}
    58  	}
    59  
    60  	var r1 error
    61  	if rf, ok := ret.Get(1).(func([]flow.RegisterID, flow.StateCommitment) error); ok {
    62  		r1 = rf(registerIDs, stateCommitment)
    63  	} else {
    64  		r1 = ret.Error(1)
    65  	}
    66  
    67  	return r0, r1
    68  }
    69  
    70  // GetRegistersWithProof provides a mock function with given fields: registerIDs, stateCommitment
    71  func (_m *Ledger) GetRegistersWithProof(registerIDs []flow.RegisterID, stateCommitment flow.StateCommitment) ([][]byte, [][]byte, error) {
    72  	ret := _m.Called(registerIDs, stateCommitment)
    73  
    74  	var r0 [][]byte
    75  	if rf, ok := ret.Get(0).(func([]flow.RegisterID, flow.StateCommitment) [][]byte); ok {
    76  		r0 = rf(registerIDs, stateCommitment)
    77  	} else {
    78  		if ret.Get(0) != nil {
    79  			r0 = ret.Get(0).([][]byte)
    80  		}
    81  	}
    82  
    83  	var r1 [][]byte
    84  	if rf, ok := ret.Get(1).(func([]flow.RegisterID, flow.StateCommitment) [][]byte); ok {
    85  		r1 = rf(registerIDs, stateCommitment)
    86  	} else {
    87  		if ret.Get(1) != nil {
    88  			r1 = ret.Get(1).([][]byte)
    89  		}
    90  	}
    91  
    92  	var r2 error
    93  	if rf, ok := ret.Get(2).(func([]flow.RegisterID, flow.StateCommitment) error); ok {
    94  		r2 = rf(registerIDs, stateCommitment)
    95  	} else {
    96  		r2 = ret.Error(2)
    97  	}
    98  
    99  	return r0, r1, r2
   100  }
   101  
   102  // Ready provides a mock function with given fields:
   103  func (_m *Ledger) Ready() <-chan struct{} {
   104  	ret := _m.Called()
   105  
   106  	var r0 <-chan struct{}
   107  	if rf, ok := ret.Get(0).(func() <-chan struct{}); ok {
   108  		r0 = rf()
   109  	} else {
   110  		if ret.Get(0) != nil {
   111  			r0 = ret.Get(0).(<-chan struct{})
   112  		}
   113  	}
   114  
   115  	return r0
   116  }
   117  
   118  // UpdateRegisters provides a mock function with given fields: registerIDs, values, stateCommitment
   119  func (_m *Ledger) UpdateRegisters(registerIDs []flow.RegisterID, values [][]byte, stateCommitment flow.StateCommitment) (flow.StateCommitment, error) {
   120  	ret := _m.Called(registerIDs, values, stateCommitment)
   121  
   122  	var r0 flow.StateCommitment
   123  	if rf, ok := ret.Get(0).(func([]flow.RegisterID, [][]byte, flow.StateCommitment) flow.StateCommitment); ok {
   124  		r0 = rf(registerIDs, values, stateCommitment)
   125  	} else {
   126  		if ret.Get(0) != nil {
   127  			r0 = ret.Get(0).(flow.StateCommitment)
   128  		}
   129  	}
   130  
   131  	var r1 error
   132  	if rf, ok := ret.Get(1).(func([]flow.RegisterID, [][]byte, flow.StateCommitment) error); ok {
   133  		r1 = rf(registerIDs, values, stateCommitment)
   134  	} else {
   135  		r1 = ret.Error(1)
   136  	}
   137  
   138  	return r0, r1
   139  }
   140  
   141  // UpdateRegistersWithProof provides a mock function with given fields: registerIDs, values, stateCommitment
   142  func (_m *Ledger) UpdateRegistersWithProof(registerIDs []flow.RegisterID, values [][]byte, stateCommitment flow.StateCommitment) (flow.StateCommitment, [][]byte, error) {
   143  	ret := _m.Called(registerIDs, values, stateCommitment)
   144  
   145  	var r0 flow.StateCommitment
   146  	if rf, ok := ret.Get(0).(func([]flow.RegisterID, [][]byte, flow.StateCommitment) flow.StateCommitment); ok {
   147  		r0 = rf(registerIDs, values, stateCommitment)
   148  	} else {
   149  		if ret.Get(0) != nil {
   150  			r0 = ret.Get(0).(flow.StateCommitment)
   151  		}
   152  	}
   153  
   154  	var r1 [][]byte
   155  	if rf, ok := ret.Get(1).(func([]flow.RegisterID, [][]byte, flow.StateCommitment) [][]byte); ok {
   156  		r1 = rf(registerIDs, values, stateCommitment)
   157  	} else {
   158  		if ret.Get(1) != nil {
   159  			r1 = ret.Get(1).([][]byte)
   160  		}
   161  	}
   162  
   163  	var r2 error
   164  	if rf, ok := ret.Get(2).(func([]flow.RegisterID, [][]byte, flow.StateCommitment) error); ok {
   165  		r2 = rf(registerIDs, values, stateCommitment)
   166  	} else {
   167  		r2 = ret.Error(2)
   168  	}
   169  
   170  	return r0, r1, r2
   171  }
   172  
   173  type mockConstructorTestingTNewLedger interface {
   174  	mock.TestingT
   175  	Cleanup(func())
   176  }
   177  
   178  // NewLedger creates a new instance of Ledger. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
   179  func NewLedger(t mockConstructorTestingTNewLedger) *Ledger {
   180  	mock := &Ledger{}
   181  	mock.Mock.Test(t)
   182  
   183  	t.Cleanup(func() { mock.AssertExpectations(t) })
   184  
   185  	return mock
   186  }