Skip to content

Commit

Permalink
cosmwasm: added allow dead_code tags for shutdown mode contracts
Browse files Browse the repository at this point in the history
  • Loading branch information
kakucodes committed Feb 3, 2025
1 parent c1d31de commit daedbab
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
18 changes: 17 additions & 1 deletion cosmwasm/contracts/token-bridge/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ use crate::{
token_address::{ContractId, ExternalTokenId, TokenId, WrappedCW20},
};

#[cfg_attr(not(feature = "full"), allow(dead_code))]
type HumanAddr = String;

pub enum TransferType<A> {
Expand Down Expand Up @@ -312,6 +313,7 @@ pub fn execute(deps: DepsMut, env: Env, info: MessageInfo, msg: ExecuteMsg) -> S
}
}

#[cfg_attr(not(feature = "full"), allow(dead_code))]
fn deposit_tokens(deps: DepsMut, _env: Env, info: MessageInfo) -> StdResult<Response> {
for coin in info.funds {
let deposit_key = format!("{}:{}", info.sender, coin.denom);
Expand All @@ -326,6 +328,7 @@ fn deposit_tokens(deps: DepsMut, _env: Env, info: MessageInfo) -> StdResult<Resp
Ok(Response::new().add_attribute("action", "deposit_tokens"))
}

#[cfg_attr(not(feature = "full"), allow(dead_code))]
fn withdraw_tokens(
deps: DepsMut,
_env: Env,
Expand Down Expand Up @@ -358,6 +361,7 @@ fn withdraw_tokens(
}

/// Handle wrapped asset registration messages
#[cfg_attr(not(feature = "full"), allow(dead_code))]
fn handle_register_asset(
deps: DepsMut,
_env: Env,
Expand Down Expand Up @@ -400,6 +404,7 @@ fn handle_register_asset(
.add_attribute("contract_addr", info.sender))
}

#[cfg_attr(not(feature = "full"), allow(dead_code))]
fn handle_attest_meta(
deps: DepsMut,
env: Env,
Expand Down Expand Up @@ -487,6 +492,7 @@ fn handle_attest_meta(
Ok(Response::new().add_message(message))
}

#[cfg_attr(not(feature = "full"), allow(dead_code))]
fn handle_create_asset_meta(
deps: DepsMut,
env: Env,
Expand All @@ -504,6 +510,7 @@ fn handle_create_asset_meta(
}
}

#[cfg_attr(not(feature = "full"), allow(dead_code))]
fn handle_create_asset_meta_token(
deps: DepsMut,
env: Env,
Expand Down Expand Up @@ -554,6 +561,7 @@ fn handle_create_asset_meta_token(
.add_attribute("meta.block_time", env.block.time.seconds().to_string()))
}

#[cfg_attr(not(feature = "full"), allow(dead_code))]
fn handle_create_asset_meta_native_token(
deps: DepsMut,
env: Env,
Expand Down Expand Up @@ -598,6 +606,7 @@ fn handle_create_asset_meta_native_token(
.add_attribute("meta.block_time", env.block.time.seconds().to_string()))
}

#[cfg_attr(not(feature = "full"), allow(dead_code))]
fn handle_complete_transfer_with_payload(
mut deps: DepsMut,
env: Env,
Expand Down Expand Up @@ -658,9 +667,10 @@ fn parse_and_archive_vaa(
fn submit_vaa(
mut deps: DepsMut,
env: Env,
info: MessageInfo,
#[cfg_attr(not(feature = "full"), allow(unused_variables))] info: MessageInfo,
data: &Binary,
) -> StdResult<Response> {
#[cfg_attr(not(feature = "full"), allow(unused_variables))]
let (vaa, payload) = parse_and_archive_vaa(deps.branch(), env.clone(), data)?;
match payload {
Either::Left(governance_packet) => handle_governance_payload(deps, env, &governance_packet),
Expand Down Expand Up @@ -756,6 +766,7 @@ fn handle_register_chain(deps: DepsMut, _env: Env, data: &Vec<u8>) -> StdResult<
}

#[allow(clippy::too_many_arguments)]
#[cfg_attr(not(feature = "full"), allow(dead_code))]
fn handle_complete_transfer(
deps: DepsMut,
env: Env,
Expand Down Expand Up @@ -798,6 +809,7 @@ fn handle_complete_transfer(

#[allow(clippy::too_many_arguments)]
#[allow(clippy::bind_instead_of_map)]
#[cfg_attr(not(feature = "full"), allow(dead_code))]
fn handle_complete_transfer_token(
deps: DepsMut,
_env: Env,
Expand Down Expand Up @@ -968,6 +980,7 @@ fn handle_complete_transfer_token(
}

#[allow(clippy::too_many_arguments)]
#[cfg_attr(not(feature = "full"), allow(dead_code))]
fn handle_complete_transfer_token_native(
deps: DepsMut,
_env: Env,
Expand Down Expand Up @@ -1067,6 +1080,7 @@ fn handle_complete_transfer_token_native(
}

#[allow(clippy::too_many_arguments)]
#[cfg_attr(not(feature = "full"), allow(dead_code))]
fn handle_initiate_transfer(
deps: DepsMut,
env: Env,
Expand Down Expand Up @@ -1107,6 +1121,7 @@ fn handle_initiate_transfer(
}

#[allow(clippy::too_many_arguments)]
#[cfg_attr(not(feature = "full"), allow(dead_code))]
fn handle_initiate_transfer_token(
deps: DepsMut,
env: Env,
Expand Down Expand Up @@ -1347,6 +1362,7 @@ fn handle_initiate_transfer_token(
}

#[allow(clippy::too_many_arguments)]
#[cfg_attr(not(feature = "full"), allow(dead_code))]
fn handle_initiate_transfer_native_token(
deps: DepsMut,
env: Env,
Expand Down
1 change: 1 addition & 0 deletions cosmwasm/contracts/wormhole/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,7 @@ pub fn handle_transfer_fee(deps: DepsMut, _env: Env, data: &[u8]) -> StdResult<R
})))
}

#[cfg_attr(not(feature = "full"), allow(dead_code))]
fn handle_post_message(
deps: DepsMut,
env: Env,
Expand Down

0 comments on commit daedbab

Please sign in to comment.