Skip to content

Commit

Permalink
integration-tests: Adapt existing tests to LP gateway queue usage, ad…
Browse files Browse the repository at this point in the history
…d specific inbound tests
  • Loading branch information
cdamian committed Jul 31, 2024
1 parent 8379adb commit d9cac02
Show file tree
Hide file tree
Showing 11 changed files with 392 additions and 222 deletions.
13 changes: 7 additions & 6 deletions runtime/altair/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ use cfg_primitives::{
liquidity_pools::GeneralCurrencyPrefix,
types::{
AccountId, Address, AuraId, Balance, BlockNumber, CollectionId, Hash, Hashing, Header,
IBalance, InvestmentId, ItemId, LoanId, Nonce, OrderId, OutboundMessageNonce, PalletIndex,
PoolEpochId, PoolFeeId, PoolId, Signature, TrancheId, TrancheWeight,
IBalance, InvestmentId, ItemId, LoanId, Nonce, OrderId, PalletIndex, PoolEpochId,
PoolFeeId, PoolId, Signature, TrancheId, TrancheWeight,
},
LPGatewayQueueMessageNonce,
};
Expand Down Expand Up @@ -81,6 +81,7 @@ use pallet_evm::{
Runner,
};
use pallet_investments::OrderType;
use pallet_liquidity_pools_gateway::message::GatewayMessage;
pub use pallet_loans::entities::{input::PriceCollectionInput, loans::ActiveLoanInfo};
use pallet_loans::types::cashflow::CashflowPayment;
use pallet_pool_system::{
Expand Down Expand Up @@ -1790,7 +1791,7 @@ impl pallet_liquidity_pools::Config for Runtime {
type ForeignInvestment = ForeignInvestments;
type GeneralCurrencyPrefix = GeneralCurrencyPrefix;
type MarketRatio = OrderBook;
type OutboundQueue = LiquidityPoolsGateway;
type OutboundMessageHandler = LiquidityPoolsGateway;
type Permission = Permissions;
type PoolId = PoolId;
type PoolInspect = PoolSystem;
Expand All @@ -1811,12 +1812,12 @@ parameter_types! {

impl pallet_liquidity_pools_gateway::Config for Runtime {
type AdminOrigin = EnsureRoot<AccountId>;
type InboundQueue = LiquidityPools;
type InboundMessageHandler = LiquidityPools;
type LocalEVMOrigin = pallet_liquidity_pools_gateway::EnsureLocal;
type MaxIncomingMessageSize = MaxIncomingMessageSize;
type Message = pallet_liquidity_pools::Message;
type MessageQueue = LiquidityPoolsGatewayQueue;
type OriginRecovery = LiquidityPoolsAxelarGateway;
type OutboundMessageNonce = OutboundMessageNonce;
type Router = liquidity_pools_gateway_routers::DomainRouter<Runtime>;
type RuntimeEvent = RuntimeEvent;
type RuntimeOrigin = RuntimeOrigin;
Expand All @@ -1825,7 +1826,7 @@ impl pallet_liquidity_pools_gateway::Config for Runtime {
}

impl pallet_liquidity_pools_gateway_queue::Config for Runtime {
type Message = pallet_liquidity_pools::Message;
type Message = GatewayMessage<AccountId, pallet_liquidity_pools::Message>;
type MessageNonce = LPGatewayQueueMessageNonce;
type MessageProcessor = LiquidityPoolsGateway;
type RuntimeEvent = RuntimeEvent;
Expand Down
13 changes: 7 additions & 6 deletions runtime/centrifuge/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ use cfg_primitives::{
liquidity_pools::GeneralCurrencyPrefix,
types::{
AccountId, Address, AuraId, Balance, BlockNumber, CollectionId, Hash, Hashing, Header,
IBalance, InvestmentId, ItemId, LoanId, Nonce, OrderId, OutboundMessageNonce, PalletIndex,
PoolEpochId, PoolFeeId, PoolId, Signature, TrancheId, TrancheWeight,
IBalance, InvestmentId, ItemId, LoanId, Nonce, OrderId, PalletIndex, PoolEpochId,
PoolFeeId, PoolId, Signature, TrancheId, TrancheWeight,
},
LPGatewayQueueMessageNonce,
};
Expand Down Expand Up @@ -82,6 +82,7 @@ use pallet_evm::{
Runner,
};
use pallet_investments::OrderType;
use pallet_liquidity_pools_gateway::message::GatewayMessage;
pub use pallet_loans::entities::{input::PriceCollectionInput, loans::ActiveLoanInfo};
use pallet_loans::types::cashflow::CashflowPayment;
use pallet_pool_system::{
Expand Down Expand Up @@ -1870,7 +1871,7 @@ impl pallet_liquidity_pools::Config for Runtime {
type ForeignInvestment = ForeignInvestments;
type GeneralCurrencyPrefix = GeneralCurrencyPrefix;
type MarketRatio = OrderBook;
type OutboundQueue = LiquidityPoolsGateway;
type OutboundMessageHandler = LiquidityPoolsGateway;
type Permission = Permissions;
type PoolId = PoolId;
type PoolInspect = PoolSystem;
Expand Down Expand Up @@ -1907,12 +1908,12 @@ parameter_types! {

impl pallet_liquidity_pools_gateway::Config for Runtime {
type AdminOrigin = EnsureAccountOrRootOr<LpAdminAccount, TwoThirdOfCouncil>;
type InboundQueue = LiquidityPools;
type InboundMessageHandler = LiquidityPools;
type LocalEVMOrigin = pallet_liquidity_pools_gateway::EnsureLocal;
type MaxIncomingMessageSize = MaxIncomingMessageSize;
type Message = pallet_liquidity_pools::Message;
type MessageQueue = LiquidityPoolsGatewayQueue;
type OriginRecovery = LiquidityPoolsAxelarGateway;
type OutboundMessageNonce = OutboundMessageNonce;
type Router = liquidity_pools_gateway_routers::DomainRouter<Runtime>;
type RuntimeEvent = RuntimeEvent;
type RuntimeOrigin = RuntimeOrigin;
Expand All @@ -1921,7 +1922,7 @@ impl pallet_liquidity_pools_gateway::Config for Runtime {
}

impl pallet_liquidity_pools_gateway_queue::Config for Runtime {
type Message = pallet_liquidity_pools::Message;
type Message = GatewayMessage<AccountId, pallet_liquidity_pools::Message>;
type MessageNonce = LPGatewayQueueMessageNonce;
type MessageProcessor = LiquidityPoolsGateway;
type RuntimeEvent = RuntimeEvent;
Expand Down
7 changes: 4 additions & 3 deletions runtime/development/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ use cfg_primitives::{
liquidity_pools::GeneralCurrencyPrefix,
types::{
AccountId, Address, AuraId, Balance, BlockNumber, CollectionId, Hash, Hashing, Header,
IBalance, InvestmentId, ItemId, LoanId, Nonce, OrderId, OutboundMessageNonce, PalletIndex,
PoolEpochId, PoolFeeId, PoolId, Signature, TrancheId, TrancheWeight,
IBalance, InvestmentId, ItemId, LoanId, Nonce, OrderId, PalletIndex, PoolEpochId,
PoolFeeId, PoolId, Signature, TrancheId, TrancheWeight,
},
LPGatewayQueueMessageNonce,
};
Expand Down Expand Up @@ -84,6 +84,7 @@ use pallet_evm::{
Runner,
};
use pallet_investments::OrderType;
use pallet_liquidity_pools_gateway::message::GatewayMessage;
pub use pallet_loans::entities::{input::PriceCollectionInput, loans::ActiveLoanInfo};
use pallet_loans::types::cashflow::CashflowPayment;
use pallet_pool_system::{
Expand Down Expand Up @@ -1926,7 +1927,7 @@ impl pallet_liquidity_pools_gateway::Config for Runtime {
}

impl pallet_liquidity_pools_gateway_queue::Config for Runtime {
type Message = pallet_liquidity_pools::Message;
type Message = GatewayMessage<AccountId, pallet_liquidity_pools::Message>;
type MessageNonce = LPGatewayQueueMessageNonce;
type MessageProcessor = LiquidityPoolsGateway;
type RuntimeEvent = RuntimeEvent;
Expand Down
Loading

0 comments on commit d9cac02

Please sign in to comment.