Skip to content

Commit

Permalink
refactor: remove unnecessary vector of messages since only one messag…
Browse files Browse the repository at this point in the history
…e is being sent
  • Loading branch information
joemonem committed May 31, 2024
1 parent 5c3b19a commit 3c45c38
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
6 changes: 1 addition & 5 deletions contracts/liquidity/factory/src/execute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ pub fn execute_request_pool_creation(
// Load the state
let state = STATE.load(deps.storage)?;

let mut msgs: Vec<CosmosMsg> = Vec::new();

// Create a Request in state
let pool_request = generate_pool_req(deps, &info.sender, env.block.chain_id, channel.clone())?;

Expand All @@ -41,11 +39,9 @@ pub fn execute_request_pool_creation(
timeout: IbcTimeout::with_timestamp(env.block.time.plus_seconds(timeout)),
};

msgs.push(ibc_packet.into());

Ok(Response::new()
.add_attribute("method", "request_pool_creation")
.add_messages(msgs))
.add_message(ibc_packet))
}

// Function to send IBC request to Router in VLS to perform a swap
Expand Down
2 changes: 1 addition & 1 deletion packages/euclid/src/timeout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use cosmwasm_std::ensure;

use crate::error::ContractError;

/// Ensures that the timeout is between 30 and 240 seconds, and if not provided, defaults the timeout to 60 seconds
/// Ensures that the timeout is between 30 and 240 seconds. It defaults to 60 seconds if the timeout isn't provided.
pub fn get_timeout(timeout: Option<u64>) -> Result<u64, ContractError> {

Check failure on line 6 in packages/euclid/src/timeout.rs

View workflow job for this annotation

GitHub Actions / Lints

the `Err`-variant returned from this function is very large

Check failure on line 6 in packages/euclid/src/timeout.rs

View workflow job for this annotation

GitHub Actions / Lints

the `Err`-variant returned from this function is very large
if let Some(timeout) = timeout {
// Validate that the timeout is between 30 and 240 seconds inclusive
Expand Down

0 comments on commit 3c45c38

Please sign in to comment.