-
Notifications
You must be signed in to change notification settings - Fork 1
Conversation
@@ -605,7 +605,7 @@ parameter_types! { | |||
} | |||
|
|||
parameter_types! { | |||
pub TreasuryAccount: AccountId = PalletId(*b"py/trsry").into_account_truncating(); | |||
pub TreasuryAccount: AccountId = TREASURY_PALLET_ID.into_account_truncating(); |
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.
Re-use the TREASURY_PALLET_ID for now. TREASURY_PALLET_ID defined to be same thing anyway:
PalletId(*b"py/trsry")
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.
Sounds fine. The local fees can all go to the common treasury account for BridgeHub.
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.
Addressed in Snowfork/snowbridge@5c03ad8.
cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/xcm_config.rs
Outdated
Show resolved
Hide resolved
cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/xcm_config.rs
Outdated
Show resolved
Hide resolved
let receiver = ReceiverAccount::get(); | ||
// There is an origin so split fee into parts. | ||
if let Some(XcmContext { origin: Some(origin), .. }) = context { | ||
if let Some(origin) = SovereignAccountOf::convert_location(origin) { |
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.
Our other pallets on BridgeHub have all standardized on using this function for converting sibling para_id's into sovereign accounts:
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.
Addressed in 4e2b4ff
Just a note here, I tried to do this in multiple ways but the traits contraints bled out into the implementations of control pallet, outbound queue, benchmarks and tests. So in the end I decided to just copy the function and create a test that makes sure the outputs are always the same.
I tried changing from T::AcccountId
to plain AccountId
but then some scale codec traits were required on our pallets and then bled into the benchmarks which are generated by macros and cannot be applied there.
primitives/core/src/lib.rs:29:29
Compiling snowbridge-core v0.1.1 (/Users/alistairsingh/c/snowbridge/parachain/primitives/core)
error[E0277]: the trait bound `T: WrapperTypeEncode` is not satisfied
--> primitives/core/src/lib.rs:28:31
|
28 | SiblingParaId::from(para_id).into_account_truncating()
| ^^^^^^^^^^^^^^^^^^^^^^^ the trait `WrapperTypeEncode` is not implemented for `T`
|
= note: required for `T` to implement `Encode`
= note: required for `Sibling` to implement `AccountIdConversion<T>`
help: consider restricting type parameter `T`
|
27 | pub fn sibling_sovereign_account<T: parity_scale_codec::WrapperTypeEncode>(para_id: ParaId) -> T {
| +++++++++++++++++++++++++++++++++++++++
error[E0277]: the trait bound `T: WrapperTypeDecode` is not satisfied
--> primitives/core/src/lib.rs:28:31
|
28 | SiblingParaId::from(para_id).into_account_truncating()
| ^^^^^^^^^^^^^^^^^^^^^^^ the trait `WrapperTypeDecode` is not implemented for `T`
|
= note: required for `T` to implement `Decode`
= note: required for `Sibling` to implement `AccountIdConversion<T>`
help: consider restricting type parameter `T`
|
27 | pub fn sibling_sovereign_account<T: parity_scale_codec::WrapperTypeDecode>(para_id: ParaId) -> T {
| +++++++++++++++++++++++++++++++++++++++
For more information about this error, try `rustc --explain E0277`.
error: could not compile `snowbridge-core` (lib) due to 2 previous errors
warning: build failed, waiting for other jobs to finish...
error: could not compile `snowbridge-core` (lib test) due to 2 previous errors
4e2b4ff
to
aeb163e
Compare
|
||
/// A `HandleFee` implementation that takes fees from `ExportMessage` XCM instructions | ||
/// to Snowbridge and holds it in a receiver account. Burns the fees in case of a failure. | ||
pub struct XcmExportFeeToSnowbridge< |
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.
Since we're going to use this type in about 5 different BridgeHub runtimes, lets move it to a new crate named snowbridge-runtime-common
, located in our own Snowbridge repo, in this directory: parachain/primitives/runtime-common
.
Then we can the runtimes depend on our runtime-common crate.
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.
Addressed in e3bd0e2
e3bd0e2
to
8bfa0c1
Compare
XcmExportFeeToSnowbridge< | ||
TokenLocation, | ||
EthereumNetwork, | ||
Self::AssetTransactor, | ||
crate::EthereumOutboundQueue, | ||
>, |
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.
Nice!
Resolves: SNO-669
Snowbridge: Snowfork/snowbridge#999