File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -12,8 +12,11 @@ and this project adheres to
1212
1313- cosmwasm-std: Make fields of ` IbcAckCallbackMsg ` and ` IbcTimeoutCallbackMsg `
1414 public. ([ #2191 ] )
15+ - cosmwasm-std: Add default implementation for ` Storage::range ` to make
16+ ` iterator ` feature additive. ([ #2197 ] )
1517
1618[ #2191 ] : https://github.com/CosmWasm/cosmwasm/pull/2191
19+ [ #2197 ] : https://github.com/CosmWasm/cosmwasm/pull/2197
1720
1821## [ 2.1.0] - 2024-07-11
1922
Original file line number Diff line number Diff line change @@ -61,12 +61,17 @@ pub trait Storage {
6161 /// The bound `start` is inclusive and `end` is exclusive.
6262 /// If `start` is lexicographically greater than or equal to `end`, an empty range is described, mo matter of the order.
6363 #[ cfg( feature = "iterator" ) ]
64+ #[ allow( unused_variables) ]
6465 fn range < ' a > (
6566 & ' a self ,
6667 start : Option < & [ u8 ] > ,
6768 end : Option < & [ u8 ] > ,
6869 order : Order ,
69- ) -> Box < dyn Iterator < Item = Record > + ' a > ;
70+ ) -> Box < dyn Iterator < Item = Record > + ' a > {
71+ // This default implementation is just to avoid breaking code when enabling the `iterator` feature.
72+ // Any actual `Storage` impl should override this method.
73+ unimplemented ! ( "This storage does not support ranging. Make sure to override the `range` method in your `Storage` implementation." )
74+ }
7075
7176 /// Allows iteration over a set of keys, either forwards or backwards.
7277 ///
You can’t perform that action at this time.
0 commit comments