From d671c00defe308b244086f681da3dec1b55f8c23 Mon Sep 17 00:00:00 2001 From: Joe Monem Date: Tue, 2 Apr 2024 08:27:03 +0300 Subject: [PATCH 1/3] crowdfund's end_time in start_sale is now in Milliseconds instead of Expiration --- .../andromeda-crowdfund/src/contract.rs | 22 ++++++++------- .../andromeda-crowdfund/src/mock.rs | 3 +-- .../andromeda-crowdfund/src/testing/tests.rs | 27 +++++++++---------- .../src/crowdfund.rs | 2 +- 4 files changed, 26 insertions(+), 28 deletions(-) diff --git a/contracts/non-fungible-tokens/andromeda-crowdfund/src/contract.rs b/contracts/non-fungible-tokens/andromeda-crowdfund/src/contract.rs index fafad9c9a..70aa49159 100644 --- a/contracts/non-fungible-tokens/andromeda-crowdfund/src/contract.rs +++ b/contracts/non-fungible-tokens/andromeda-crowdfund/src/contract.rs @@ -11,7 +11,11 @@ use andromeda_non_fungible_tokens::{ use andromeda_std::{ ado_base::ownership::OwnershipMessage, amp::{messages::AMPPkt, recipient::Recipient, AndrAddr}, - common::{actions::call_action, expiration::get_and_validate_start_time, Milliseconds}, + common::{ + actions::call_action, + expiration::{expiration_from_milliseconds, get_and_validate_start_time}, + Milliseconds, + }, }; use andromeda_std::{ado_contract::ADOContract, common::context::ExecuteContext}; @@ -30,7 +34,7 @@ use cosmwasm_std::{ Order, QuerierWrapper, QueryRequest, Reply, Response, StdError, Storage, SubMsg, Uint128, WasmMsg, WasmQuery, }; -use cw721::{ContractInfoResponse, Expiration, TokensResponse}; +use cw721::{ContractInfoResponse, TokensResponse}; use cw_utils::nonpayable; use std::cmp; @@ -286,7 +290,7 @@ fn execute_update_token_contract( fn execute_start_sale( ctx: ExecuteContext, start_time: Option, - end_time: Expiration, + end_time: Milliseconds, price: Coin, min_tokens_sold: Uint128, max_amount_per_wallet: Option, @@ -307,14 +311,12 @@ fn execute_start_sale( // If start time wasn't provided, it will be set as the current_time let (start_expiration, _current_time) = get_and_validate_start_time(&env, start_time)?; + let end_expiration = expiration_from_milliseconds(end_time)?; + ensure!( - end_time > start_expiration, + end_expiration > start_expiration, ContractError::StartTimeAfterEndTime {} ); - ensure!( - !matches!(end_time, Expiration::Never {}), - ContractError::ExpirationMustNotBeNever {} - ); SALE_CONDUCTED.save(deps.storage, &true)?; let state = STATE.may_load(deps.storage)?; @@ -326,7 +328,7 @@ fn execute_start_sale( STATE.save( deps.storage, &State { - end_time, + end_time: end_expiration, price, min_tokens_sold, max_amount_per_wallet, @@ -342,7 +344,7 @@ fn execute_start_sale( Ok(Response::new() .add_attribute("action", "start_sale") .add_attribute("start_time", start_expiration.to_string()) - .add_attribute("end_time", end_time.to_string()) + .add_attribute("end_time", end_expiration.to_string()) .add_attribute("price", price_str) .add_attribute("min_tokens_sold", min_tokens_sold) .add_attribute("max_amount_per_wallet", max_amount_per_wallet.to_string())) diff --git a/contracts/non-fungible-tokens/andromeda-crowdfund/src/mock.rs b/contracts/non-fungible-tokens/andromeda-crowdfund/src/mock.rs index baa4c7e3f..8e81de2a6 100644 --- a/contracts/non-fungible-tokens/andromeda-crowdfund/src/mock.rs +++ b/contracts/non-fungible-tokens/andromeda-crowdfund/src/mock.rs @@ -8,7 +8,6 @@ use andromeda_non_fungible_tokens::{ use andromeda_std::{ado_base::modules::Module, amp::AndrAddr}; use andromeda_std::{amp::Recipient, common::Milliseconds}; use cosmwasm_std::{Coin, Empty, Uint128}; -use cw721::Expiration; use cw_multi_test::{Contract, ContractWrapper}; pub fn mock_andromeda_crowdfund() -> Box> { @@ -34,7 +33,7 @@ pub fn mock_crowdfund_instantiate_msg( pub fn mock_start_crowdfund_msg( start_time: Option, - end_time: Expiration, + end_time: Milliseconds, price: Coin, min_tokens_sold: Uint128, max_amount_per_wallet: Option, diff --git a/contracts/non-fungible-tokens/andromeda-crowdfund/src/testing/tests.rs b/contracts/non-fungible-tokens/andromeda-crowdfund/src/testing/tests.rs index 6e7108f28..518b0294e 100644 --- a/contracts/non-fungible-tokens/andromeda-crowdfund/src/testing/tests.rs +++ b/contracts/non-fungible-tokens/andromeda-crowdfund/src/testing/tests.rs @@ -28,8 +28,7 @@ use andromeda_testing::economics_msg::generate_economics_message; use cosmwasm_std::{ coin, coins, from_json, testing::{mock_env, mock_info}, - Addr, BankMsg, Coin, CosmosMsg, DepsMut, Response, StdError, SubMsg, Timestamp, Uint128, - WasmMsg, + Addr, BankMsg, Coin, CosmosMsg, DepsMut, Response, StdError, SubMsg, Uint128, WasmMsg, }; use cw_utils::Expiration; @@ -186,7 +185,7 @@ fn test_mint_sale_started() { let msg = ExecuteMsg::StartSale { start_time: None, - end_time: Expiration::AtTime(Timestamp::from_nanos((current_time + 2) * 1_000_000)), + end_time: Milliseconds::from_nanos((current_time + 2) * 1_000_000), price: coin(100, "uusd"), min_tokens_sold: Uint128::from(1u128), max_amount_per_wallet: Some(5), @@ -372,7 +371,7 @@ fn test_mint_multiple_exceeds_limit() { } #[test] -fn test_start_sale_end_time_never() { +fn test_start_sale_end_time_zero() { let mut deps = mock_dependencies_custom(&[]); init(deps.as_mut(), None); let one_minute_in_future = @@ -380,7 +379,7 @@ fn test_start_sale_end_time_never() { let msg = ExecuteMsg::StartSale { start_time: Some(Milliseconds(one_minute_in_future)), - end_time: Expiration::Never {}, + end_time: Milliseconds::zero(), price: coin(100, "uusd"), min_tokens_sold: Uint128::from(1u128), max_amount_per_wallet: None, @@ -389,7 +388,7 @@ fn test_start_sale_end_time_never() { let info = mock_info("owner", &[]); let res = execute(deps.as_mut(), mock_env(), info, msg); - assert_eq!(ContractError::ExpirationMustNotBeNever {}, res.unwrap_err()); + assert_eq!(ContractError::StartTimeAfterEndTime {}, res.unwrap_err()); } #[test] @@ -400,7 +399,7 @@ fn test_start_sale_unauthorized() { let msg = ExecuteMsg::StartSale { start_time: None, - end_time: Expiration::AtTime(Timestamp::from_nanos((current_time + 1) * 1_000_000)), + end_time: Milliseconds::from_nanos((current_time + 1) * 1_000_000), price: coin(100, "uusd"), min_tokens_sold: Uint128::from(1u128), max_amount_per_wallet: None, @@ -422,7 +421,7 @@ fn test_start_sale_start_time_in_past() { let one_minute_in_past = env.block.time.minus_minutes(1).seconds(); let msg = ExecuteMsg::StartSale { start_time: Some(Milliseconds(one_minute_in_past)), - end_time: Expiration::AtTime(Timestamp::from_nanos((current_time + 2) * 1_000_000)), + end_time: Milliseconds::from_nanos((current_time + 2) * 1_000_000), price: coin(100, "uusd"), min_tokens_sold: Uint128::from(1u128), max_amount_per_wallet: None, @@ -450,9 +449,7 @@ fn test_start_sale_start_time_in_future() { env.block.time.plus_minutes(1).nanos() / MILLISECONDS_TO_NANOSECONDS_RATIO; let msg = ExecuteMsg::StartSale { start_time: Some(Milliseconds(one_minute_in_future)), - end_time: Expiration::AtTime(Timestamp::from_nanos( - (one_minute_in_future + 2) * 1_000_000, - )), + end_time: Milliseconds::from_nanos((one_minute_in_future + 2) * 1_000_000), price: coin(100, "uusd"), min_tokens_sold: Uint128::from(1u128), max_amount_per_wallet: None, @@ -472,7 +469,7 @@ fn test_start_sale_max_default() { let msg = ExecuteMsg::StartSale { start_time: None, - end_time: Expiration::AtTime(Timestamp::from_nanos((current_time + 2) * 1_000_000)), + end_time: Milliseconds::from_nanos((current_time + 2) * 1_000_000), price: coin(100, "uusd"), min_tokens_sold: Uint128::from(1u128), max_amount_per_wallet: None, @@ -526,7 +523,7 @@ fn test_start_sale_max_modified() { let msg = ExecuteMsg::StartSale { start_time: None, - end_time: Expiration::AtTime(Timestamp::from_nanos((current_time + 2) * 1_000_000)), + end_time: Milliseconds::from_nanos((current_time + 2) * 1_000_000), price: coin(100, "uusd"), min_tokens_sold: Uint128::from(1u128), max_amount_per_wallet: Some(5), @@ -1197,7 +1194,7 @@ fn test_integration_conditions_not_met() { let msg = ExecuteMsg::StartSale { start_time: None, - end_time: Expiration::AtTime(Timestamp::from_nanos((current_time + 2) * 1_000_000)), + end_time: Milliseconds::from_nanos((current_time + 2) * 1_000_000), price: coin(100, "uusd"), min_tokens_sold: Uint128::from(5u128), max_amount_per_wallet: Some(2), @@ -1376,7 +1373,7 @@ fn test_integration_conditions_met() { let msg = ExecuteMsg::StartSale { start_time: None, - end_time: Expiration::AtTime(Timestamp::from_nanos((current_time + 2) * 1_000_000)), + end_time: Milliseconds::from_nanos((current_time + 2) * 1_000_000), price: coin(100, "uusd"), min_tokens_sold: Uint128::from(3u128), max_amount_per_wallet: Some(2), diff --git a/packages/andromeda-non-fungible-tokens/src/crowdfund.rs b/packages/andromeda-non-fungible-tokens/src/crowdfund.rs index 4706f4005..13dd8663b 100644 --- a/packages/andromeda-non-fungible-tokens/src/crowdfund.rs +++ b/packages/andromeda-non-fungible-tokens/src/crowdfund.rs @@ -24,7 +24,7 @@ pub enum ExecuteMsg { /// When the sale start. Defaults to current time. start_time: Option, /// When the sale ends. - end_time: Expiration, + end_time: Milliseconds, /// The price per token. price: Coin, /// The minimum amount of tokens sold to go through with the sale. From e78873a4be56c0acab8c4d15140bcd19ff4113f7 Mon Sep 17 00:00:00 2001 From: Joe Monem Date: Tue, 2 Apr 2024 08:55:07 +0300 Subject: [PATCH 2/3] replaced auction's duration with end_time --- .../andromeda-auction/src/contract.rs | 42 +++++++++---------- .../andromeda-auction/src/mock.rs | 4 +- .../andromeda-auction/src/testing/tests.rs | 42 ++++++++++--------- .../src/auction.rs | 4 +- tests-integration/tests/crowdfund_app.rs | 8 ++-- 5 files changed, 49 insertions(+), 51 deletions(-) diff --git a/contracts/non-fungible-tokens/andromeda-auction/src/contract.rs b/contracts/non-fungible-tokens/andromeda-auction/src/contract.rs index 7ef5403ce..56d7089a1 100644 --- a/contracts/non-fungible-tokens/andromeda-auction/src/contract.rs +++ b/contracts/non-fungible-tokens/andromeda-auction/src/contract.rs @@ -127,7 +127,7 @@ pub fn handle_execute(mut ctx: ExecuteContext, msg: ExecuteMsg) -> Result Result, - duration: Milliseconds, + end_time: Milliseconds, coin_denom: String, whitelist: Option>, min_bid: Option, ) -> Result { validate_denom(&ctx.deps.querier, coin_denom.clone())?; - ensure!(!duration.is_zero(), ContractError::InvalidExpiration {}); let ExecuteContext { deps, info, env, .. } = ctx; // If start time wasn't provided, it will be set as the current_time - let (start_expiration, current_time) = get_and_validate_start_time(&env, start_time)?; + let (start_expiration, _current_time) = get_and_validate_start_time(&env, start_time)?; + let end_expiration = expiration_from_milliseconds(end_time)?; - let end_expiration = expiration_from_milliseconds( - start_time - .unwrap_or(current_time) - .plus_milliseconds(duration), - )?; + ensure!( + end_expiration > start_expiration, + ContractError::StartTimeAfterEndTime {} + ); let token_address = info.sender.to_string(); @@ -277,7 +276,7 @@ fn execute_update_auction( token_id: String, token_address: String, start_time: Option, - duration: Milliseconds, + end_time: Milliseconds, coin_denom: String, whitelist: Option>, min_bid: Option, @@ -297,19 +296,16 @@ fn execute_update_auction( !token_auction_state.start_time.is_expired(&env.block), ContractError::AuctionAlreadyStarted {} ); - ensure!( - duration > Milliseconds::zero(), - ContractError::InvalidExpiration {} - ); + ensure!(!end_time.is_zero(), ContractError::InvalidExpiration {}); // If start time wasn't provided, it will be set as the current_time - let (start_expiration, current_time) = get_and_validate_start_time(&env, start_time)?; + let (start_expiration, _current_time) = get_and_validate_start_time(&env, start_time)?; + let end_expiration = expiration_from_milliseconds(end_time)?; - let end_expiration = expiration_from_milliseconds( - start_time - .unwrap_or(current_time) - .plus_milliseconds(duration), - )?; + ensure!( + end_expiration > start_expiration, + ContractError::StartTimeAfterEndTime {} + ); token_auction_state.start_time = start_expiration; token_auction_state.end_time = end_expiration; diff --git a/contracts/non-fungible-tokens/andromeda-auction/src/mock.rs b/contracts/non-fungible-tokens/andromeda-auction/src/mock.rs index 8658c9951..9ba606ee9 100644 --- a/contracts/non-fungible-tokens/andromeda-auction/src/mock.rs +++ b/contracts/non-fungible-tokens/andromeda-auction/src/mock.rs @@ -31,14 +31,14 @@ pub fn mock_auction_instantiate_msg( pub fn mock_start_auction( start_time: Option, - duration: Milliseconds, + end_time: Milliseconds, coin_denom: String, min_bid: Option, whitelist: Option>, ) -> Cw721HookMsg { Cw721HookMsg::StartAuction { start_time, - duration, + end_time, coin_denom, min_bid, whitelist, diff --git a/contracts/non-fungible-tokens/andromeda-auction/src/testing/tests.rs b/contracts/non-fungible-tokens/andromeda-auction/src/testing/tests.rs index 5c8a78492..e887be233 100644 --- a/contracts/non-fungible-tokens/andromeda-auction/src/testing/tests.rs +++ b/contracts/non-fungible-tokens/andromeda-auction/src/testing/tests.rs @@ -52,10 +52,14 @@ fn query_latest_auction_state_helper(deps: Deps, env: Env) -> AuctionStateRespon from_json(query(deps, env, query_msg).unwrap()).unwrap() } +fn current_time() -> u64 { + mock_env().block.time.nanos() / MILLISECONDS_TO_NANOSECONDS_RATIO +} + fn start_auction(deps: DepsMut, whitelist: Option>, min_bid: Option) { let hook_msg = Cw721HookMsg::StartAuction { start_time: None, - duration: Milliseconds(10_000), + end_time: Milliseconds::from_nanos((current_time() + 20_000_000) * 1_000_000), coin_denom: "uusd".to_string(), whitelist, min_bid, @@ -73,7 +77,7 @@ fn start_auction(deps: DepsMut, whitelist: Option>, min_bid: Option>, min_bid: Option) { let current_time = mock_env().block.time.nanos() / MILLISECONDS_TO_NANOSECONDS_RATIO; - let duration = 10_000; + let duration = 20_000_000; assert_eq!( TokenAuctionState { start_time: Expiration::AtTime(Timestamp::from_nanos((current_time + 1) * 1_000_000)), @@ -350,7 +354,7 @@ fn execute_place_bid_multiple_bids() { ); let mut expected_response = AuctionStateResponse { start_time: Expiration::AtTime(Timestamp::from_nanos(1571797419880000000)), - end_time: Expiration::AtTime(Timestamp::from_nanos(1571797429879000000)), + end_time: Expiration::AtTime(Timestamp::from_nanos(1571817419879000000)), high_bidder_addr: "sender".to_string(), high_bidder_amount: Uint128::from(100u128), auction_id: Uint128::from(1u128), @@ -550,7 +554,7 @@ fn execute_start_auction_start_time_in_past() { let hook_msg = Cw721HookMsg::StartAuction { start_time: Some(Milliseconds(100000)), - duration: Milliseconds(100000), + end_time: Milliseconds(100000), coin_denom: "uusd".to_string(), whitelist: None, min_bid: None, @@ -581,7 +585,7 @@ fn execute_start_auction_zero_start_time() { let hook_msg = Cw721HookMsg::StartAuction { start_time: Some(Milliseconds::zero()), - duration: Milliseconds(1), + end_time: Milliseconds(1), coin_denom: "uusd".to_string(), whitelist: None, min_bid: None, @@ -611,7 +615,7 @@ fn execute_start_auction_start_time_not_provided() { let hook_msg = Cw721HookMsg::StartAuction { start_time: None, - duration: Milliseconds(1), + end_time: Milliseconds::from_nanos((current_time() + 20_000_000) * 1_000_000), coin_denom: "uusd".to_string(), whitelist: None, min_bid: None, @@ -634,7 +638,7 @@ fn execute_start_auction_zero_duration() { let hook_msg = Cw721HookMsg::StartAuction { start_time: Some(Milliseconds(100)), - duration: Milliseconds::zero(), + end_time: Milliseconds::zero(), coin_denom: "uusd".to_string(), whitelist: None, min_bid: None, @@ -650,7 +654,7 @@ fn execute_start_auction_zero_duration() { let info = mock_info(MOCK_TOKEN_ADDR, &[]); let res = execute(deps.as_mut(), env, info, msg); - assert_eq!(ContractError::InvalidExpiration {}, res.unwrap_err()); + assert_eq!(ContractError::StartTimeAfterEndTime {}, res.unwrap_err()); } // #[test] @@ -693,7 +697,7 @@ fn execute_update_auction_zero_start() { token_id: MOCK_UNCLAIMED_TOKEN.to_owned(), token_address: MOCK_TOKEN_ADDR.to_string(), start_time: Some(Milliseconds::zero()), - duration: Milliseconds(1), + end_time: Milliseconds(1), coin_denom: "uusd".to_string(), whitelist: None, min_bid: None, @@ -724,7 +728,7 @@ fn execute_update_auction_zero_duration() { token_id: MOCK_UNCLAIMED_TOKEN.to_owned(), token_address: MOCK_TOKEN_ADDR.to_string(), start_time: Some(Milliseconds(100000)), - duration: Milliseconds::zero(), + end_time: Milliseconds::zero(), coin_denom: "uusd".to_string(), whitelist: None, min_bid: None, @@ -749,7 +753,7 @@ fn execute_update_auction_unauthorized() { token_id: MOCK_UNCLAIMED_TOKEN.to_owned(), token_address: MOCK_TOKEN_ADDR.to_string(), start_time: Some(Milliseconds(100000)), - duration: Milliseconds(100), + end_time: Milliseconds(100), coin_denom: "uluna".to_string(), whitelist: Some(vec![Addr::unchecked("user")]), min_bid: None, @@ -772,7 +776,7 @@ fn execute_update_auction_auction_started() { token_id: MOCK_UNCLAIMED_TOKEN.to_owned(), token_address: MOCK_TOKEN_ADDR.to_string(), start_time: Some(Milliseconds(100000)), - duration: Milliseconds(100), + end_time: Milliseconds(100), coin_denom: "uluna".to_string(), whitelist: Some(vec![Addr::unchecked("user")]), min_bid: None, @@ -797,7 +801,7 @@ fn execute_update_auction() { token_id: MOCK_UNCLAIMED_TOKEN.to_owned(), token_address: MOCK_TOKEN_ADDR.to_string(), start_time: Some(Milliseconds(1571711019879 + 1)), - duration: Milliseconds(100000), + end_time: Milliseconds(1571711019879 + 2), coin_denom: "uluna".to_string(), whitelist: Some(vec![Addr::unchecked("user")]), min_bid: None, @@ -811,7 +815,7 @@ fn execute_update_auction() { assert_eq!( TokenAuctionState { start_time: Expiration::AtTime(Timestamp::from_nanos(1571711019880000000)), - end_time: Expiration::AtTime(Timestamp::from_nanos(1571711119880000000)), + end_time: Expiration::AtTime(Timestamp::from_nanos(1571711019881000000)), high_bidder_addr: Addr::unchecked(""), high_bidder_amount: Uint128::zero(), coin_denom: "uluna".to_string(), @@ -839,7 +843,7 @@ fn execute_start_auction_after_previous_finished() { let hook_msg = Cw721HookMsg::StartAuction { start_time: None, - duration: Milliseconds(100000), + end_time: Milliseconds::from_nanos((current_time() + 20_000_000) * 1_000_000), coin_denom: "uusd".to_string(), whitelist: None, min_bid: None, @@ -851,7 +855,7 @@ fn execute_start_auction_after_previous_finished() { }); let mut env = mock_env(); // Auction ended by that time - env.block.time = env.block.time.plus_days(1); + env.block.time = env.block.time.plus_hours(1); let info = mock_info(MOCK_TOKEN_ADDR, &[]); let res = execute(deps.as_mut(), env, info, msg).unwrap(); @@ -859,8 +863,8 @@ fn execute_start_auction_after_previous_finished() { Response::new() .add_attributes(vec![ attr("action", "start_auction"), - attr("start_time", "expiration time: 1571883819.880000000"), - attr("end_time", "expiration time: 1571883919.879000000"), + attr("start_time", "expiration time: 1571801019.880000000"), + attr("end_time", "expiration time: 1571817419.879000000"), attr("coin_denom", "uusd"), attr("auction_id", "2"), attr("whitelist", "None"), @@ -1034,7 +1038,7 @@ fn execute_claim_auction_already_claimed() { let hook_msg = Cw721HookMsg::StartAuction { start_time: None, - duration: Milliseconds(100000), + end_time: Milliseconds::from_nanos((current_time() + 20_000_000) * 1_000_000), coin_denom: "uusd".to_string(), whitelist: None, min_bid: None, diff --git a/packages/andromeda-non-fungible-tokens/src/auction.rs b/packages/andromeda-non-fungible-tokens/src/auction.rs index 34640c886..42b30ccb9 100644 --- a/packages/andromeda-non-fungible-tokens/src/auction.rs +++ b/packages/andromeda-non-fungible-tokens/src/auction.rs @@ -32,7 +32,7 @@ pub enum ExecuteMsg { token_id: String, token_address: String, start_time: Option, - duration: Milliseconds, + end_time: Milliseconds, coin_denom: String, whitelist: Option>, min_bid: Option, @@ -60,7 +60,7 @@ pub enum Cw721HookMsg { /// Start time in milliseconds since epoch start_time: Option, /// Duration in milliseconds - duration: Milliseconds, + end_time: Milliseconds, coin_denom: String, min_bid: Option, whitelist: Option>, diff --git a/tests-integration/tests/crowdfund_app.rs b/tests-integration/tests/crowdfund_app.rs index 61d0b9f5b..c013c1f79 100644 --- a/tests-integration/tests/crowdfund_app.rs +++ b/tests-integration/tests/crowdfund_app.rs @@ -21,13 +21,11 @@ use andromeda_splitter::mock::{ mock_andromeda_splitter, mock_splitter_instantiate_msg, mock_splitter_send_msg, }; use andromeda_std::ado_base::modules::Module; -use cw20::Expiration; -use std::str::FromStr; - use andromeda_testing::mock::{init_balances, mock_app, MockAndromeda, MockApp}; -use cosmwasm_std::{coin, to_json_binary, Addr, BlockInfo, Decimal, Timestamp, Uint128}; +use cosmwasm_std::{coin, to_json_binary, Addr, BlockInfo, Decimal, Uint128}; use cw721::OwnerOfResponse; use cw_multi_test::Executor; +use std::str::FromStr; fn mock_andromeda(app: &mut MockApp, admin_address: Addr) -> MockAndromeda { MockAndromeda::new(app, &admin_address) @@ -212,7 +210,7 @@ fn test_crowdfund_app() { let start_msg = mock_start_crowdfund_msg( None, - Expiration::AtTime(Timestamp::from_nanos((current_time + 2) * 1_000_000)), + Milliseconds::from_nanos((current_time + 2) * 1_000_000), token_price.clone(), Uint128::from(3u128), Some(1), From 49107411f82ae3631960be33d81ae81a6c67425b Mon Sep 17 00:00:00 2001 From: Joe Monem Date: Tue, 2 Apr 2024 08:57:11 +0300 Subject: [PATCH 3/3] adjusted auction integration test --- tests-integration/tests/auction_app.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests-integration/tests/auction_app.rs b/tests-integration/tests/auction_app.rs index 20335bf47..992613c27 100644 --- a/tests-integration/tests/auction_app.rs +++ b/tests-integration/tests/auction_app.rs @@ -182,7 +182,7 @@ fn test_auction_app() { let start_time = router.block_info().time.nanos() / MILLISECONDS_TO_NANOSECONDS_RATIO + 100; let receive_msg = mock_start_auction( Some(Milliseconds(start_time)), - Milliseconds(1000), + Milliseconds(start_time + 2), "uandr".to_string(), None, None,