style: Migrate to stable-only rustfmt configuration
- Remove nightly-only features from .rustfmt.toml and vendor/ss58-registry/rustfmt.toml - Removed features: imports_granularity, wrap_comments, comment_width, reorder_impl_items, spaces_around_ranges, binop_separator, match_arm_blocks, trailing_semicolon, trailing_comma - Format all 898 affected files with stable rustfmt - Ensures long-term reliability without nightly toolchain dependency
This commit is contained in:
@@ -290,8 +290,9 @@ where
|
||||
Asset { id: AssetId(inner_location), fun: Fungible(amount) } => {
|
||||
match inner_location.unpack() {
|
||||
// Get the ERC20 contract address of the token.
|
||||
(0, [AccountKey20 { network, key }]) if self.network_matches(network) =>
|
||||
Some((H160(*key), *amount)),
|
||||
(0, [AccountKey20 { network, key }]) if self.network_matches(network) => {
|
||||
Some((H160(*key), *amount))
|
||||
},
|
||||
// If there is no ERC20 contract address in the location then signal to the
|
||||
// gateway that is a native Ether transfer by using
|
||||
// `0x0000000000000000000000000000000000000000` as the token address.
|
||||
@@ -403,8 +404,9 @@ where
|
||||
}
|
||||
|
||||
let (asset_id, amount) = match reserve_asset {
|
||||
Asset { id: AssetId(inner_location), fun: Fungible(amount) } =>
|
||||
Some((inner_location.clone(), *amount)),
|
||||
Asset { id: AssetId(inner_location), fun: Fungible(amount) } => {
|
||||
Some((inner_location.clone(), *amount))
|
||||
},
|
||||
_ => None,
|
||||
}
|
||||
.ok_or(AssetResolutionFailed)?;
|
||||
|
||||
@@ -152,14 +152,16 @@ impl Command {
|
||||
Token::FixedBytes(agent_id.as_bytes().to_owned()),
|
||||
Token::Bytes(command.abi_encode()),
|
||||
])]),
|
||||
Command::Upgrade { impl_address, impl_code_hash, initializer, .. } =>
|
||||
Command::Upgrade { impl_address, impl_code_hash, initializer, .. } => {
|
||||
ethabi::encode(&[Token::Tuple(vec![
|
||||
Token::Address(*impl_address),
|
||||
Token::FixedBytes(impl_code_hash.as_bytes().to_owned()),
|
||||
initializer.clone().map_or(Token::Bytes(vec![]), |i| Token::Bytes(i.params)),
|
||||
])]),
|
||||
Command::SetOperatingMode { mode } =>
|
||||
ethabi::encode(&[Token::Tuple(vec![Token::Uint(U256::from((*mode) as u64))])]),
|
||||
])])
|
||||
},
|
||||
Command::SetOperatingMode { mode } => {
|
||||
ethabi::encode(&[Token::Tuple(vec![Token::Uint(U256::from((*mode) as u64))])])
|
||||
},
|
||||
Command::SetTokenTransferFees {
|
||||
create_asset_xcm,
|
||||
transfer_asset_xcm,
|
||||
@@ -169,32 +171,36 @@ impl Command {
|
||||
Token::Uint(U256::from(*transfer_asset_xcm)),
|
||||
Token::Uint(*register_token),
|
||||
])]),
|
||||
Command::SetPricingParameters { exchange_rate, delivery_cost, multiplier } =>
|
||||
Command::SetPricingParameters { exchange_rate, delivery_cost, multiplier } => {
|
||||
ethabi::encode(&[Token::Tuple(vec![
|
||||
Token::Uint(exchange_rate.clone().into_inner()),
|
||||
Token::Uint(U256::from(*delivery_cost)),
|
||||
Token::Uint(multiplier.clone().into_inner()),
|
||||
])]),
|
||||
Command::UnlockNativeToken { agent_id, token, recipient, amount } =>
|
||||
])])
|
||||
},
|
||||
Command::UnlockNativeToken { agent_id, token, recipient, amount } => {
|
||||
ethabi::encode(&[Token::Tuple(vec![
|
||||
Token::FixedBytes(agent_id.as_bytes().to_owned()),
|
||||
Token::Address(*token),
|
||||
Token::Address(*recipient),
|
||||
Token::Uint(U256::from(*amount)),
|
||||
])]),
|
||||
Command::RegisterForeignToken { token_id, name, symbol, decimals } =>
|
||||
])])
|
||||
},
|
||||
Command::RegisterForeignToken { token_id, name, symbol, decimals } => {
|
||||
ethabi::encode(&[Token::Tuple(vec![
|
||||
Token::FixedBytes(token_id.as_bytes().to_owned()),
|
||||
Token::String(name.to_owned()),
|
||||
Token::String(symbol.to_owned()),
|
||||
Token::Uint(U256::from(*decimals)),
|
||||
])]),
|
||||
Command::MintForeignToken { token_id, recipient, amount } =>
|
||||
])])
|
||||
},
|
||||
Command::MintForeignToken { token_id, recipient, amount } => {
|
||||
ethabi::encode(&[Token::Tuple(vec![
|
||||
Token::FixedBytes(token_id.as_bytes().to_owned()),
|
||||
Token::Address(*recipient),
|
||||
Token::Uint(U256::from(*amount)),
|
||||
])]),
|
||||
])])
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -133,8 +133,9 @@ where
|
||||
let (token, amount) = match ena {
|
||||
Asset { id: AssetId(inner_location), fun: Fungible(amount) } => {
|
||||
match inner_location.unpack() {
|
||||
(0, [AccountKey20 { network, key }]) if self.network_matches(network) =>
|
||||
Ok((H160(*key), amount)),
|
||||
(0, [AccountKey20 { network, key }]) if self.network_matches(network) => {
|
||||
Ok((H160(*key), amount))
|
||||
},
|
||||
// To allow ether
|
||||
(0, []) => Ok((H160([0; 20]), amount)),
|
||||
_ => Err(AssetResolutionFailed),
|
||||
|
||||
@@ -214,23 +214,26 @@ impl Command {
|
||||
initParams: Bytes::from(initializer.params.clone()),
|
||||
}
|
||||
.abi_encode(),
|
||||
Command::SetOperatingMode { mode } =>
|
||||
SetOperatingModeParams { mode: (*mode) as u8 }.abi_encode(),
|
||||
Command::UnlockNativeToken { token, recipient, amount, .. } =>
|
||||
Command::SetOperatingMode { mode } => {
|
||||
SetOperatingModeParams { mode: (*mode) as u8 }.abi_encode()
|
||||
},
|
||||
Command::UnlockNativeToken { token, recipient, amount, .. } => {
|
||||
UnlockNativeTokenParams {
|
||||
token: Address::from(token.as_fixed_bytes()),
|
||||
recipient: Address::from(recipient.as_fixed_bytes()),
|
||||
amount: *amount,
|
||||
}
|
||||
.abi_encode(),
|
||||
Command::RegisterForeignToken { token_id, name, symbol, decimals } =>
|
||||
.abi_encode()
|
||||
},
|
||||
Command::RegisterForeignToken { token_id, name, symbol, decimals } => {
|
||||
RegisterForeignTokenParams {
|
||||
foreignTokenID: FixedBytes::from(token_id.as_fixed_bytes()),
|
||||
name: Bytes::from(name.to_vec()),
|
||||
symbol: Bytes::from(symbol.to_vec()),
|
||||
decimals: *decimals,
|
||||
}
|
||||
.abi_encode(),
|
||||
.abi_encode()
|
||||
},
|
||||
Command::MintForeignToken { token_id, recipient, amount } => MintForeignTokenParams {
|
||||
foreignTokenID: FixedBytes::from(token_id.as_fixed_bytes()),
|
||||
recipient: Address::from(recipient.as_fixed_bytes()),
|
||||
|
||||
Reference in New Issue
Block a user