mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 18:41:03 +00:00
Document non-uniqueness of SetTopic IDs (#7579)
* Document non-uniqueness of SetTopic IDs * More comments on WithUniqueTopic
This commit is contained in:
@@ -981,6 +981,10 @@ pub enum Instruction<Call> {
|
|||||||
|
|
||||||
/// Set the Topic Register.
|
/// Set the Topic Register.
|
||||||
///
|
///
|
||||||
|
/// The 32-byte array identifier in the parameter is not guaranteed to be
|
||||||
|
/// unique; if such a property is desired, it is up to the code author to
|
||||||
|
/// enforce uniqueness.
|
||||||
|
///
|
||||||
/// Safety: No concerns.
|
/// Safety: No concerns.
|
||||||
///
|
///
|
||||||
/// Kind: *Instruction*
|
/// Kind: *Instruction*
|
||||||
|
|||||||
@@ -207,6 +207,9 @@ impl<
|
|||||||
|
|
||||||
/// Sets the message ID to `t` using a `SetTopic(t)` in the last position if present.
|
/// Sets the message ID to `t` using a `SetTopic(t)` in the last position if present.
|
||||||
///
|
///
|
||||||
|
/// Note that the message ID does not necessarily have to be unique; it is the
|
||||||
|
/// sender's responsibility to ensure uniqueness.
|
||||||
|
///
|
||||||
/// Requires some inner barrier to pass on the rest of the message.
|
/// Requires some inner barrier to pass on the rest of the message.
|
||||||
pub struct TrailingSetTopicAsId<InnerBarrier>(PhantomData<InnerBarrier>);
|
pub struct TrailingSetTopicAsId<InnerBarrier>(PhantomData<InnerBarrier>);
|
||||||
impl<InnerBarrier: ShouldExecute> ShouldExecute for TrailingSetTopicAsId<InnerBarrier> {
|
impl<InnerBarrier: ShouldExecute> ShouldExecute for TrailingSetTopicAsId<InnerBarrier> {
|
||||||
|
|||||||
@@ -25,6 +25,11 @@ use xcm::prelude::*;
|
|||||||
/// appends one to the message filled with a universally unique ID. This ID is returned from a
|
/// appends one to the message filled with a universally unique ID. This ID is returned from a
|
||||||
/// successful `deliver`.
|
/// successful `deliver`.
|
||||||
///
|
///
|
||||||
|
/// If the message does already end with a `SetTopic` instruction, then it is the responsibility
|
||||||
|
/// of the code author to ensure that the ID supplied to `SetTopic` is universally unique. Due to
|
||||||
|
/// this property, consumers of the topic ID must be aware that a user-supplied ID may not be
|
||||||
|
/// unique.
|
||||||
|
///
|
||||||
/// This is designed to be at the top-level of any routers, since it will always mutate the
|
/// This is designed to be at the top-level of any routers, since it will always mutate the
|
||||||
/// passed `message` reference into a `None`. Don't try to combine it within a tuple except as the
|
/// passed `message` reference into a `None`. Don't try to combine it within a tuple except as the
|
||||||
/// last element.
|
/// last element.
|
||||||
|
|||||||
Reference in New Issue
Block a user