Skip to content

Commit

Permalink
refactor: move ci utils into separate dir (#1216)
Browse files Browse the repository at this point in the history
  • Loading branch information
wischli authored Feb 27, 2023
1 parent 9148f05 commit d2a6abc
Show file tree
Hide file tree
Showing 15 changed files with 12 additions and 12 deletions.
1 change: 1 addition & 0 deletions runtime/integration-tests/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

mod pools;
mod runtime_apis;
mod utils;
mod xcm;

/// Re-exports the correct runtimes that we run the integration tests with
Expand Down
2 changes: 1 addition & 1 deletion runtime/integration-tests/src/pools/env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ use crate::{
centrifuge,
centrifuge::{Runtime, PARA_ID},
},
pools::utils::{
utils::{
accounts::Keyring,
extrinsics::{nonce_centrifuge, xt_centrifuge},
*,
Expand Down
1 change: 0 additions & 1 deletion runtime/integration-tests/src/pools/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,3 @@

mod env;
mod pool_starts;
pub mod utils;
2 changes: 1 addition & 1 deletion runtime/integration-tests/src/pools/pool_starts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use tokio::runtime::Handle;

use crate::{
chain::centrifuge::{Runtime, RuntimeCall, RuntimeEvent, PARA_ID},
pools::utils::{
utils::{
accounts::Keyring,
env::{ChainState, EventRange},
loans::{borrow_call, init_loans_for_pool, issue_default_loan, NftManager},
Expand Down
2 changes: 1 addition & 1 deletion runtime/integration-tests/src/runtime_apis/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ impl ApiEnv {
pub fn new_with_genesis(handle: Handle, genesis: impl BuildStorage) -> Self {
// TODO: Actually make a lot of the utils in pools not specific to pools
// testing. Like init logs, creating builder and so on.
crate::pools::utils::logs::init_logs();
crate::utils::logs::init_logs();
Self {
builder: create_builder(handle, Some(genesis)),
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ use sp_runtime::AccountId32;

use crate::{
chain::{centrifuge, centrifuge::PARA_ID, relay},
pools::utils::env::TestEnv,
utils::env::TestEnv,
};

/// Struct that takes care of handling nonces for accounts
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ use crate::{
relay,
relay::{Runtime as RelayRt, RuntimeApi as RelayRtApi, WASM_BINARY as RelayCode},
},
pools::utils::{
utils::{
accounts::{Keyring, NonceManager},
extrinsics::{xt_centrifuge, xt_relay},
logs,
Expand Down Expand Up @@ -85,7 +85,7 @@ pub mod macros {
macro_rules! assert_events {
($env:expr, $chain:expr, $event:ty, $range:expr, $($pattern:pat_param $(if $extra:tt)? ,)+ ) => {{
use frame_system::EventRecord as __hidden_EventRecord;
use crate::pools::utils::env::macros::{extra_guards, extra_counts};
use crate::utils::env::macros::{extra_guards, extra_counts};
use sp_core::H256 as __hidden_H256;
use codec::Decode as _;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ use crate::{
SignedExtra as RelaySignedExtra, UncheckedExtrinsic as RelayUnchecked,
},
},
pools::utils::{accounts::Keyring, env::TestEnv},
utils::{accounts::Keyring, env::TestEnv},
};

/// Generates an signed-extrinisc for centrifuge-chain.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use frame_support::traits::GenesisBuild;
use serde::{Deserialize, Serialize};
use sp_runtime::{AccountId32, Storage};

use crate::pools::utils::{
use crate::utils::{
accounts::default_accounts,
tokens::{DECIMAL_BASE_12, DECIMAL_BASE_18},
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ use pallet_loans::{
};
use pallet_uniques::Call as UniquesCall;

use crate::{chain::centrifuge::RuntimeCall, pools::utils::tokens::rate_from_percent};
use crate::{chain::centrifuge::RuntimeCall, utils::tokens::rate_from_percent};

/// Structure that manages collateral and loan nft ids
pub struct NftManager {
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ use crate::{
chain::centrifuge::{
Loans, OrmlTokens, Permissions, PoolSystem, RuntimeCall, Timestamp, PARA_ID,
},
pools::utils::{
utils::{
accounts::Keyring,
env::TestEnv,
loans::NftManager,
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
use cfg_types::fixed_point::Rate;
use sp_runtime::FixedPointNumber;

use crate::pools::utils::time::secs::SECONDS_PER_YEAR;
use crate::utils::time::secs::SECONDS_PER_YEAR;

pub const DECIMAL_BASE_12: u128 = 1_000_000_000_000;
pub const DECIMAL_BASE_18: u128 = DECIMAL_BASE_12 * 1_000_000;
Expand Down

0 comments on commit d2a6abc

Please sign in to comment.