Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4,162 changes: 2,001 additions & 2,161 deletions Cargo.lock

Large diffs are not rendered by default.

1,031 changes: 514 additions & 517 deletions Cargo.toml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion integration-tests/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "runtime-integration-tests"
version = "1.0.6"
version = "1.0.7"
description = "Integration tests"
authors = ["GalacticCouncil"]
edition = "2021"
Expand Down
4 changes: 2 additions & 2 deletions integration-tests/src/fees.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,8 @@ fn transaction_fees_should_be_as_expected_when_nft_is_minted() {
#[test]
fn transaction_fees_should_be_as_expected_when_nft_collection_is_created() {
Basilisk::execute_with(|| {
let expected_rust_encoded_fees = 61_167 * UNITS / 100; //611.67
let expected_ui_fees = 61_167 * UNITS / 100; //611.67
let expected_rust_encoded_fees = 70_000 * UNITS / 100;
let expected_ui_fees = 70_000 * UNITS / 100;

let call = pallet_nft::Call::<basilisk_runtime::Runtime>::create_collection {
collection_id: 0,
Expand Down
32 changes: 28 additions & 4 deletions integration-tests/src/kusama_test_net.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ use frame_support::assert_ok;
use frame_support::traits::OnInitialize;
use pallet_transaction_multi_payment::Price;
pub use pallet_xyk::types::AssetPair;
use polkadot_primitives::v7::{BlockNumber, MAX_CODE_SIZE, MAX_POV_SIZE};
use polkadot_primitives::v8::{BlockNumber, MAX_CODE_SIZE, MAX_POV_SIZE};
use polkadot_runtime_parachains::configuration::HostConfiguration;
use pretty_assertions::assert_eq;
use primitives::{constants::time::SLOT_DURATION, AssetId, Balance};
Expand Down Expand Up @@ -167,13 +167,12 @@ pub mod rococo {
}

use polkadot_primitives::{AssignmentId, ValidatorId};
use polkadot_service::chain_spec::get_authority_keys_from_seed_no_beefy;
use polkadot_service::chain_spec::get_account_id_from_seed;
use sc_consensus_grandpa::AuthorityId as GrandpaId;
use sp_authority_discovery::AuthorityId as AuthorityDiscoveryId;
use sp_consensus_babe::AuthorityId as BabeId;
use sp_consensus_beefy::ecdsa_crypto::AuthorityId as BeefyId;

use sp_core::{Pair, Public};
use sp_core::{sr25519, Pair, Public};

/// Helper function to generate a crypto pair from seed
fn get_from_seed<TPublic: Public>(seed: &str) -> <TPublic::Pair as Pair>::Public {
Expand All @@ -200,6 +199,28 @@ pub mod rococo {
}
}

pub fn get_authority_keys_from_seed_no_beefy(
seed: &str,
) -> (
AccountId,
AccountId,
BabeId,
GrandpaId,
ValidatorId,
AssignmentId,
AuthorityDiscoveryId,
) {
(
get_account_id_from_seed::<sr25519::Public>(&format!("{}//stash", seed)),
get_account_id_from_seed::<sr25519::Public>(seed),
get_from_seed::<BabeId>(seed),
get_from_seed::<GrandpaId>(seed),
get_from_seed::<ValidatorId>(seed),
get_from_seed::<AssignmentId>(seed),
get_from_seed::<AuthorityDiscoveryId>(seed),
)
}

pub fn initial_authorities() -> Vec<(
AccountId,
AccountId,
Expand Down Expand Up @@ -250,6 +271,7 @@ pub mod rococo {
)
})
.collect::<Vec<_>>(),
non_authority_keys: Default::default(),
},
babe: rococo_runtime::BabeConfig {
authorities: Default::default(),
Expand Down Expand Up @@ -373,6 +395,7 @@ pub mod basilisk {
)
})
.collect(),
non_authority_keys: Default::default(),
},
asset_registry: basilisk_runtime::AssetRegistryConfig {
registered_assets: vec![
Expand Down Expand Up @@ -460,6 +483,7 @@ pub mod other_parachain {
)
})
.collect(),
non_authority_keys: Default::default(),
},
asset_registry: basilisk_runtime::AssetRegistryConfig {
registered_assets: vec![(b"AUSD".to_vec(), 1_000_000u128, Some(AUSD))],
Expand Down
17 changes: 17 additions & 0 deletions integration-tests/src/router.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ mod router_different_pools_tests {
asset_out: KSM,
amount_in: amount_to_sell,
amount_out,
event_id: 0,
}
.into()]);
});
Expand Down Expand Up @@ -147,6 +148,7 @@ mod router_different_pools_tests {
asset_out: KSM,
amount_in,
amount_out: amount_to_buy,
event_id: 0,
}
.into()]);
});
Expand Down Expand Up @@ -205,6 +207,7 @@ mod xyk_router_tests {
asset_out: KSM,
amount_in: amount_to_sell,
amount_out,
event_id: 0,
}
.into()]);
});
Expand Down Expand Up @@ -267,6 +270,7 @@ mod xyk_router_tests {
asset_out: KSM,
amount_in: amount_to_sell,
amount_out,
event_id: 0,
}
.into()]);
});
Expand Down Expand Up @@ -489,6 +493,7 @@ mod xyk_router_tests {
asset_out: KSM,
amount_in,
amount_out: amount_to_buy,
event_id: 0,
}
.into()]);
});
Expand Down Expand Up @@ -544,6 +549,7 @@ mod xyk_router_tests {
asset_out: AUSD,
amount_in,
amount_out: amount_to_buy,
event_id: 0,
}
.into()]);
});
Expand Down Expand Up @@ -607,6 +613,7 @@ mod xyk_router_tests {
asset_out: AUSD,
amount_in,
amount_out: amount_to_buy,
event_id: 0,
}
.into()]);
});
Expand Down Expand Up @@ -845,6 +852,7 @@ mod lbp_router_tests {
asset_out: NEW_BOOTSTRAPPED_TOKEN,
amount_in: amount_to_sell,
amount_out,
event_id: 0,
}
.into()]);
});
Expand Down Expand Up @@ -892,6 +900,7 @@ mod lbp_router_tests {
asset_out: BSX,
amount_in: amount_to_sell,
amount_out,
event_id: 0,
}
.into()]);
});
Expand Down Expand Up @@ -945,6 +954,7 @@ mod lbp_router_tests {
asset_out: KSM,
amount_in: amount_to_sell,
amount_out,
event_id: 0,
}
.into()]);
});
Expand Down Expand Up @@ -998,6 +1008,7 @@ mod lbp_router_tests {
asset_out: KSM,
amount_in: amount_to_sell,
amount_out,
event_id: 0,
}
.into()]);
});
Expand Down Expand Up @@ -1045,6 +1056,7 @@ mod lbp_router_tests {
asset_out: NEW_BOOTSTRAPPED_TOKEN,
amount_in: amount_to_sell,
amount_out: received_amount_out,
event_id: 0,
}
.into()]);
});
Expand Down Expand Up @@ -1117,6 +1129,7 @@ mod lbp_router_tests {
asset_out: NEW_BOOTSTRAPPED_TOKEN,
amount_in,
amount_out: amount_to_buy,
event_id: 0,
}
.into()]);
});
Expand Down Expand Up @@ -1164,6 +1177,7 @@ mod lbp_router_tests {
asset_out: BSX,
amount_in,
amount_out: amount_to_buy,
event_id: 0,
}
.into()]);
});
Expand Down Expand Up @@ -1217,6 +1231,7 @@ mod lbp_router_tests {
asset_out: KSM,
amount_in,
amount_out: amount_to_buy,
event_id: 0,
}
.into()]);
});
Expand Down Expand Up @@ -1270,6 +1285,7 @@ mod lbp_router_tests {
asset_out: KSM,
amount_in,
amount_out: amount_to_buy,
event_id: 0,
}
.into()]);
});
Expand Down Expand Up @@ -1317,6 +1333,7 @@ mod lbp_router_tests {
asset_out: NEW_BOOTSTRAPPED_TOKEN,
amount_in: spent_amount_in,
amount_out: amount_to_buy,
event_id: 0,
}
.into()]);
});
Expand Down
4 changes: 0 additions & 4 deletions integration-tests/src/sessions.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
#![cfg(test)]
use crate::kusama_test_net::*;
use basilisk_runtime::CollatorRewards;
use basilisk_runtime::Runtime;
use frame_support::traits::Contains;
use pallet_session::SessionManager;
use polkadot_xcm::v3::prelude::*;
use polkadot_xcm::VersionedXcm;
use pretty_assertions::assert_eq;
use xcm_emulator::TestExt;
#[test]
Expand Down
2 changes: 1 addition & 1 deletion node/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "basilisk"
version = "17.0.0"
version = "18.0.0"
description = "Basilisk node"
authors = ["GalacticCouncil"]
edition = "2021"
Expand Down
5 changes: 2 additions & 3 deletions node/src/chain_spec/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const TOKEN_DECIMALS: u8 = 12;
const TOKEN_SYMBOL: &str = "BSX";
const PROTOCOL_ID: &str = "bsx";

use basilisk_runtime::{AccountId, AuraId, Balance, RuntimeGenesisConfig, Signature, WASM_BINARY};
use basilisk_runtime::{AccountId, AuraId, Balance, Signature, WASM_BINARY};
use cumulus_primitives_core::ParaId;
use hex_literal::hex;
use primitives::{
Expand All @@ -45,7 +45,6 @@ use sp_core::{crypto::UncheckedInto, sr25519, Pair, Public};
use sp_runtime::traits::{IdentifyAccount, Verify};
/// The extensions for the [`ChainSpec`].
#[derive(Debug, Clone, Eq, PartialEq, Serialize, Deserialize, ChainSpecGroup, ChainSpecExtension)]
#[serde(deny_unknown_fields)]
pub struct Extensions {
/// The relay chain of the Parachain.
pub relay_chain: String,
Expand All @@ -61,7 +60,7 @@ impl Extensions {
}

/// Specialized `ChainSpec`. This is a specialization of the general Substrate ChainSpec type.
pub type ChainSpec = sc_service::GenericChainSpec<RuntimeGenesisConfig, Extensions>;
pub type ChainSpec = sc_service::GenericChainSpec<Extensions>;

/// Generate a crypto pair from seed.
pub fn get_from_seed<TPublic: Public>(seed: &str) -> <TPublic::Pair as Pair>::Public {
Expand Down
17 changes: 7 additions & 10 deletions node/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,10 @@ pub fn run() -> sc_cli::Result<()> {
let hwbench = (!cli.no_hardware_benchmarks)
.then_some(config.database.path().map(|database_path| {
let _ = std::fs::create_dir_all(database_path);
sc_sysinfo::gather_hwbench(Some(database_path))
sc_sysinfo::gather_hwbench(
Some(database_path),
&SUBSTRATE_REFERENCE_HARDWARE,
)
}))
.flatten();

Expand All @@ -296,7 +299,7 @@ pub fn run() -> sc_cli::Result<()> {
let id = ParaId::from(para_id);

let parachain_account =
AccountIdConversion::<polkadot_primitives::v7::AccountId>::into_account_truncating(&id);
AccountIdConversion::<polkadot_primitives::v8::AccountId>::into_account_truncating(&id);

let state_version = Cli::runtime_version().state_version();

Expand Down Expand Up @@ -373,15 +376,9 @@ impl CliConfiguration<Self> for RelayChainCli {
self.base.base.prometheus_config(default_listen_port, chain_spec)
}

fn init<F>(
&self,
_support_url: &String,
_impl_version: &String,
_logger_hook: F,
_config: &sc_service::Configuration,
) -> Result<()>
fn init<F>(&self, _support_url: &String, _impl_version: &String, _logger_hook: F) -> Result<()>
where
F: FnOnce(&mut sc_cli::LoggerBuilder, &sc_service::Configuration),
F: FnOnce(&mut sc_cli::LoggerBuilder),
{
unreachable!("PolkadotCli is never initialized; qed");
}
Expand Down
14 changes: 3 additions & 11 deletions node/src/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
use std::sync::Arc;

use basilisk_runtime::{opaque::Block, AccountId, Balance, Index};
pub use sc_rpc_api::DenyUnsafe;
use sc_transaction_pool_api::TransactionPool;
use sp_api::ProvideRuntimeApi;
use sp_block_builder::BlockBuilder;
Expand All @@ -20,8 +19,6 @@ pub struct FullDeps<C, P, B> {
pub client: Arc<C>,
/// Transaction pool instance.
pub pool: Arc<P>,
/// Whether to deny unsafe calls
pub deny_unsafe: DenyUnsafe,
/// Backend used by the node.
pub backend: Arc<B>,
}
Expand All @@ -47,16 +44,11 @@ where
use substrate_state_trie_migration_rpc::{StateMigration, StateMigrationApiServer};

let mut module = RpcExtension::new(());
let FullDeps {
client,
pool,
deny_unsafe,
backend,
} = deps;
let FullDeps { client, pool, backend } = deps;

module.merge(System::new(client.clone(), pool, deny_unsafe).into_rpc())?;
module.merge(System::new(client.clone(), pool).into_rpc())?;
module.merge(TransactionPayment::new(client.clone()).into_rpc())?;
module.merge(StateMigration::new(client, backend, deny_unsafe).into_rpc())?;
module.merge(StateMigration::new(client, backend).into_rpc())?;

// Extend this RPC with a custom API by using the following syntax.
// `YourRpcStruct` should have a reference to a client, which is needed
Expand Down
Loading