Skip to content

Commit

Permalink
Update weights (#3548)
Browse files Browse the repository at this point in the history
Signed-off-by: Vladislav <negigic@gmail.com>
Co-authored-by: glados <karel@composable.finance>
  • Loading branch information
vmarkushin and g-la-d-os authored Jun 1, 2023
1 parent d2c1ade commit be746f9
Show file tree
Hide file tree
Showing 46 changed files with 5,022 additions and 1,835 deletions.
74 changes: 48 additions & 26 deletions code/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions code/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,12 @@ orml-xcm-support = { git = "https://github.com/open-web3-stack/open-runtime-modu
orml-xtokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library", rev = "a0751540591c88ccc2d4029464de887933727183", default-features = false }
orml-tokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library", rev = "a0751540591c88ccc2d4029464de887933727183", default-features = false }

ibc = { git = "https://github.com/ComposableFi/centauri", rev = "36abfe3daee726db602773d71093fa54600b86a1", default-features = false }
ibc-rpc = { git = "https://github.com/ComposableFi/centauri", rev = "36abfe3daee726db602773d71093fa54600b86a1", default-features = false }
ibc-primitives = { git = "https://github.com/ComposableFi/centauri", rev = "36abfe3daee726db602773d71093fa54600b86a1", default-features = false }
ibc-runtime-api = { git = "https://github.com/ComposableFi/centauri", rev = "36abfe3daee726db602773d71093fa54600b86a1", default-features = false }
pallet-ibc = { git = "https://github.com/ComposableFi/centauri", rev = "36abfe3daee726db602773d71093fa54600b86a1", default-features = false }
pallet-ibc-ping = { git = "https://github.com/ComposableFi/centauri", rev = "36abfe3daee726db602773d71093fa54600b86a1", default-features = false }
ibc = { git = "https://github.com/ComposableFi/centauri", rev = "9e567ab1d55e4ec0dbad9400fb2bbec177a1896b", default-features = false }
ibc-rpc = { git = "https://github.com/ComposableFi/centauri", rev = "9e567ab1d55e4ec0dbad9400fb2bbec177a1896b", default-features = false }
ibc-primitives = { git = "https://github.com/ComposableFi/centauri", rev = "9e567ab1d55e4ec0dbad9400fb2bbec177a1896b", default-features = false }
ibc-runtime-api = { git = "https://github.com/ComposableFi/centauri", rev = "9e567ab1d55e4ec0dbad9400fb2bbec177a1896b", default-features = false }
pallet-ibc = { git = "https://github.com/ComposableFi/centauri", rev = "9e567ab1d55e4ec0dbad9400fb2bbec177a1896b", default-features = false }
pallet-ibc-ping = { git = "https://github.com/ComposableFi/centauri", rev = "9e567ab1d55e4ec0dbad9400fb2bbec177a1896b", default-features = false }

xcm-builder = { git = "https://github.com/paritytech/polkadot", rev = "c22e1c4173bf6966f5d1980f4299f7abe836f0c1", default-features = false }
polkadot-primitives = { git = "https://github.com/paritytech/polkadot", rev = "c22e1c4173bf6966f5d1980f4299f7abe836f0c1", default-features = false }
Expand Down
14 changes: 8 additions & 6 deletions code/parachain/runtime/composable/src/ibc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,15 +137,17 @@ impl Ics20RateLimiter for ConstantAny {
// different decimals places and not doing it would defeat the purpose of fixing the nominal
// amount tha we are allowing users to transfer.
let token = &msg.token;
let asset_id: CurrencyId =
let asset_id: Option<CurrencyId> =
<<Runtime as pallet_ibc::Config>::IbcDenomToAssetIdConversion as DenomToAssetId<
Runtime,
>>::from_denom_to_asset_id(&token.denom.to_string())
.map_err(|_| ())?;
.map_err(|_| ())
.ok();

let decimals =
<assets_registry::Pallet<Runtime> as InspectRegistryMetadata>::decimals(&asset_id)
.unwrap_or(12);
let decimals = asset_id
.map(|x| <assets_registry::Pallet<Runtime> as InspectRegistryMetadata>::decimals(&x))
.flatten()
.unwrap_or(12);

if msg.token.amount.as_u256() <=
::ibc::bigint::U256::from(limit * 10_u64.pow(decimals as _))
Expand Down Expand Up @@ -207,7 +209,7 @@ impl pallet_ibc::Config for Runtime {
type MinimumConnectionDelay = ConstU64<1>;
type ParaId = parachain_info::Pallet<Runtime>;
type RelayChain = RelayChainId;
type WeightInfo = weights::ibc::WeightInfo<Self>;
type WeightInfo = weights::pallet_ibc::WeightInfo<Self>;
type AdminOrigin = EnsureRootOrOneThirdNativeTechnical;
type FreezeOrigin = EnsureRootOrOneThirdNativeTechnical;
type SpamProtectionDeposit = SpamProtectionDeposit;
Expand Down
1 change: 1 addition & 0 deletions code/parachain/runtime/composable/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -726,6 +726,7 @@ mod benches {
[proxy, Proxy]
[assets_registry, AssetsRegistry]
[multisig, Multisig]
[pallet_ibc, Ibc]
);
}

Expand Down
Loading

0 comments on commit be746f9

Please sign in to comment.