From 85f72be4ef55d532c7a397303e075e172cca172b Mon Sep 17 00:00:00 2001 From: caitlyNFT Date: Tue, 14 Nov 2023 19:55:24 -0500 Subject: [PATCH 1/3] allowed testing of anyone can mint --- src/contract.rs | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/src/contract.rs b/src/contract.rs index f5f89789..d51068c4 100644 --- a/src/contract.rs +++ b/src/contract.rs @@ -837,12 +837,12 @@ fn try_mint( )); } - let minters = MintersStore::load(deps.storage)?; - if !minters.contains(&info.sender) { - return Err(StdError::generic_err( - "Minting is allowed to minter accounts only", - )); - } + // let minters = MintersStore::load(deps.storage)?; + // if !minters.contains(&info.sender) { + // return Err(StdError::generic_err( + // "Minting is allowed to minter accounts only", + // )); + // } let mut total_supply = TOTAL_SUPPLY.load(deps.storage)?; let minted_amount = safe_add(&mut total_supply, amount.u128()); @@ -4272,8 +4272,8 @@ mod tests { let handle_result = execute(deps.as_mut(), mock_env(), info, handle_msg); - let error = extract_error_msg(handle_result); - assert!(error.contains("allowed to minter accounts only")); + // let error = extract_error_msg(handle_result); + // assert!(error.contains("allowed to minter accounts only")); } #[test] @@ -4439,8 +4439,8 @@ mod tests { let handle_result = execute(deps.as_mut(), mock_env(), info, handle_msg); - let error = extract_error_msg(handle_result); - assert!(error.contains("allowed to minter accounts only")); + // let error = extract_error_msg(handle_result); + // assert!(error.contains("allowed to minter accounts only")); let handle_msg = ExecuteMsg::Mint { recipient: "bob".to_string(), @@ -4454,8 +4454,8 @@ mod tests { let handle_result = execute(deps.as_mut(), mock_env(), info, handle_msg); - let error = extract_error_msg(handle_result); - assert!(error.contains("allowed to minter accounts only")); + // let error = extract_error_msg(handle_result); + // assert!(error.contains("allowed to minter accounts only")); // Removing another extra time to ensure nothing funky happens let handle_msg = ExecuteMsg::RemoveMinters { @@ -4480,8 +4480,8 @@ mod tests { let handle_result = execute(deps.as_mut(), mock_env(), info, handle_msg); - let error = extract_error_msg(handle_result); - assert!(error.contains("allowed to minter accounts only")); + // let error = extract_error_msg(handle_result); + // assert!(error.contains("allowed to minter accounts only")); let handle_msg = ExecuteMsg::Mint { recipient: "bob".to_string(), @@ -4495,8 +4495,8 @@ mod tests { let handle_result = execute(deps.as_mut(), mock_env(), info, handle_msg); - let error = extract_error_msg(handle_result); - assert!(error.contains("allowed to minter accounts only")); + // let error = extract_error_msg(handle_result); + // assert!(error.contains("allowed to minter accounts only")); } // Query tests From 72240293f7fcd40b5b9a2a6c9a9f79a1e6d653e0 Mon Sep 17 00:00:00 2001 From: KennySwayzee93 <111819113+KennySwayzee93@users.noreply.github.com> Date: Thu, 16 Nov 2023 14:39:31 -0500 Subject: [PATCH 2/3] add build mainnet --- Makefile | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Makefile b/Makefile index eee79095..927f35e9 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,12 @@ SECRETCLI = docker exec -it secretdev /usr/bin/secretcli +# This is a build suitable for uploading to mainnet. +# Calls to `debug_print` get removed by the compiler. +.PHONY: build-mainnet _build-mainnet +build-mainnet: _build-mainnet compress-wasm +_build-mainnet: + RUSTFLAGS='-C link-arg=-s' cargo build --release --target wasm32-unknown-unknown + .PHONY: all all: clippy test From bdeff303973f64885fde51fe752cc50a1e53ddea Mon Sep 17 00:00:00 2001 From: KennySwayzee93 <111819113+KennySwayzee93@users.noreply.github.com> Date: Thu, 16 Nov 2023 14:40:25 -0500 Subject: [PATCH 3/3] add compress wasm --- Makefile | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Makefile b/Makefile index 927f35e9..04b3a8c5 100644 --- a/Makefile +++ b/Makefile @@ -7,6 +7,13 @@ build-mainnet: _build-mainnet compress-wasm _build-mainnet: RUSTFLAGS='-C link-arg=-s' cargo build --release --target wasm32-unknown-unknown +.PHONY: compress-wasm +compress-wasm: + cp ./target/wasm32-unknown-unknown/release/*.wasm ./contract.wasm + @## The following line is not necessary, may work only on linux (extra size optimization) + @# wasm-opt -Os ./contract.wasm -o ./contract.wasm + cat ./contract.wasm | gzip -9 > ./contract.wasm.gz + .PHONY: all all: clippy test