diff --git a/Cargo.lock b/Cargo.lock index ba4f328..99830e2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -173,7 +173,7 @@ dependencies = [ [[package]] name = "asset-classification-smart-contract" -version = "3.4.0" +version = "3.4.1" dependencies = [ "bech32 0.8.1", "cosmwasm-schema", diff --git a/Cargo.toml b/Cargo.toml index 10bb074..32c112f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "asset-classification-smart-contract" -version = "3.4.0" +version = "3.4.1" authors = [ "Jake Schwartz ", "Pierce Trey ", diff --git a/src/core/state.rs b/src/core/state.rs index 4b9de0a..890f580 100644 --- a/src/core/state.rs +++ b/src/core/state.rs @@ -9,7 +9,7 @@ use serde::{Deserialize, Serialize}; use super::error::ContractError; -const STATE_V2_KEY: &str = "state_v2"; +const STATE_V2_KEY: &str = "\x00\x08state_v2"; // Special characters added to allow seamless upgrade from cosmwasm-storage to cw-storage-plus pub const STATE_V2: Item = Item::new(STATE_V2_KEY); const FEE_PAYMENT_DETAIL_NAMESPACE: &str = "fee_payment_detail"; @@ -564,4 +564,14 @@ mod tests { err, ); } + + #[test] + fn test_basic_state_key_is_expected_value() { + assert_eq!( + "000873746174655f7632", + cosmwasm_std::to_hex(crate::core::state::STATE_V2_KEY.as_bytes()) + .as_str() + .to_lowercase() + ); + } } diff --git a/tests/integration_tests.rs b/tests/integration_tests.rs index f18da37..1e1d753 100644 --- a/tests/integration_tests.rs +++ b/tests/integration_tests.rs @@ -32,8 +32,8 @@ use uuid::Uuid; fn get_contract_wasm_bytes() -> &'static Vec { use std::sync::OnceLock; - static OPTIMIZED_CONTRACT_WASM_PATH: OnceLock> = OnceLock::new(); - OPTIMIZED_CONTRACT_WASM_PATH.get_or_init(|| { + static OPTIMIZED_CONTRACT_WASM: OnceLock> = OnceLock::new(); + OPTIMIZED_CONTRACT_WASM.get_or_init(|| { let file_path = std::env::var("OPTIMIZED_CONTRACT_WASM_PATH").unwrap_or(String::from( "./artifacts/asset_classification_smart_contract.wasm", )); @@ -62,9 +62,8 @@ fn happy_path_onboard_and_verify_asset() { }); let wasm = Wasm::new(&app); - let wasm_byte_code = get_contract_wasm_bytes(); let store_res = wasm - .store_code(&wasm_byte_code, None, admin) + .store_code(get_contract_wasm_bytes(), None, admin) .expect("storing the WASM code should succeed"); let code_id = store_res.data.code_id; assert_eq!(code_id, 1);