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
12
12
13
13
- cosmwasm-std: Make fields of ` IbcAckCallbackMsg ` and ` IbcTimeoutCallbackMsg `
14
14
public. ([ #2191 ] )
15
+ - cosmwasm-std: Add default implementation for ` Storage::range ` to make
16
+ ` iterator ` feature additive. ([ #2197 ] )
15
17
16
18
[ #2191 ] : https://github.com/CosmWasm/cosmwasm/pull/2191
19
+ [ #2197 ] : https://github.com/CosmWasm/cosmwasm/pull/2197
17
20
18
21
## [ 2.1.0] - 2024-07-11
19
22
Original file line number Diff line number Diff line change @@ -61,12 +61,17 @@ pub trait Storage {
61
61
/// The bound `start` is inclusive and `end` is exclusive.
62
62
/// If `start` is lexicographically greater than or equal to `end`, an empty range is described, mo matter of the order.
63
63
#[ cfg( feature = "iterator" ) ]
64
+ #[ allow( unused_variables) ]
64
65
fn range < ' a > (
65
66
& ' a self ,
66
67
start : Option < & [ u8 ] > ,
67
68
end : Option < & [ u8 ] > ,
68
69
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
+ }
70
75
71
76
/// Allows iteration over a set of keys, either forwards or backwards.
72
77
///
You can’t perform that action at this time.
0 commit comments