github.com/onflow/flow-go@v0.35.7-crescendo-preview.23-atree-inlining/ledger/complete/wal/fixtures/noopwal.go (about) 1 package fixtures 2 3 import ( 4 "github.com/onflow/flow-go/ledger" 5 "github.com/onflow/flow-go/ledger/complete/mtrie" 6 "github.com/onflow/flow-go/ledger/complete/mtrie/trie" 7 "github.com/onflow/flow-go/ledger/complete/wal" 8 ) 9 10 type NoopWAL struct{} 11 12 func (w *NoopWAL) Ready() <-chan struct{} { 13 ch := make(chan struct{}) 14 close(ch) 15 return ch 16 } 17 18 func (w *NoopWAL) Done() <-chan struct{} { 19 ch := make(chan struct{}) 20 close(ch) 21 return ch 22 } 23 24 func (w *NoopWAL) NewCheckpointer() (*wal.Checkpointer, error) { 25 return nil, nil 26 } 27 28 func (w *NoopWAL) PauseRecord() {} 29 30 func (w *NoopWAL) UnpauseRecord() {} 31 32 func (w *NoopWAL) RecordUpdate(update *ledger.TrieUpdate) (int, bool, error) { return 0, false, nil } 33 34 func (w *NoopWAL) RecordDelete(rootHash ledger.RootHash) error { return nil } 35 36 func (w *NoopWAL) ReplayOnForest(forest *mtrie.Forest) error { return nil } 37 38 func (w *NoopWAL) Segments() (first, last int, err error) { return 0, 0, nil } 39 40 func (w *NoopWAL) Replay(checkpointFn func(tries []*trie.MTrie) error, updateFn func(update *ledger.TrieUpdate) error, deleteFn func(ledger.RootHash) error) error { 41 return nil 42 } 43 44 func (w *NoopWAL) ReplayLogsOnly(checkpointFn func(tries []*trie.MTrie) error, updateFn func(update *ledger.TrieUpdate) error, deleteFn func(rootHash ledger.RootHash) error) error { 45 return nil 46 }