File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -2342,4 +2342,27 @@ mod tests {
2342
2342
fn making_an_address_with_empty_prefix_should_panic ( ) {
2343
2343
MockApi :: default ( ) . with_prefix ( "" ) . addr_make ( "creator" ) ;
2344
2344
}
2345
+
2346
+ #[ test]
2347
+ #[ cfg( feature = "cosmwasm_1_3" ) ]
2348
+ fn distribution_querier_new_works ( ) {
2349
+ let addresses = [
2350
+ ( "addr0000" . to_string ( ) , "addr0001" . to_string ( ) ) ,
2351
+ ( "addr0002" . to_string ( ) , "addr0001" . to_string ( ) ) ,
2352
+ ] ;
2353
+ let btree_map = BTreeMap :: from ( addresses. clone ( ) ) ;
2354
+
2355
+ // should still work with HashMap
2356
+ let hashmap = HashMap :: from ( addresses. clone ( ) ) ;
2357
+ let querier = DistributionQuerier :: new ( hashmap) ;
2358
+ assert_eq ! ( querier. withdraw_addresses, btree_map) ;
2359
+
2360
+ // should work with BTreeMap
2361
+ let querier = DistributionQuerier :: new ( btree_map. clone ( ) ) ;
2362
+ assert_eq ! ( querier. withdraw_addresses, btree_map) ;
2363
+
2364
+ // should work with array
2365
+ let querier = DistributionQuerier :: new ( addresses) ;
2366
+ assert_eq ! ( querier. withdraw_addresses, btree_map) ;
2367
+ }
2345
2368
}
You can’t perform that action at this time.
0 commit comments