feat: replace the cosmos-db.DB interface with core/store interface (backport #21450) (#21490)

Co-authored-by: Julien Robert <julien@rbrt.fr>
This commit is contained in:
mergify[bot]
2024-09-06 10:30:01 +00:00
committed by GitHub
co-authored by Julien Robert
parent 8ce77cbb24
commit 889becd2c0
78 changed files with 996 additions and 981 deletions
+1 -1
View File
@@ -618,7 +618,7 @@ e.g. in `NewSimApp`:
```go
func NewSimApp(
logger log.Logger,
db dbm.DB,
db corestore.KVStoreWithBatch,
traceStore io.Writer,
loadLatest bool,
appOpts servertypes.AppOptions,
+1 -1
View File
@@ -108,7 +108,7 @@ Finally, a few more important parameters:
```go
func NewBaseApp(
name string, logger log.Logger, db dbm.DB, txDecoder sdk.TxDecoder, options ...func(*BaseApp),
name string, logger log.Logger, db corestore.KVStoreWithBatch, txDecoder sdk.TxDecoder, options ...func(*BaseApp),
) *BaseApp {
// ...
+2 -2
View File
@@ -141,13 +141,13 @@ The documentation on the IAVL Tree is located [here](https://github.com/cosmos/i
### `DbAdapter` Store
`dbadapter.Store` is an adapter for `dbm.DB` making it fulfilling the `KVStore` interface.
`dbadapter.Store` is an adapter for `corestore.KVStoreWithBatch` making it fulfilling the `KVStore` interface.
```go reference
https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/store/dbadapter/store.go#L13-L16
```
`dbadapter.Store` embeds `dbm.DB`, meaning most of the `KVStore` interface functions are implemented. The other functions (mostly miscellaneous) are manually implemented. This store is primarily used within [Transient Stores](#transient-store)
`dbadapter.Store` embeds `corestore.KVStoreWithBatch`, meaning most of the `KVStore` interface functions are implemented. The other functions (mostly miscellaneous) are manually implemented. This store is primarily used within [Transient Stores](#transient-store)
### `Transient` Store