Skip to content

Commit

Permalink
cargo check -p kerria-runtime
Browse files Browse the repository at this point in the history
  • Loading branch information
mclyk committed Sep 17, 2023
1 parent 856b266 commit a1ab78d
Showing 1 changed file with 41 additions and 42 deletions.
83 changes: 41 additions & 42 deletions runtime/kerria/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -410,12 +410,12 @@ impl orml_xcm::Config for Runtime {
// pub const LoansPalletId: PalletId = PalletId(*b"par/loan");
// }

// parameter_types! {
parameter_types! {
// pub SelfLocation: MultiLocation = MultiLocation::new(1, X1(Parachain(ParachainInfo::parachain_id().into())));
// pub const BaseXcmWeight: Weight = Weight::from_ref_time(150_000_000);
// pub const MaxInstructions: u32 = 100;
pub const BaseXcmWeight: Weight = Weight::from_ref_time(150_000_000);
pub const MaxInstructions: u32 = 100;
// pub const MaxAssetsForTransfer: usize = 2;
// }
}

// impl orml_xtokens::Config for Runtime {
// type RuntimeEvent = RuntimeEvent;
Expand Down Expand Up @@ -1252,15 +1252,15 @@ impl TakeRevenue for ToTreasury {

// Min fee required when transferring non-reserve asset back to sibling chain
// It will use another asset(e.g Relaychain's asset) as fee
parameter_type_with_key! {
pub ParachainMinFee: |location: MultiLocation| -> Option<u128> {
#[allow(clippy::match_ref_pats)] // false positive
match (location.parents, location.first_interior()) {
(1, Some(Parachain(paras::statemint::ID))) => Some(XcmHelper::get_xcm_weight_fee_to_sibling(*location).fee),//default fee should be enough even if not configured
_ => Some(u128::MAX),
}
};
}
// parameter_type_with_key! {
// pub ParachainMinFee: |location: MultiLocation| -> Option<u128> {
// #[allow(clippy::match_ref_pats)] // false positive
// match (location.parents, location.first_interior()) {
// (1, Some(Parachain(paras::statemint::ID))) => Some(XcmHelper::get_xcm_weight_fee_to_sibling(*location).fee),//default fee should be enough even if not configured
// _ => Some(u128::MAX),
// }
// };
// }

parameter_types! {
pub CheckingAccount: AccountId = PolkadotXcm::check_account();
Expand Down Expand Up @@ -1880,20 +1880,20 @@ parameter_types! {
pub const NotifyTimeout: BlockNumber = 100;
}

impl pallet_xcm_helper::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type UpdateOrigin = EnsureRootOrMoreThanHalfGeneralCouncil;
type Assets = Assets;
type XcmSender = XcmRouter;
type RelayNetwork = RelayNetwork;
type PalletId = XcmHelperPalletId;
type NotifyTimeout = NotifyTimeout;
type AccountIdToMultiLocation = AccountIdToMultiLocation<AccountId>;
type RefundLocation = RefundLocation;
type BlockNumberProvider = frame_system::Pallet<Runtime>;
type WeightInfo = weights::pallet_xcm_helper::WeightInfo<Runtime>;
type RelayCurrency = RelayCurrency;
}
// impl pallet_xcm_helper::Config for Runtime {
// type RuntimeEvent = RuntimeEvent;
// type UpdateOrigin = EnsureRootOrMoreThanHalfGeneralCouncil;
// type Assets = Assets;
// type XcmSender = XcmRouter;
// type RelayNetwork = RelayNetwork;
// type PalletId = XcmHelperPalletId;
// type NotifyTimeout = NotifyTimeout;
// type AccountIdToMultiLocation = AccountIdToMultiLocation<AccountId>;
// type RefundLocation = RefundLocation;
// type BlockNumberProvider = frame_system::Pallet<Runtime>;
// type WeightInfo = weights::pallet_xcm_helper::WeightInfo<Runtime>;
// type RelayCurrency = RelayCurrency;
// }

// parameter_types! {
// pub const MaxLengthRoute: u8 = 10;
Expand Down Expand Up @@ -2016,7 +2016,7 @@ construct_runtime!(
// Bridge: pallet_bridge::{Pallet, Call, Storage, Event<T>} = 90,
// EmergencyShutdown: pallet_emergency_shutdown::{Pallet, Call, Storage, Event<T>} = 91,
// Farming: pallet_farming::{Pallet, Call, Storage, Event<T>} = 92,
XcmHelper: pallet_xcm_helper::{Pallet, Call, Storage, Event<T>} = 93,
// XcmHelper: pallet_xcm_helper::{Pallet, Call, Storage, Event<T>} = 93,
// Streaming: pallet_streaming::{Pallet, Call, Storage, Event<T>} = 94,
AssetRegistry: pallet_asset_registry::{Pallet, Call, Storage, Event<T>} = 95,

Expand Down Expand Up @@ -2054,12 +2054,11 @@ pub type SignedExtra = (
);
/// Unchecked extrinsic type as expected by this runtime.
pub type UncheckedExtrinsic =
fp_self_contained::UncheckedExtrinsic<Address, RuntimeCall, Signature, SignedExtra>;
generic::UncheckedExtrinsic<Address, RuntimeCall, Signature, SignedExtra>;
/// The payload being signed in transactions.
pub type SignedPayload = generic::SignedPayload<RuntimeCall, SignedExtra>;
/// Extrinsic type that has already been checked.
pub type CheckedExtrinsic =
fp_self_contained::CheckedExtrinsic<AccountId, RuntimeCall, SignedExtra, H160>;
pub type CheckedExtrinsic = generic::CheckedExtrinsic<AccountId, RuntimeCall, SignedExtra>;
/// Executive: handles dispatch to the various modules.
pub type Executive = frame_executive::Executive<
Runtime,
Expand Down Expand Up @@ -2263,19 +2262,19 @@ impl_runtime_apis! {
}
}

impl pallet_loans_rpc_runtime_api::LoansApi<Block, AccountId, Balance> for Runtime {
fn get_account_liquidity(account: AccountId) -> Result<(Liquidity, Shortfall, Liquidity, Shortfall), DispatchError> {
Loans::get_account_liquidity(&account)
}
// impl pallet_loans_rpc_runtime_api::LoansApi<Block, AccountId, Balance> for Runtime {
// fn get_account_liquidity(account: AccountId) -> Result<(Liquidity, Shortfall, Liquidity, Shortfall), DispatchError> {
// Loans::get_account_liquidity(&account)
// }

fn get_market_status(asset_id: CurrencyId) -> Result<(Rate, Rate, Rate, Ratio, Balance, Balance, sp_runtime::FixedU128), DispatchError> {
Loans::get_market_status(asset_id)
}
// fn get_market_status(asset_id: CurrencyId) -> Result<(Rate, Rate, Rate, Ratio, Balance, Balance, sp_runtime::FixedU128), DispatchError> {
// Loans::get_market_status(asset_id)
// }

fn get_liquidation_threshold_liquidity(account: AccountId) -> Result<(Liquidity, Shortfall, Liquidity, Shortfall), DispatchError> {
Loans::get_account_liquidation_threshold_liquidity(&account)
}
}
// fn get_liquidation_threshold_liquidity(account: AccountId) -> Result<(Liquidity, Shortfall, Liquidity, Shortfall), DispatchError> {
// Loans::get_account_liquidation_threshold_liquidity(&account)
// }
// }

// impl pallet_router_rpc_runtime_api::RouterApi<Block, Balance> for Runtime {
// fn get_best_route(amount: Balance, token_in: CurrencyId, token_out: CurrencyId, reversed: bool) -> Result<(Vec<CurrencyId>, Balance), DispatchError> {
Expand Down

0 comments on commit a1ab78d

Please sign in to comment.