Skip to content

Commit

Permalink
fix clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
fish-sammy committed Nov 6, 2024
1 parent 0c3ffa5 commit a0677fc
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ pub fn save_token_instance_for_destination_chain(
&TokenInstance::new(&deploy_token.deployment_type(), Some(deploy_token.decimals)),
)
.change_context(Error::State)
.and_then(|_| Ok(()))
.map(|_| ())
}

pub fn calculate_scaling_factor(
Expand Down Expand Up @@ -329,7 +329,7 @@ mod test {
let source_chain: ChainNameRaw = "sourcechain".try_into().unwrap();
let destination_chain: ChainNameRaw = "destinationchain".try_into().unwrap();
let mut transfer = InterchainTransfer {
token_id: [1u8; 32].try_into().unwrap(),
token_id: [1u8; 32].into(),
source_address: b"source_address".to_vec().try_into().unwrap(),
destination_address: b"destination_address".to_vec().try_into().unwrap(),
amount: Uint256::from(1_000_000_000_000u128).try_into().unwrap(),
Expand Down Expand Up @@ -376,7 +376,7 @@ mod test {
let source_chain: ChainNameRaw = "sourcechain".try_into().unwrap();
let destination_chain: ChainNameRaw = "destinationchain".try_into().unwrap();
let mut transfer = InterchainTransfer {
token_id: [1u8; 32].try_into().unwrap(),
token_id: [1u8; 32].into(),
source_address: b"source_address".to_vec().try_into().unwrap(),
destination_address: b"destination_address".to_vec().try_into().unwrap(),
amount: Uint256::from(1_000_000u128).try_into().unwrap(),
Expand Down Expand Up @@ -423,7 +423,7 @@ mod test {
let source_chain: ChainNameRaw = "sourcechain".try_into().unwrap();
let destination_chain: ChainNameRaw = "destinationchain".try_into().unwrap();
let mut transfer = InterchainTransfer {
token_id: [1u8; 32].try_into().unwrap(),
token_id: [1u8; 32].into(),
source_address: b"source_address".to_vec().try_into().unwrap(),
destination_address: b"destination_address".to_vec().try_into().unwrap(),
amount: Uint256::from(1_000_000u128).try_into().unwrap(),
Expand Down Expand Up @@ -470,7 +470,7 @@ mod test {
let source_chain: ChainNameRaw = "sourcechain".try_into().unwrap();
let destination_chain: ChainNameRaw = "destinationchain".try_into().unwrap();
let mut transfer = InterchainTransfer {
token_id: [1u8; 32].try_into().unwrap(),
token_id: [1u8; 32].into(),
source_address: b"source_address".to_vec().try_into().unwrap(),
destination_address: b"destination_address".to_vec().try_into().unwrap(),
amount: Uint256::from(1_000_000_000_000u128).try_into().unwrap(),
Expand All @@ -494,7 +494,7 @@ mod test {
state::save_chain_config(
&mut storage,
&destination_chain,
Uint256::from(1_000_00u128).try_into().unwrap(),
Uint256::from(100_000u128).try_into().unwrap(),
6,
)
.unwrap();
Expand All @@ -517,10 +517,10 @@ mod test {
let source_chain: ChainNameRaw = "sourcechain".try_into().unwrap();
let destination_chain: ChainNameRaw = "destinationchain".try_into().unwrap();
let mut transfer = InterchainTransfer {
token_id: [1u8; 32].try_into().unwrap(),
token_id: [1u8; 32].into(),
source_address: b"source_address".to_vec().try_into().unwrap(),
destination_address: b"destination_address".to_vec().try_into().unwrap(),
amount: Uint256::from(1_000_00u128).try_into().unwrap(),
amount: Uint256::from(100_000u128).try_into().unwrap(),
data: None,
};

Expand All @@ -541,7 +541,7 @@ mod test {
state::save_chain_config(
&mut storage,
&destination_chain,
Uint256::from(1_000_00u128).try_into().unwrap(),
Uint256::from(100_000u128).try_into().unwrap(),
6,
)
.unwrap();
Expand All @@ -564,7 +564,7 @@ mod test {
let source_chain: ChainNameRaw = "sourcechain".try_into().unwrap();
let destination_chain: ChainNameRaw = "destinationchain".try_into().unwrap();
let mut deploy_token = DeployInterchainToken {
token_id: [1u8; 32].try_into().unwrap(),
token_id: [1u8; 32].into(),
name: "token".to_string().try_into().unwrap(),
symbol: "TKN".to_string().try_into().unwrap(),
decimals: 9,
Expand Down Expand Up @@ -595,7 +595,7 @@ mod test {
assert_eq!(deploy_token.decimals, 6);

let mut deploy_token = DeployInterchainToken {
token_id: [1u8; 32].try_into().unwrap(),
token_id: [1u8; 32].into(),
name: "token".to_string().try_into().unwrap(),
symbol: "TKN".to_string().try_into().unwrap(),
decimals: 3,
Expand All @@ -616,7 +616,7 @@ mod test {
let source_chain: ChainNameRaw = "sourcechain".try_into().unwrap();
let destination_chain: ChainNameRaw = "destinationchain".try_into().unwrap();
let mut deploy_token = DeployInterchainToken {
token_id: [1u8; 32].try_into().unwrap(),
token_id: [1u8; 32].into(),
name: "token".to_string().try_into().unwrap(),
symbol: "TKN".to_string().try_into().unwrap(),
decimals: 9,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ fn apply_to_transfer(
)
})
.and_then(|_| interceptors::add_supply_amount(storage, &destination_chain, &transfer))
.and_then(|_| Ok(transfer))
.map(|_| transfer)
}

fn apply_to_token_deployment(
Expand All @@ -202,7 +202,7 @@ fn apply_to_token_deployment(
&deploy_token,
)
})
.and_then(|_| Ok(deploy_token))
.map(|_| deploy_token)
}

fn ensure_chain_not_frozen(storage: &dyn Storage, chain: &ChainNameRaw) -> Result<(), Error> {
Expand Down

0 comments on commit a0677fc

Please sign in to comment.