Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
cjcobb23 committed Oct 30, 2024
1 parent 621d42e commit f425135
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 13 deletions.
7 changes: 3 additions & 4 deletions contracts/interchain-token-service/src/contract/execute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,7 @@ pub fn execute_message(
message,
} => {
ensure!(
!is_chain_frozen(deps.storage, &destination_chain)
.change_context(Error::State)?,
!is_chain_frozen(deps.storage, &destination_chain).change_context(Error::State)?,
Error::ChainFrozen(destination_chain)
);
let destination_address = load_its_contract(deps.storage, &destination_chain)
Expand Down Expand Up @@ -174,7 +173,6 @@ pub fn enable_execution(deps: DepsMut) -> Result<Response, Error> {
killswitch::disengage(deps.storage, Event::ExecutionEnabled).change_context(Error::State)
}


pub fn set_chain_config(
deps: DepsMut,
chain: ChainNameRaw,
Expand All @@ -201,7 +199,8 @@ mod tests {
use router_api::{ChainNameRaw, CrossChainId};

use crate::contract::execute::{
disable_execution, enable_execution, execute_message, freeze_chain, register_its_contract, unfreeze_chain, Error
disable_execution, enable_execution, execute_message, freeze_chain, register_its_contract,
unfreeze_chain, Error,
};
use crate::state::{self, Config};
use crate::{HubMessage, Message};
Expand Down
22 changes: 13 additions & 9 deletions contracts/interchain-token-service/src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ pub fn may_load_chain_config(
storage: &dyn Storage,
chain: &ChainNameRaw,
) -> Result<Option<ChainConfig>, Error> {
CHAIN_CONFIGS.may_load(storage, chain).change_context(Error::Storage)
CHAIN_CONFIGS
.may_load(storage, chain)
.change_context(Error::Storage)
}

pub fn save_chain_config(
Expand All @@ -60,14 +62,16 @@ pub fn save_chain_config(
max_uint: nonempty::Uint256,
max_target_decimals: u8,
) -> Result<(), Error> {
CHAIN_CONFIGS.save(
storage,
chain,
&ChainConfig {
max_uint,
max_target_decimals,
},
).change_context(Error::Storage)
CHAIN_CONFIGS
.save(
storage,
chain,
&ChainConfig {
max_uint,
max_target_decimals,
},
)
.change_context(Error::Storage)
}

pub fn may_load_its_contract(
Expand Down

0 comments on commit f425135

Please sign in to comment.