github.com/Finschia/finschia-sdk@v0.48.1/store/rootmulti/dbadapter.go (about)

     1  package rootmulti
     2  
     3  import (
     4  	"github.com/Finschia/finschia-sdk/store/dbadapter"
     5  	"github.com/Finschia/finschia-sdk/store/types"
     6  )
     7  
     8  var commithash = []byte("FAKE_HASH")
     9  
    10  //----------------------------------------
    11  // commitDBStoreWrapper should only be used for simulation/debugging,
    12  // as it doesn't compute any commit hash, and it cannot load older state.
    13  
    14  // Wrapper type for dbm.Db with implementation of KVStore
    15  type commitDBStoreAdapter struct {
    16  	dbadapter.Store
    17  }
    18  
    19  func (cdsa commitDBStoreAdapter) Commit() types.CommitID {
    20  	return types.CommitID{
    21  		Version: -1,
    22  		Hash:    commithash,
    23  	}
    24  }
    25  
    26  func (cdsa commitDBStoreAdapter) LastCommitID() types.CommitID {
    27  	return types.CommitID{
    28  		Version: -1,
    29  		Hash:    commithash,
    30  	}
    31  }
    32  
    33  func (cdsa commitDBStoreAdapter) SetPruning(_ types.PruningOptions) {}
    34  
    35  // GetPruning is a no-op as pruning options cannot be directly set on this store.
    36  // They must be set on the root commit multi-store.
    37  func (cdsa commitDBStoreAdapter) GetPruning() types.PruningOptions { return types.PruningOptions{} }