-
Notifications
You must be signed in to change notification settings - Fork 8
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
Allow reserve asset transfer of relaychain token to parachain and back #260
Closed
Closed
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
a548f1a
add orml_tokens pallet
brenzi e3e1242
add orml-currencies
brenzi 9bd51d1
fixes
brenzi 245e049
fixing asset trapped due to missing trader for relay native
brenzi 956fd2f
allow sending relaychain native back to relay
brenzi 345503f
cleanup
brenzi b5f36dd
cosmetics
brenzi 243f930
taplo fmt
brenzi ea9f745
fix benchmarks build
brenzi f64488e
Merge branch 'master' into ab/xcm-asset-hub
brenzi 49b24e7
fix CannotCreateHold for preimage
brenzi 6e43056
zombienet stuff
brenzi 80c705f
bump version one more
brenzi 289bdea
better logs for zombienet
brenzi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
name = "integritee-collator" | ||
description = "The Integritee parachain collator binary" | ||
# align major.minor revision with the runtimes. bump patch revision ad lib. make this the github release tag | ||
version = "1.8.1" | ||
version = "1.8.2" | ||
authors = ["Integritee AG <[email protected]>"] | ||
homepage = "https://integritee.network/" | ||
repository = "https://github.com/integritee-network/parachain" | ||
|
@@ -20,7 +20,7 @@ futures = { workspace = true, features = ["std"] } | |
hex-literal = { workspace = true } | ||
log = { workspace = true, features = ["std"] } | ||
parity-scale-codec = { workspace = true, features = ["std"] } | ||
serde = { workspace = true } | ||
serde = { workspace = true, features = ["std"] } | ||
serde_json = { workspace = true } | ||
|
||
# Parachain runtimes | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
name = "integritee-runtime" | ||
description = "The Integritee parachain runtime" | ||
# patch revision must match runtime spec_version | ||
version = "1.8.46" | ||
version = "1.8.47" | ||
authors = ["Integritee AG <[email protected]>"] | ||
homepage = "https://integritee.network/" | ||
repository = "https://github.com/integritee-network/parachain" | ||
|
@@ -12,6 +12,7 @@ edition = "2021" | |
log = { workspace = true } | ||
parity-scale-codec = { workspace = true } | ||
scale-info = { workspace = true } | ||
serde = { workspace = true } | ||
|
||
parachains-common = { path = "../common", default-features = false } | ||
|
||
|
@@ -31,6 +32,8 @@ frame-support = { workspace = true } | |
frame-system = { workspace = true } | ||
frame-system-rpc-runtime-api = { workspace = true } | ||
frame-try-runtime = { workspace = true, optional = true } | ||
orml-currencies = { workspace = true } | ||
orml-tokens = { workspace = true } | ||
orml-traits = { workspace = true } | ||
orml-xcm = { workspace = true } | ||
orml-xcm-support = { workspace = true } | ||
|
@@ -114,7 +117,9 @@ std = [ | |
"frame-system/std", | ||
"frame-try-runtime?/std", | ||
"log/std", | ||
"orml-currencies/std", | ||
"orml-traits/std", | ||
"orml-tokens/std", | ||
"orml-xcm-support/std", | ||
"orml-xcm/std", | ||
"orml-xtokens/std", | ||
|
@@ -146,6 +151,7 @@ std = [ | |
"polkadot-parachain-primitives/std", | ||
"polkadot-runtime-common/std", | ||
"scale-info/std", | ||
"serde/std", | ||
"sp-api/std", | ||
"sp-block-builder/std", | ||
"sp-consensus-aura/std", | ||
|
@@ -176,6 +182,7 @@ runtime-benchmarks = [ | |
"frame-system-benchmarking/runtime-benchmarks", | ||
"frame-system/runtime-benchmarks", | ||
"hex-literal", | ||
"orml-tokens/runtime-benchmarks", | ||
"orml-xtokens/runtime-benchmarks", | ||
"pallet-balances/runtime-benchmarks", | ||
"pallet-bounties/runtime-benchmarks", | ||
|
@@ -213,6 +220,8 @@ try-runtime = [ | |
"frame-executive/try-runtime", | ||
"frame-system/try-runtime", | ||
"frame-try-runtime/try-runtime", | ||
"orml-currencies/try-runtime", | ||
"orml-tokens/try-runtime", | ||
"orml-xcm/try-runtime", | ||
"orml-xtokens/try-runtime", | ||
"pallet-aura/try-runtime", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,6 +43,7 @@ use sp_std::prelude::*; | |
use sp_version::NativeVersion; | ||
use sp_version::RuntimeVersion; | ||
// A few exports that help ease life for downstream crates. | ||
use core::marker::PhantomData; | ||
pub use frame_support::{ | ||
construct_runtime, | ||
dispatch::DispatchClass, | ||
|
@@ -67,6 +68,7 @@ use frame_system::{ | |
limits::{BlockLength, BlockWeights}, | ||
EnsureRoot, EnsureWithSuccess, | ||
}; | ||
use orml_traits::{currency::MutationHooks, parameter_type_with_key}; | ||
pub use pallet_balances::Call as BalancesCall; | ||
pub use pallet_timestamp::Call as TimestampCall; | ||
use parachains_common::{ | ||
|
@@ -75,7 +77,8 @@ use parachains_common::{ | |
NORMAL_DISPATCH_RATIO, SLOT_DURATION, | ||
}; | ||
pub use parachains_common::{ | ||
AccountId, Address, Balance, BlockNumber, Hash, Header, Nonce, Signature, MILLISECS_PER_BLOCK, | ||
AccountId, Address, Amount, Balance, BlockNumber, Hash, Header, Nonce, Signature, | ||
MILLISECS_PER_BLOCK, | ||
}; | ||
use scale_info::TypeInfo; | ||
#[cfg(any(feature = "std", test))] | ||
|
@@ -95,6 +98,8 @@ mod weights; | |
|
||
pub mod xcm_config; | ||
|
||
use xcm_config::CurrencyId; | ||
|
||
pub type SessionHandlers = (); | ||
|
||
/// Opaque types. These are used by the CLI to instantiate machinery that don't need to know | ||
|
@@ -116,7 +121,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { | |
spec_name: create_runtime_str!("integritee-parachain"), | ||
impl_name: create_runtime_str!("integritee-full"), | ||
authoring_version: 2, | ||
spec_version: 46, | ||
spec_version: 47, | ||
impl_version: 1, | ||
apis: RUNTIME_API_VERSIONS, | ||
transaction_version: 6, | ||
|
@@ -135,6 +140,8 @@ pub const fn deposit(items: u32, bytes: u32) -> Balance { | |
/// A timestamp: milliseconds since the unix epoch. | ||
pub type Moment = u64; | ||
|
||
pub type ReserveIdentifier = [u8; 8]; | ||
|
||
/// The version information used to identify this runtime when compiled natively. | ||
#[cfg(feature = "std")] | ||
pub fn native_version() -> NativeVersion { | ||
|
@@ -249,7 +256,7 @@ impl pallet_balances::Config for Runtime { | |
type AccountStore = System; | ||
type WeightInfo = weights::pallet_balances::WeightInfo<Runtime>; | ||
type MaxReserves = MaxReserves; | ||
type ReserveIdentifier = [u8; 8]; | ||
type ReserveIdentifier = ReserveIdentifier; | ||
type RuntimeHoldReason = RuntimeHoldReason; | ||
type RuntimeFreezeReason = (); | ||
type FreezeIdentifier = (); | ||
|
@@ -761,6 +768,58 @@ impl orml_xcm::Config for Runtime { | |
type SovereignOrigin = EnsureRoot<AccountId>; | ||
} | ||
|
||
parameter_type_with_key! { | ||
pub ExistentialDeposits: |currency_id: CurrencyId| -> Balance { | ||
match currency_id { | ||
CurrencyId::TEER => MILLITEER, | ||
CurrencyId::RelayNative => 3_333_333u128.into() // keep this with asset hub ED | ||
} | ||
}; | ||
} | ||
|
||
pub struct CurrencyHooks<T, DustAccount>(PhantomData<T>, DustAccount); | ||
impl<T, DustAccount> MutationHooks<T::AccountId, T::CurrencyId, T::Balance> | ||
for CurrencyHooks<T, DustAccount> | ||
where | ||
T: orml_tokens::Config, | ||
DustAccount: Get<<T as frame_system::Config>::AccountId>, | ||
{ | ||
type OnDust = orml_tokens::TransferDust<T, DustAccount>; | ||
type OnSlash = (); | ||
type PreDeposit = (); | ||
type PostDeposit = (); | ||
type PreTransfer = (); | ||
type PostTransfer = (); | ||
type OnNewTokenAccount = (); | ||
type OnKilledTokenAccount = (); | ||
} | ||
|
||
impl orml_tokens::Config for Runtime { | ||
type RuntimeEvent = RuntimeEvent; | ||
type Balance = Balance; | ||
type Amount = Amount; | ||
type CurrencyId = CurrencyId; | ||
type WeightInfo = weights::orml_tokens::WeightInfo<Runtime>; | ||
type ExistentialDeposits = ExistentialDeposits; | ||
type CurrencyHooks = CurrencyHooks<Runtime, TreasuryAccount>; | ||
type MaxLocks = MaxLocks; | ||
type MaxReserves = MaxReserves; | ||
type ReserveIdentifier = ReserveIdentifier; | ||
type DustRemovalWhitelist = Nothing; | ||
} | ||
|
||
parameter_types! { | ||
pub const GetNativeCurrencyId: CurrencyId = CurrencyId::TEER; | ||
} | ||
|
||
impl orml_currencies::Config for Runtime { | ||
type MultiCurrency = Tokens; | ||
type NativeCurrency = | ||
orml_currencies::BasicCurrencyAdapter<Runtime, Balances, Amount, BlockNumber>; | ||
type GetNativeCurrencyId = GetNativeCurrencyId; | ||
type WeightInfo = (); | ||
} | ||
|
||
construct_runtime!( | ||
pub enum Runtime | ||
{ | ||
|
@@ -802,6 +861,8 @@ construct_runtime!( | |
XTokens: orml_xtokens = 34, | ||
OrmlXcm: orml_xcm = 35, | ||
XcmTransactor: pallet_xcm_transactor = 36, | ||
Tokens: orml_tokens exclude_parts { Call } = 41, | ||
Currencies: orml_currencies = 42, | ||
|
||
// Integritee pallets. | ||
Teerex: pallet_teerex = 50, | ||
|
@@ -861,10 +922,6 @@ mod benches { | |
[pallet_child_bounties, ChildBounties] | ||
[pallet_claims, Claims] | ||
[pallet_collective, Council] | ||
// Fixme #177: For some reason the benchmarks write both to the same pallet_collective weight | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see no reason to fix this. of course the benchmark is the same for two instances of the same pallet |
||
// file. No reason to run both before we fix that, as the pallet_collective benchmark | ||
// takes the longest. | ||
// [pallet_collective, TechnicalCommittee] | ||
[pallet_democracy, Democracy] | ||
[pallet_multisig, Multisig] | ||
[pallet_preimage, Preimage] | ||
|
@@ -880,6 +937,8 @@ mod benches { | |
[pallet_xcm, PolkadotXcm] | ||
[cumulus_pallet_xcmp_queue, XcmpQueue] | ||
[pallet_utility, Utility] | ||
// fixme https://github.com/integritee-network/parachain/issues/261 | ||
//[orml_tokens, benchmarking::tokens] | ||
); | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would be nicer to call this KSM, but as we want to have one runtime for KSM and DOT, we may keep it generic RelayNative