Documentation ¶
Overview ¶
Package statestore is a generated GoMock package.
Index ¶
- type MockStateStore
- func (m *MockStateStore) EXPECT() *MockStateStoreMockRecorder
- func (m *MockStateStore) GetAccountValue(addr common.Address) (types.AccountValue, error)
- func (m *MockStateStore) GetChildren(height uint64, rootHash common.Hash) ([]common.Hash, error)
- func (m *MockStateStore) GetCodeByHash(codeHash common.Hash) ([]byte, error)
- func (m *MockStateStore) GetLayerLog(height uint64, rootHash common.Hash) (types.LayerLog, error)
- func (m *MockStateStore) GetPersistedHeight() (uint64, common.Hash, error)
- func (m *MockStateStore) GetStorageByVersion(addr common.Address, version uint64, key common.Hash) (common.Hash, error)
- func (m *MockStateStore) NewTransaction() (Transaction, error)
- func (m *MockStateStore) Shutdown()
- type MockStateStoreMockRecorder
- func (mr *MockStateStoreMockRecorder) GetAccountValue(addr any) *gomock.Call
- func (mr *MockStateStoreMockRecorder) GetChildren(height, rootHash any) *gomock.Call
- func (mr *MockStateStoreMockRecorder) GetCodeByHash(codeHash any) *gomock.Call
- func (mr *MockStateStoreMockRecorder) GetLayerLog(height, rootHash any) *gomock.Call
- func (mr *MockStateStoreMockRecorder) GetPersistedHeight() *gomock.Call
- func (mr *MockStateStoreMockRecorder) GetStorageByVersion(addr, version, key any) *gomock.Call
- func (mr *MockStateStoreMockRecorder) NewTransaction() *gomock.Call
- func (mr *MockStateStoreMockRecorder) Shutdown() *gomock.Call
- type MockTransaction
- func (m *MockTransaction) Commit() error
- func (m *MockTransaction) DeleteChildren(height uint64, rootHash common.Hash) error
- func (m *MockTransaction) DeleteLayerLog(height uint64, rootHash common.Hash) error
- func (m *MockTransaction) Discard()
- func (m *MockTransaction) EXPECT() *MockTransactionMockRecorder
- func (m *MockTransaction) PersistLayerLog(layerLog types.LayerLog) error
- func (m *MockTransaction) PutChildren(height uint64, rootHash common.Hash, children []common.Hash) error
- func (m *MockTransaction) PutLayerLog(layerLog types.LayerLog) error
- type MockTransactionMockRecorder
- func (mr *MockTransactionMockRecorder) Commit() *gomock.Call
- func (mr *MockTransactionMockRecorder) DeleteChildren(height, rootHash any) *gomock.Call
- func (mr *MockTransactionMockRecorder) DeleteLayerLog(height, rootHash any) *gomock.Call
- func (mr *MockTransactionMockRecorder) Discard() *gomock.Call
- func (mr *MockTransactionMockRecorder) PersistLayerLog(layerLog any) *gomock.Call
- func (mr *MockTransactionMockRecorder) PutChildren(height, rootHash, children any) *gomock.Call
- func (mr *MockTransactionMockRecorder) PutLayerLog(layerLog any) *gomock.Call
- type Opts
- type StateStore
- type Transaction
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MockStateStore ¶
type MockStateStore struct {
// contains filtered or unexported fields
}
MockStateStore is a mock of StateStore interface.
func NewMockStateStore ¶
func NewMockStateStore(ctrl *gomock.Controller) *MockStateStore
NewMockStateStore creates a new mock instance.
func (*MockStateStore) EXPECT ¶
func (m *MockStateStore) EXPECT() *MockStateStoreMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockStateStore) GetAccountValue ¶
func (m *MockStateStore) GetAccountValue(addr common.Address) (types.AccountValue, error)
GetAccountValue mocks base method.
func (*MockStateStore) GetChildren ¶
GetChildren mocks base method.
func (*MockStateStore) GetCodeByHash ¶
func (m *MockStateStore) GetCodeByHash(codeHash common.Hash) ([]byte, error)
GetCodeByHash mocks base method.
func (*MockStateStore) GetLayerLog ¶
GetLayerLog mocks base method.
func (*MockStateStore) GetPersistedHeight ¶
func (m *MockStateStore) GetPersistedHeight() (uint64, common.Hash, error)
GetPersistedHeight mocks base method.
func (*MockStateStore) GetStorageByVersion ¶
func (m *MockStateStore) GetStorageByVersion(addr common.Address, version uint64, key common.Hash) (common.Hash, error)
GetStorageByVersion mocks base method.
func (*MockStateStore) NewTransaction ¶
func (m *MockStateStore) NewTransaction() (Transaction, error)
NewTransaction mocks base method.
type MockStateStoreMockRecorder ¶
type MockStateStoreMockRecorder struct {
// contains filtered or unexported fields
}
MockStateStoreMockRecorder is the mock recorder for MockStateStore.
func (*MockStateStoreMockRecorder) GetAccountValue ¶
func (mr *MockStateStoreMockRecorder) GetAccountValue(addr any) *gomock.Call
GetAccountValue indicates an expected call of GetAccountValue.
func (*MockStateStoreMockRecorder) GetChildren ¶
func (mr *MockStateStoreMockRecorder) GetChildren(height, rootHash any) *gomock.Call
GetChildren indicates an expected call of GetChildren.
func (*MockStateStoreMockRecorder) GetCodeByHash ¶
func (mr *MockStateStoreMockRecorder) GetCodeByHash(codeHash any) *gomock.Call
GetCodeByHash indicates an expected call of GetCodeByHash.
func (*MockStateStoreMockRecorder) GetLayerLog ¶
func (mr *MockStateStoreMockRecorder) GetLayerLog(height, rootHash any) *gomock.Call
GetLayerLog indicates an expected call of GetLayerLog.
func (*MockStateStoreMockRecorder) GetPersistedHeight ¶
func (mr *MockStateStoreMockRecorder) GetPersistedHeight() *gomock.Call
GetPersistedHeight indicates an expected call of GetPersistedHeight.
func (*MockStateStoreMockRecorder) GetStorageByVersion ¶
func (mr *MockStateStoreMockRecorder) GetStorageByVersion(addr, version, key any) *gomock.Call
GetStorageByVersion indicates an expected call of GetStorageByVersion.
func (*MockStateStoreMockRecorder) NewTransaction ¶
func (mr *MockStateStoreMockRecorder) NewTransaction() *gomock.Call
NewTransaction indicates an expected call of NewTransaction.
func (*MockStateStoreMockRecorder) Shutdown ¶
func (mr *MockStateStoreMockRecorder) Shutdown() *gomock.Call
Shutdown indicates an expected call of Shutdown.
type MockTransaction ¶
type MockTransaction struct {
// contains filtered or unexported fields
}
MockTransaction is a mock of Transaction interface.
func NewMockTransaction ¶
func NewMockTransaction(ctrl *gomock.Controller) *MockTransaction
NewMockTransaction creates a new mock instance.
func (*MockTransaction) DeleteChildren ¶
func (m *MockTransaction) DeleteChildren(height uint64, rootHash common.Hash) error
DeleteChildren mocks base method.
func (*MockTransaction) DeleteLayerLog ¶
func (m *MockTransaction) DeleteLayerLog(height uint64, rootHash common.Hash) error
DeleteLayerLog mocks base method.
func (*MockTransaction) EXPECT ¶
func (m *MockTransaction) EXPECT() *MockTransactionMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockTransaction) PersistLayerLog ¶
func (m *MockTransaction) PersistLayerLog(layerLog types.LayerLog) error
PersistLayerLog mocks base method.
func (*MockTransaction) PutChildren ¶
func (m *MockTransaction) PutChildren(height uint64, rootHash common.Hash, children []common.Hash) error
PutChildren mocks base method.
func (*MockTransaction) PutLayerLog ¶
func (m *MockTransaction) PutLayerLog(layerLog types.LayerLog) error
PutLayerLog mocks base method.
type MockTransactionMockRecorder ¶
type MockTransactionMockRecorder struct {
// contains filtered or unexported fields
}
MockTransactionMockRecorder is the mock recorder for MockTransaction.
func (*MockTransactionMockRecorder) Commit ¶
func (mr *MockTransactionMockRecorder) Commit() *gomock.Call
Commit indicates an expected call of Commit.
func (*MockTransactionMockRecorder) DeleteChildren ¶
func (mr *MockTransactionMockRecorder) DeleteChildren(height, rootHash any) *gomock.Call
DeleteChildren indicates an expected call of DeleteChildren.
func (*MockTransactionMockRecorder) DeleteLayerLog ¶
func (mr *MockTransactionMockRecorder) DeleteLayerLog(height, rootHash any) *gomock.Call
DeleteLayerLog indicates an expected call of DeleteLayerLog.
func (*MockTransactionMockRecorder) Discard ¶
func (mr *MockTransactionMockRecorder) Discard() *gomock.Call
Discard indicates an expected call of Discard.
func (*MockTransactionMockRecorder) PersistLayerLog ¶
func (mr *MockTransactionMockRecorder) PersistLayerLog(layerLog any) *gomock.Call
PersistLayerLog indicates an expected call of PersistLayerLog.
func (*MockTransactionMockRecorder) PutChildren ¶
func (mr *MockTransactionMockRecorder) PutChildren(height, rootHash, children any) *gomock.Call
PutChildren indicates an expected call of PutChildren.
func (*MockTransactionMockRecorder) PutLayerLog ¶
func (mr *MockTransactionMockRecorder) PutLayerLog(layerLog any) *gomock.Call
PutLayerLog indicates an expected call of PutLayerLog.
type Opts ¶
type Opts struct { // Path to the data store Path string // GC Period GCPeriod time.Duration // The IO Timeout ReadTimeout time.Duration WriteTimeout time.Duration }
Opts is the options for state store.
type StateStore ¶
type StateStore interface { // GetPersistedHeight gets the persisted state height and root. GetPersistedHeight() (uint64, common.Hash, error) // GetChildren gets the child states for a state with the given root hash. GetChildren(height uint64, rootHash common.Hash) ([]common.Hash, error) // GetLayerLog gets the layer log for a state with the given root hash. GetLayerLog(height uint64, rootHash common.Hash) (itypes.LayerLog, error) // GetAccountValue gets the persisted account value for given address. GetAccountValue(addr common.Address) (itypes.AccountValue, error) // GetStorageByVersion gets the persisted storage value for given key. GetStorageByVersion(addr common.Address, version uint64, key common.Hash) (common.Hash, error) // GetCodeByHash gets the persisted code for given hash. GetCodeByHash(codeHash common.Hash) ([]byte, error) // NewTransaction creates a new transaction to write. NewTransaction() (Transaction, error) // Shutdown safely shuts the statestore down. Shutdown() }
type Transaction ¶
type Transaction interface { // Persist layer log by applying all the changes. // It includes update persisted height, root hash and commit all changes. PersistLayerLog(layerLog itypes.LayerLog) error // PutChildren puts children to the state with the given root hash. PutChildren(height uint64, rootHash common.Hash, children []common.Hash) error // DeleteChildren deletes children of the state with the given root hash. DeleteChildren(height uint64, rootHash common.Hash) error // PutLayerLog puts layer log to the state with the given root hash. PutLayerLog(layerLog itypes.LayerLog) error // DeleteLayerLog deletes layer log of the state with the given root hash. DeleteLayerLog(height uint64, rootHash common.Hash) error // Commit commits all changes. Commit() error // Discard discards all changes. Discard() }