From dccdd5daba1bfb885bdc501adf32e4e2e69957bb Mon Sep 17 00:00:00 2001 From: Aaron Craelius Date: Thu, 8 Aug 2024 09:14:59 -0400 Subject: [PATCH] feat(core/store): make KVStore structurally typed (#21222) --- core/CHANGELOG.md | 1 + core/store/store.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/core/CHANGELOG.md b/core/CHANGELOG.md index 37c2dbf820..4a2805a512 100644 --- a/core/CHANGELOG.md +++ b/core/CHANGELOG.md @@ -55,6 +55,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * Add `PreMsghandler`and `PostMsgHandler` for pre and post message hooks * Add `MsgHandler` as an alternative to grpc handlers * Provide separate `MigrationRegistrar` instead of grouping with `RegisterServices` +* [#21222](https://github.com/cosmos/cosmos-sdk/pull/21222) Make `Iterator` a type alias so that `KVStore` is structurally typed. ### API Breaking Changes diff --git a/core/store/store.go b/core/store/store.go index 029f38dd78..5a522626d7 100644 --- a/core/store/store.go +++ b/core/store/store.go @@ -87,7 +87,7 @@ type KVStoreWithBatch interface { // // Callers must make sure the iterator is valid before calling any methods on it, // otherwise these methods will panic. -type Iterator interface { +type Iterator = interface { // Domain returns the start (inclusive) and end (exclusive) limits of the iterator. Domain() (start, end []byte)