mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-07-23 09:35:42 +00:00
Switch parachain interface to new runtime_interface macro (#665)
* Make use of `runtime_interface` for parachain externalities This also changes the encoding of the `ValidationResult` return value to match the default encoding used in Substrate. * Fix compilation for web * Update `Cargo.lock` * Include feedback * Move proc macro * Update parachain/src/lib.rs Co-Authored-By: Robert Habermeier <rphmeier@gmail.com> Co-authored-by: Robert Habermeier <rphmeier@gmail.com>
This commit is contained in:
@@ -35,7 +35,7 @@ use application_crypto::KeyTypeId;
|
||||
use trie::TrieConfiguration;
|
||||
|
||||
pub use polkadot_parachain::{
|
||||
Id, ParachainDispatchOrigin, LOWEST_USER_ID, UpwardMessage,
|
||||
Id, ParachainDispatchOrigin, LOWEST_USER_ID, UpwardMessage, TargetedMessage,
|
||||
};
|
||||
|
||||
/// The key type ID for a collator key.
|
||||
@@ -164,36 +164,6 @@ pub struct DutyRoster {
|
||||
pub validator_duty: Vec<Chain>,
|
||||
}
|
||||
|
||||
/// A message targeted to a specific parachain.
|
||||
#[derive(Clone, PartialEq, Eq, Encode, Decode)]
|
||||
#[cfg_attr(feature = "std", derive(Serialize, Deserialize, Debug))]
|
||||
#[cfg_attr(feature = "std", serde(rename_all = "camelCase"))]
|
||||
#[cfg_attr(feature = "std", serde(deny_unknown_fields))]
|
||||
pub struct TargetedMessage {
|
||||
/// The target parachain.
|
||||
pub target: Id,
|
||||
/// The message data.
|
||||
pub data: Vec<u8>,
|
||||
}
|
||||
|
||||
impl AsRef<[u8]> for TargetedMessage {
|
||||
fn as_ref(&self) -> &[u8] {
|
||||
&self.data[..]
|
||||
}
|
||||
}
|
||||
|
||||
impl PartialOrd for TargetedMessage {
|
||||
fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
|
||||
Some(self.target.cmp(&other.target))
|
||||
}
|
||||
}
|
||||
|
||||
impl Ord for TargetedMessage {
|
||||
fn cmp(&self, other: &Self) -> Ordering {
|
||||
self.target.cmp(&other.target)
|
||||
}
|
||||
}
|
||||
|
||||
/// Outgoing message data for a parachain candidate.
|
||||
///
|
||||
/// This is data produced by evaluating the candidate. It contains
|
||||
|
||||
Reference in New Issue
Block a user