Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open Edition minter update & tests #629

Merged
merged 3 commits into from
Jan 25, 2024
Merged

Conversation

MightOfOaks
Copy link
Member

Allows the user to set a limit for the number of tokens instead of a limit for minting end time.

Copy link

codecov bot commented Dec 7, 2023

Codecov Report

Attention: 26 lines in your changes are missing coverage. Please review.

Comparison is base (f4f6e82) 60.07% compared to head (451c6ac) 60.10%.

Files Patch % Lines
...tracts/minters/open-edition-minter/src/contract.rs 60.31% 25 Missing ⚠️
test-suite/src/common_setup/templates.rs 92.85% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #629      +/-   ##
==========================================
+ Coverage   60.07%   60.10%   +0.03%     
==========================================
  Files          83       83              
  Lines        4518     4582      +64     
==========================================
+ Hits         2714     2754      +40     
- Misses       1804     1828      +24     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

github-actions bot commented Dec 7, 2023

Cosm-Orc Gas Usage

Contract Op Name Gas Used Old Gas Used Gas Diff File
multiple_contracts Execute__minter_batch_exec_mint_token_w_trading_time 3159541 1949067 +62.1053% e2e/src/tests/open_edition_factory_and_mint_tests.rs:497
multiple_contracts Execute__minter_batch_exec_mint_token 3158256 18825195 -83.2232% e2e/src/tests/open_edition_factory_and_mint_tests.rs:276
minter Execute__minter_exec_purge 140238 139023 +0.8740% e2e/src/tests/open_edition_minter_executes_tests.rs:282
open_edition_factory Execute__factory_exec_minter_inst 547388 542162 +0.9639% e2e/src/tests/open_edition_factory_and_mint_tests.rs:206
open_edition_factory Instantiate__factory_inst 188097 186484 +0.8650% e2e/src/helpers/open_edition_minter_helpers.rs:39
open_edition_factory Store__Store 3490988 3469044 +0.6326% e2e/src/helpers/chain.rs:78
open_edition_factory Execute__factory_exec_minter_inst_w_trading_time 548103 542877 +0.9626% e2e/src/tests/open_edition_factory_and_mint_tests.rs:411
open_edition_minter Store__Store 8616616 8508482 +1.2709% e2e/src/helpers/chain.rs:78
Raw Report for 451c6ac
Contract Op Name Gas Used Gas Wanted File
multiple_contracts Execute__minter_batch_exec_mint_token_w_trading_time 3159541 4716444 e2e/src/tests/open_edition_factory_and_mint_tests.rs:497
multiple_contracts Execute__minter_batch_exec_mint_token 3158256 4714526 e2e/src/tests/open_edition_factory_and_mint_tests.rs:276
vending_factory Execute__factory_exec_minter_inst_w_trading_time 3858141 5764011 e2e/src/tests/factory_test.rs:244
vending_factory Instantiate__factory_inst 187243 257748 e2e/src/helpers/helper.rs:35
vending_factory Execute__factory_exec_minter_inst 34037933 51033699 e2e/src/tests/factory_test.rs:98
vending_factory Store__Store 3067318 4577837 e2e/src/helpers/chain.rs:78
minter Execute__minter_exec_mint_to_token 365538 525183 e2e/src/tests/open_edition_minter_executes_tests.rs:181
minter Execute__minter_exec_purge 140238 187289 e2e/src/tests/open_edition_minter_executes_tests.rs:282
minter Execute__minter_exec_update_per_addr_limit 209841 291644 e2e/src/tests/open_edition_minter_executes_tests.rs:217
minter Execute__minter_exec_update_trading_time 271488 384113 e2e/src/tests/open_edition_minter_executes_tests.rs:100
open_edition_factory Execute__factory_exec_minter_inst 547388 797955 e2e/src/tests/open_edition_factory_and_mint_tests.rs:206
open_edition_factory Instantiate__factory_inst 188097 259029 e2e/src/helpers/open_edition_minter_helpers.rs:39
open_edition_factory Store__Store 3490988 5213342 e2e/src/helpers/chain.rs:78
open_edition_factory Execute__factory_exec_minter_inst_w_trading_time 548103 799028 e2e/src/tests/open_edition_factory_and_mint_tests.rs:411
base_factory Store__Store 2688056 4008944 e2e/src/helpers/chain.rs:78
base_minter Store__Store 7008685 10489827 e2e/src/helpers/chain.rs:78
open_edition_minter Store__Store 8616616 12901724 e2e/src/helpers/chain.rs:78
sg721_base Store__Store 8395174 12569561 e2e/src/helpers/chain.rs:78
sg721_metadata_onchain Store__Store 8824616 13213724 e2e/src/helpers/chain.rs:78
sg721_nt Store__Store 7794873 11669109 e2e/src/helpers/chain.rs:78
sg721_updatable Store__Store 9187908 13758657 e2e/src/helpers/chain.rs:78
sg_whitelist Store__Store 3603321 5381841 e2e/src/helpers/chain.rs:78
sg_whitelist_flex Store__Store 3539283 5285784 e2e/src/helpers/chain.rs:78
vending_minter Store__Store 8839098 13235447 e2e/src/helpers/chain.rs:78
vending_minter_wl_flex Store__Store 9037322 13532783 e2e/src/helpers/chain.rs:78
whitelist_immutable Store__Store 2197332 3272858 e2e/src/helpers/chain.rs:78

@@ -193,10 +200,20 @@ pub fn execute_purge(
info: MessageInfo,
) -> Result<Response, ContractError> {
nonpayable(&info)?;
// Check if mint has ended
// check if sold out (optional)
let mintable_num_tokens = MINTABLE_NUM_TOKENS.may_load(deps.storage)?;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so what if it's ended but not sold out?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mintable_num_tokens is only Some when there is no end time defined (as per instantiation), so the minting cannot be time limited in this case.

@@ -11,8 +11,9 @@ pub struct ConfigExtension {
pub payment_address: Option<Addr>,
pub nft_data: NftData,
pub start_time: Timestamp,
pub end_time: Timestamp,
pub end_time: Option<Timestamp>,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

curious if this will cause errors on read

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The contract will be used for new open edition collections onwards without any migrations. It could cause indexing errors though if not accounted for.

@jhernandezb jhernandezb merged commit 15d2990 into main Jan 25, 2024
@jhernandezb jhernandezb deleted the serkan/oe-update-tests branch February 6, 2025 18:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants