File tree Expand file tree Collapse file tree 10 files changed +147
-15
lines changed
open-edition-minter-merkle-wl/src
open-edition-minter-wl-flex/src
vending-minter-featured/src
vending-minter-merkle-wl-featured/src
vending-minter-merkle-wl/src
vending-minter-wl-flex-featured/src
vending-minter-wl-flex/src
test-suite/src/vending_minter/tests Expand file tree Collapse file tree 10 files changed +147
-15
lines changed Original file line number Diff line number Diff line change @@ -1086,9 +1086,23 @@ pub fn query_status(deps: Deps) -> StdResult<StatusResponse> {
1086
1086
fn query_mint_count_per_address ( deps : Deps , address : String ) -> StdResult < MintCountResponse > {
1087
1087
let addr = deps. api . addr_validate ( & address) ?;
1088
1088
let mint_count = ( MINTER_ADDRS . key ( & addr) . may_load ( deps. storage ) ?) . unwrap_or ( 0 ) ;
1089
+ let standard_wl_count =
1090
+ ( WHITELIST_MINTER_ADDRS . key ( & addr) . may_load ( deps. storage ) ?) . unwrap_or ( 0 ) ;
1091
+ let tiered_wl_count = ( WHITELIST_FS_MINTER_ADDRS
1092
+ . key ( & addr)
1093
+ . may_load ( deps. storage ) ?)
1094
+ . unwrap_or ( 0 )
1095
+ + ( WHITELIST_SS_MINTER_ADDRS
1096
+ . key ( & addr)
1097
+ . may_load ( deps. storage ) ?)
1098
+ . unwrap_or ( 0 )
1099
+ + ( WHITELIST_TS_MINTER_ADDRS
1100
+ . key ( & addr)
1101
+ . may_load ( deps. storage ) ?)
1102
+ . unwrap_or ( 0 ) ;
1089
1103
Ok ( MintCountResponse {
1090
1104
address : addr. to_string ( ) ,
1091
- count : mint_count,
1105
+ count : mint_count + standard_wl_count + tiered_wl_count ,
1092
1106
} )
1093
1107
}
1094
1108
Original file line number Diff line number Diff line change @@ -1067,12 +1067,25 @@ pub fn query_status(deps: Deps) -> StdResult<StatusResponse> {
1067
1067
fn query_mint_count_per_address ( deps : Deps , address : String ) -> StdResult < MintCountResponse > {
1068
1068
let addr = deps. api . addr_validate ( & address) ?;
1069
1069
let mint_count = ( MINTER_ADDRS . key ( & addr) . may_load ( deps. storage ) ?) . unwrap_or ( 0 ) ;
1070
- let whitelist_mint_count =
1070
+ let standard_wl_count =
1071
1071
( WHITELIST_MINTER_ADDRS . key ( & addr) . may_load ( deps. storage ) ?) . unwrap_or ( 0 ) ;
1072
+ let tiered_wl_count = ( WHITELIST_FS_MINTER_ADDRS
1073
+ . key ( & addr)
1074
+ . may_load ( deps. storage ) ?)
1075
+ . unwrap_or ( 0 )
1076
+ + ( WHITELIST_SS_MINTER_ADDRS
1077
+ . key ( & addr)
1078
+ . may_load ( deps. storage ) ?)
1079
+ . unwrap_or ( 0 )
1080
+ + ( WHITELIST_TS_MINTER_ADDRS
1081
+ . key ( & addr)
1082
+ . may_load ( deps. storage ) ?)
1083
+ . unwrap_or ( 0 ) ;
1084
+
1072
1085
Ok ( MintCountResponse {
1073
1086
address : addr. to_string ( ) ,
1074
1087
count : mint_count,
1075
- whitelist_count : whitelist_mint_count ,
1088
+ whitelist_count : standard_wl_count + tiered_wl_count ,
1076
1089
} )
1077
1090
}
1078
1091
Original file line number Diff line number Diff line change @@ -1057,9 +1057,24 @@ pub fn query_status(deps: Deps) -> StdResult<StatusResponse> {
1057
1057
fn query_mint_count_per_address ( deps : Deps , address : String ) -> StdResult < MintCountResponse > {
1058
1058
let addr = deps. api . addr_validate ( & address) ?;
1059
1059
let mint_count = ( MINTER_ADDRS . key ( & addr) . may_load ( deps. storage ) ?) . unwrap_or ( 0 ) ;
1060
+ let standard_wl_count =
1061
+ ( WHITELIST_MINTER_ADDRS . key ( & addr) . may_load ( deps. storage ) ?) . unwrap_or ( 0 ) ;
1062
+ let tiered_wl_count = ( WHITELIST_FS_MINTER_ADDRS
1063
+ . key ( & addr)
1064
+ . may_load ( deps. storage ) ?)
1065
+ . unwrap_or ( 0 )
1066
+ + ( WHITELIST_SS_MINTER_ADDRS
1067
+ . key ( & addr)
1068
+ . may_load ( deps. storage ) ?)
1069
+ . unwrap_or ( 0 )
1070
+ + ( WHITELIST_TS_MINTER_ADDRS
1071
+ . key ( & addr)
1072
+ . may_load ( deps. storage ) ?)
1073
+ . unwrap_or ( 0 ) ;
1074
+
1060
1075
Ok ( MintCountResponse {
1061
1076
address : addr. to_string ( ) ,
1062
- count : mint_count,
1077
+ count : mint_count + standard_wl_count + tiered_wl_count ,
1063
1078
} )
1064
1079
}
1065
1080
Original file line number Diff line number Diff line change @@ -1256,9 +1256,24 @@ pub fn query_status(deps: Deps) -> StdResult<StatusResponse> {
1256
1256
fn query_mint_count ( deps : Deps , address : String ) -> StdResult < MintCountResponse > {
1257
1257
let addr = deps. api . addr_validate ( & address) ?;
1258
1258
let mint_count = ( MINTER_ADDRS . key ( & addr) . may_load ( deps. storage ) ?) . unwrap_or ( 0 ) ;
1259
+ let standard_wl_count =
1260
+ ( WHITELIST_MINTER_ADDRS . key ( & addr) . may_load ( deps. storage ) ?) . unwrap_or ( 0 ) ;
1261
+ let tiered_wl_count = ( WHITELIST_FS_MINTER_ADDRS
1262
+ . key ( & addr)
1263
+ . may_load ( deps. storage ) ?)
1264
+ . unwrap_or ( 0 )
1265
+ + ( WHITELIST_SS_MINTER_ADDRS
1266
+ . key ( & addr)
1267
+ . may_load ( deps. storage ) ?)
1268
+ . unwrap_or ( 0 )
1269
+ + ( WHITELIST_TS_MINTER_ADDRS
1270
+ . key ( & addr)
1271
+ . may_load ( deps. storage ) ?)
1272
+ . unwrap_or ( 0 ) ;
1273
+
1259
1274
Ok ( MintCountResponse {
1260
1275
address : addr. to_string ( ) ,
1261
- count : mint_count,
1276
+ count : mint_count + standard_wl_count + tiered_wl_count ,
1262
1277
} )
1263
1278
}
1264
1279
Original file line number Diff line number Diff line change @@ -1295,9 +1295,23 @@ pub fn query_status(deps: Deps) -> StdResult<StatusResponse> {
1295
1295
fn query_mint_count ( deps : Deps , address : String ) -> StdResult < MintCountResponse > {
1296
1296
let addr = deps. api . addr_validate ( & address) ?;
1297
1297
let mint_count = ( MINTER_ADDRS . key ( & addr) . may_load ( deps. storage ) ?) . unwrap_or ( 0 ) ;
1298
+ let standard_wl_count =
1299
+ ( WHITELIST_MINTER_ADDRS . key ( & addr) . may_load ( deps. storage ) ?) . unwrap_or ( 0 ) ;
1300
+ let tiered_wl_count = ( WHITELIST_FS_MINTER_ADDRS
1301
+ . key ( & addr)
1302
+ . may_load ( deps. storage ) ?)
1303
+ . unwrap_or ( 0 )
1304
+ + ( WHITELIST_SS_MINTER_ADDRS
1305
+ . key ( & addr)
1306
+ . may_load ( deps. storage ) ?)
1307
+ . unwrap_or ( 0 )
1308
+ + ( WHITELIST_TS_MINTER_ADDRS
1309
+ . key ( & addr)
1310
+ . may_load ( deps. storage ) ?)
1311
+ . unwrap_or ( 0 ) ;
1298
1312
Ok ( MintCountResponse {
1299
1313
address : addr. to_string ( ) ,
1300
- count : mint_count,
1314
+ count : mint_count + standard_wl_count + tiered_wl_count ,
1301
1315
} )
1302
1316
}
1303
1317
Original file line number Diff line number Diff line change @@ -1294,9 +1294,23 @@ pub fn query_status(deps: Deps) -> StdResult<StatusResponse> {
1294
1294
fn query_mint_count ( deps : Deps , address : String ) -> StdResult < MintCountResponse > {
1295
1295
let addr = deps. api . addr_validate ( & address) ?;
1296
1296
let mint_count = ( MINTER_ADDRS . key ( & addr) . may_load ( deps. storage ) ?) . unwrap_or ( 0 ) ;
1297
+ let standard_wl_count =
1298
+ ( WHITELIST_MINTER_ADDRS . key ( & addr) . may_load ( deps. storage ) ?) . unwrap_or ( 0 ) ;
1299
+ let tiered_wl_count = ( WHITELIST_FS_MINTER_ADDRS
1300
+ . key ( & addr)
1301
+ . may_load ( deps. storage ) ?)
1302
+ . unwrap_or ( 0 )
1303
+ + ( WHITELIST_SS_MINTER_ADDRS
1304
+ . key ( & addr)
1305
+ . may_load ( deps. storage ) ?)
1306
+ . unwrap_or ( 0 )
1307
+ + ( WHITELIST_TS_MINTER_ADDRS
1308
+ . key ( & addr)
1309
+ . may_load ( deps. storage ) ?)
1310
+ . unwrap_or ( 0 ) ;
1297
1311
Ok ( MintCountResponse {
1298
1312
address : addr. to_string ( ) ,
1299
- count : mint_count,
1313
+ count : mint_count + standard_wl_count + tiered_wl_count ,
1300
1314
} )
1301
1315
}
1302
1316
Original file line number Diff line number Diff line change @@ -1224,12 +1224,24 @@ pub fn query_status(deps: Deps) -> StdResult<StatusResponse> {
1224
1224
fn query_mint_count ( deps : Deps , address : String ) -> StdResult < MintCountResponse > {
1225
1225
let addr = deps. api . addr_validate ( & address) ?;
1226
1226
let mint_count = ( MINTER_ADDRS . key ( & addr) . may_load ( deps. storage ) ?) . unwrap_or ( 0 ) ;
1227
- let whitelist_mint_count =
1227
+ let standard_wl_count =
1228
1228
( WHITELIST_MINTER_ADDRS . key ( & addr) . may_load ( deps. storage ) ?) . unwrap_or ( 0 ) ;
1229
+ let tiered_wl_count = ( WHITELIST_FS_MINTER_ADDRS
1230
+ . key ( & addr)
1231
+ . may_load ( deps. storage ) ?)
1232
+ . unwrap_or ( 0 )
1233
+ + ( WHITELIST_SS_MINTER_ADDRS
1234
+ . key ( & addr)
1235
+ . may_load ( deps. storage ) ?)
1236
+ . unwrap_or ( 0 )
1237
+ + ( WHITELIST_TS_MINTER_ADDRS
1238
+ . key ( & addr)
1239
+ . may_load ( deps. storage ) ?)
1240
+ . unwrap_or ( 0 ) ;
1229
1241
Ok ( MintCountResponse {
1230
1242
address : addr. to_string ( ) ,
1231
1243
count : mint_count,
1232
- whitelist_count : whitelist_mint_count ,
1244
+ whitelist_count : standard_wl_count + tiered_wl_count ,
1233
1245
} )
1234
1246
}
1235
1247
Original file line number Diff line number Diff line change @@ -1223,12 +1223,26 @@ pub fn query_status(deps: Deps) -> StdResult<StatusResponse> {
1223
1223
fn query_mint_count ( deps : Deps , address : String ) -> StdResult < MintCountResponse > {
1224
1224
let addr = deps. api . addr_validate ( & address) ?;
1225
1225
let mint_count = ( MINTER_ADDRS . key ( & addr) . may_load ( deps. storage ) ?) . unwrap_or ( 0 ) ;
1226
- let whitelist_mint_count =
1226
+
1227
+ let standard_wl_count =
1227
1228
( WHITELIST_MINTER_ADDRS . key ( & addr) . may_load ( deps. storage ) ?) . unwrap_or ( 0 ) ;
1229
+ let tiered_wl_count = ( WHITELIST_FS_MINTER_ADDRS
1230
+ . key ( & addr)
1231
+ . may_load ( deps. storage ) ?)
1232
+ . unwrap_or ( 0 )
1233
+ + ( WHITELIST_SS_MINTER_ADDRS
1234
+ . key ( & addr)
1235
+ . may_load ( deps. storage ) ?)
1236
+ . unwrap_or ( 0 )
1237
+ + ( WHITELIST_TS_MINTER_ADDRS
1238
+ . key ( & addr)
1239
+ . may_load ( deps. storage ) ?)
1240
+ . unwrap_or ( 0 ) ;
1241
+
1228
1242
Ok ( MintCountResponse {
1229
1243
address : addr. to_string ( ) ,
1230
1244
count : mint_count,
1231
- whitelist_count : whitelist_mint_count ,
1245
+ whitelist_count : standard_wl_count + tiered_wl_count ,
1232
1246
} )
1233
1247
}
1234
1248
Original file line number Diff line number Diff line change @@ -1254,9 +1254,23 @@ pub fn query_status(deps: Deps) -> StdResult<StatusResponse> {
1254
1254
fn query_mint_count ( deps : Deps , address : String ) -> StdResult < MintCountResponse > {
1255
1255
let addr = deps. api . addr_validate ( & address) ?;
1256
1256
let mint_count = ( MINTER_ADDRS . key ( & addr) . may_load ( deps. storage ) ?) . unwrap_or ( 0 ) ;
1257
+ let standard_wl_count =
1258
+ ( WHITELIST_MINTER_ADDRS . key ( & addr) . may_load ( deps. storage ) ?) . unwrap_or ( 0 ) ;
1259
+ let tiered_wl_count = ( WHITELIST_FS_MINTER_ADDRS
1260
+ . key ( & addr)
1261
+ . may_load ( deps. storage ) ?)
1262
+ . unwrap_or ( 0 )
1263
+ + ( WHITELIST_SS_MINTER_ADDRS
1264
+ . key ( & addr)
1265
+ . may_load ( deps. storage ) ?)
1266
+ . unwrap_or ( 0 )
1267
+ + ( WHITELIST_TS_MINTER_ADDRS
1268
+ . key ( & addr)
1269
+ . may_load ( deps. storage ) ?)
1270
+ . unwrap_or ( 0 ) ;
1257
1271
Ok ( MintCountResponse {
1258
1272
address : addr. to_string ( ) ,
1259
- count : mint_count,
1273
+ count : mint_count + standard_wl_count + tiered_wl_count ,
1260
1274
} )
1261
1275
}
1262
1276
Original file line number Diff line number Diff line change @@ -321,14 +321,21 @@ fn whitelist_mint_count_query() {
321
321
assert_eq ! ( res. count, 3 ) ;
322
322
assert_eq ! ( res. address, buyer. to_string( ) ) ;
323
323
324
- // Mint fails
324
+ // Public Mint
325
325
let mint_msg = ExecuteMsg :: Mint { } ;
326
+ let _res = router. execute_contract (
327
+ buyer. clone ( ) ,
328
+ minter_addr. clone ( ) ,
329
+ & mint_msg,
330
+ & coins ( 100_000_000 , NATIVE_DENOM ) ,
331
+ ) ;
332
+ // Next Mint fails
326
333
let err = router
327
334
. execute_contract (
328
335
buyer. clone ( ) ,
329
336
minter_addr. clone ( ) ,
330
337
& mint_msg,
331
- & coins ( WHITELIST_AMOUNT , NATIVE_DENOM ) ,
338
+ & coins ( 100_000_000 , NATIVE_DENOM ) ,
332
339
)
333
340
. unwrap_err ( ) ;
334
341
assert_eq ! (
@@ -346,7 +353,7 @@ fn whitelist_mint_count_query() {
346
353
} ,
347
354
)
348
355
. unwrap ( ) ;
349
- assert_eq ! ( res. count, 3 ) ;
356
+ assert_eq ! ( res. count, 4 ) ;
350
357
assert_eq ! ( res. address, buyer. to_string( ) ) ;
351
358
}
352
359
You can’t perform that action at this time.
0 commit comments