Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Asset Hub naming in code and release notes #71

Merged
Show file tree
Hide file tree
Changes from 16 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
15 changes: 13 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,20 @@ jobs:
EOF

for JSON in $(<<<$CONTEXT sort -sr)
do tee -a DRAFT <<-EOF
do
SPEC_NAME=$(WASM 'core_version.specName')
# Check for spec names and adjust the heading accordingly
if [[ "$SPEC_NAME" == "statemint" ]]; then
HEADING="Asset Hub Polkadot (previously Statemint)"
elif [[ "$SPEC_NAME" == "statemine" ]]; then
HEADING="Asset Hub Kusama (previously Statemine)"
else
HEADING=$(WASM 'core_version.specName / "-" | map(. / "" | first |= ascii_upcase | add) | join(" ")')
fi

### $(WASM 'core_version.specName / "-" | map(. / "" | first |= ascii_upcase | add) | join(" ")')
tee -a DRAFT <<-EOF

### $HEADING
~~~
🏋️ Runtime Size: $(numfmt --to iec-i --format "%.2f" $(WASM size)) ($(WASM size) bytes)
🗜 Compressed: $(WASM 'compression | if .compressed then "Yes: \(1 - .size_compressed / .size_decompressed | . * 10000 | round / 100)%" else "No" end')
Expand Down
12 changes: 6 additions & 6 deletions relay/kusama/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2227,7 +2227,7 @@ sp_api::impl_runtime_apis! {
use frame_benchmarking::baseline::Pallet as Baseline;
use xcm::latest::prelude::*;
use xcm_config::{
LocalCheckAccount, SovereignAccountOf, Statemine, TokenLocation, XcmConfig,
LocalCheckAccount, SovereignAccountOf, AssetHub, TokenLocation, XcmConfig,
};

impl pallet_session_benchmarking::Config for Runtime {}
Expand All @@ -2242,7 +2242,7 @@ sp_api::impl_runtime_apis! {
type XcmConfig = XcmConfig;
type AccountIdConverter = SovereignAccountOf;
fn valid_destination() -> Result<MultiLocation, BenchmarkError> {
Ok(Statemine::get())
Ok(AssetHub::get())
}
fn worst_case_holding(_depositable_count: u32) -> MultiAssets {
// Kusama only knows about KSM.
Expand All @@ -2255,7 +2255,7 @@ sp_api::impl_runtime_apis! {

parameter_types! {
pub const TrustedTeleporter: Option<(MultiLocation, MultiAsset)> = Some((
Statemine::get(),
AssetHub::get(),
MultiAsset { fun: Fungible(1 * UNITS), id: Concrete(TokenLocation::get()) },
));
pub const TrustedReserve: Option<(MultiLocation, MultiAsset)> = None;
Expand Down Expand Up @@ -2294,15 +2294,15 @@ sp_api::impl_runtime_apis! {
}

fn transact_origin_and_runtime_call() -> Result<(MultiLocation, RuntimeCall), BenchmarkError> {
Ok((Statemine::get(), frame_system::Call::remark_with_event { remark: vec![] }.into()))
Ok((AssetHub::get(), frame_system::Call::remark_with_event { remark: vec![] }.into()))
}

fn subscribe_origin() -> Result<MultiLocation, BenchmarkError> {
Ok(Statemine::get())
Ok(AssetHub::get())
}

fn claimable_asset() -> Result<(MultiLocation, MultiLocation, MultiAssets), BenchmarkError> {
let origin = Statemine::get();
let origin = AssetHub::get();
let assets: MultiAssets = (Concrete(TokenLocation::get()), 1_000 * UNITS).into();
let ticket = MultiLocation { parents: 0, interior: Here };
Ok((origin, ticket, assets))
Expand Down
6 changes: 3 additions & 3 deletions relay/kusama/src/xcm_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,14 +126,14 @@ pub type XcmRouter = WithUniqueTopic<(

parameter_types! {
pub const Ksm: MultiAssetFilter = Wild(AllOf { fun: WildFungible, id: Concrete(TokenLocation::get()) });
pub const Statemine: MultiLocation = Parachain(1000).into_location();
pub const AssetHub: MultiLocation = Parachain(1000).into_location();
pub const Encointer: MultiLocation = Parachain(1001).into_location();
pub const KsmForStatemine: (MultiAssetFilter, MultiLocation) = (Ksm::get(), Statemine::get());
pub const KsmForAssetHub: (MultiAssetFilter, MultiLocation) = (Ksm::get(), AssetHub::get());
pub const KsmForEncointer: (MultiAssetFilter, MultiLocation) = (Ksm::get(), Encointer::get());
pub const MaxAssetsIntoHolding: u32 = 64;
}
pub type TrustedTeleporters =
(xcm_builder::Case<KsmForStatemine>, xcm_builder::Case<KsmForEncointer>);
(xcm_builder::Case<KsmForAssetHub>, xcm_builder::Case<KsmForEncointer>);

match_types! {
pub type OnlyParachains: impl Contains<MultiLocation> = {
Expand Down
4 changes: 2 additions & 2 deletions relay/polkadot/constants/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@ pub mod xcm {

/// System Parachains.
pub mod system_parachain {
/// Statemint parachain ID.
pub const STATEMINT_ID: u32 = 1000;
/// Asset Hub parachain ID.
pub const ASSET_HUB_ID: u32 = 1000;
/// Collectives parachain ID.
pub const COLLECTIVES_ID: u32 = 1001;
}
Expand Down
12 changes: 6 additions & 6 deletions relay/polkadot/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2161,7 +2161,7 @@ sp_api::impl_runtime_apis! {
use frame_system_benchmarking::Pallet as SystemBench;
use frame_benchmarking::baseline::Pallet as Baseline;
use xcm::latest::prelude::*;
use xcm_config::{XcmConfig, StatemintLocation, TokenLocation, LocalCheckAccount, SovereignAccountOf};
use xcm_config::{XcmConfig, AssetHubLocation, TokenLocation, LocalCheckAccount, SovereignAccountOf};

impl pallet_session_benchmarking::Config for Runtime {}
impl pallet_offences_benchmarking::Config for Runtime {}
Expand All @@ -2179,7 +2179,7 @@ sp_api::impl_runtime_apis! {
type XcmConfig = XcmConfig;
type AccountIdConverter = SovereignAccountOf;
fn valid_destination() -> Result<MultiLocation, BenchmarkError> {
Ok(StatemintLocation::get())
Ok(AssetHubLocation::get())
}
fn worst_case_holding(_depositable_count: u32) -> MultiAssets {
// Polkadot only knows about DOT
Expand All @@ -2189,7 +2189,7 @@ sp_api::impl_runtime_apis! {

parameter_types! {
pub const TrustedTeleporter: Option<(MultiLocation, MultiAsset)> = Some((
StatemintLocation::get(),
AssetHubLocation::get(),
MultiAsset { id: Concrete(TokenLocation::get()), fun: Fungible(1 * UNITS) }
));
pub const TrustedReserve: Option<(MultiLocation, MultiAsset)> = None;
Expand Down Expand Up @@ -2228,15 +2228,15 @@ sp_api::impl_runtime_apis! {
}

fn transact_origin_and_runtime_call() -> Result<(MultiLocation, RuntimeCall), BenchmarkError> {
Ok((StatemintLocation::get(), frame_system::Call::remark_with_event { remark: vec![] }.into()))
Ok((AssetHubLocation::get(), frame_system::Call::remark_with_event { remark: vec![] }.into()))
}

fn subscribe_origin() -> Result<MultiLocation, BenchmarkError> {
Ok(StatemintLocation::get())
Ok(AssetHubLocation::get())
}

fn claimable_asset() -> Result<(MultiLocation, MultiLocation, MultiAssets), BenchmarkError> {
let origin = StatemintLocation::get();
let origin = AssetHubLocation::get();
let assets: MultiAssets = (Concrete(TokenLocation::get()), 1_000 * UNITS).into();
let ticket = MultiLocation { parents: 0, interior: Here };
Ok((origin, ticket, assets))
Expand Down
8 changes: 4 additions & 4 deletions relay/polkadot/src/xcm_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,16 +131,16 @@ pub type XcmRouter = WithUniqueTopic<(

parameter_types! {
pub const Dot: MultiAssetFilter = Wild(AllOf { fun: WildFungible, id: Concrete(TokenLocation::get()) });
pub const StatemintLocation: MultiLocation = Parachain(STATEMINT_ID).into_location();
pub const DotForStatemint: (MultiAssetFilter, MultiLocation) = (Dot::get(), StatemintLocation::get());
pub const AssetHubLocation: MultiLocation = Parachain(ASSET_HUB_ID).into_location();
pub const DotForAssetHub: (MultiAssetFilter, MultiLocation) = (Dot::get(), AssetHubLocation::get());
pub const CollectivesLocation: MultiLocation = Parachain(COLLECTIVES_ID).into_location();
pub const DotForCollectives: (MultiAssetFilter, MultiLocation) = (Dot::get(), CollectivesLocation::get());
pub const MaxAssetsIntoHolding: u32 = 64;
}

/// Polkadot Relay recognizes/respects the Statemint chain as a teleporter.
/// Polkadot Relay recognizes/respects the Asset Hub chain as a teleporter.
pub type TrustedTeleporters =
(xcm_builder::Case<DotForStatemint>, xcm_builder::Case<DotForCollectives>);
(xcm_builder::Case<DotForAssetHub>, xcm_builder::Case<DotForCollectives>);

match_types! {
pub type OnlyParachains: impl Contains<MultiLocation> = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

//! Tests for the Statemine (Kusama Assets Hub) chain.
//! Tests for the Kusama Asset Hub (previously known as Statemine) chain.

use asset_hub_kusama_runtime::xcm_config::{
AssetFeeAsExistentialDepositMultiplierFeeCharger, KsmLocation, TrustBackedAssetsPalletLocation,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

//! Tests for the Statemint (Polkadot Assets Hub) chain.
//! Tests for the Polkadot Asset Hub (previously known as Statemint) chain.

use asset_hub_polkadot_runtime::xcm_config::{
AssetFeeAsExistentialDepositMultiplierFeeCharger, CheckingAccount, DotLocation,
Expand Down
Loading