379cb741ed
This commit systematically rebrands various references from Parity Technologies' Polkadot/Substrate ecosystem to PezkuwiChain within the kurdistan-sdk. Key changes include: - Updated external repository URLs (zombienet-sdk, parity-db, parity-scale-codec, wasm-instrument) to point to pezkuwichain forks. - Modified internal documentation and code comments to reflect PezkuwiChain naming and structure. - Replaced direct references to with or specific paths within the for XCM, Pezkuwi, and other modules. - Cleaned up deprecated issue and PR references in various and files, particularly in and modules. - Adjusted image and logo URLs in documentation to point to PezkuwiChain assets. - Removed or rephrased comments related to external Polkadot/Substrate PRs and issues. This is a significant step towards fully customizing the SDK for the PezkuwiChain ecosystem.
45 lines
1.1 KiB
Rust
45 lines
1.1 KiB
Rust
// SPDX-License-Identifier: Apache-2.0
|
|
// SPDX-FileCopyrightText: 2023 Snowfork <hello@snowfork.com>
|
|
//! Implementation for [`snowbridge_outbound_queue_primitives::v2::SendMessage`]
|
|
use super::*;
|
|
use codec::Encode;
|
|
use pezframe_support::{
|
|
ensure,
|
|
traits::{EnqueueMessage, Get},
|
|
};
|
|
use snowbridge_outbound_queue_primitives::{
|
|
v2::{Message, SendMessage},
|
|
SendError,
|
|
};
|
|
use pezsp_core::H256;
|
|
use pezsp_runtime::BoundedVec;
|
|
|
|
impl<T> SendMessage for Pallet<T>
|
|
where
|
|
T: Config,
|
|
{
|
|
type Ticket = Message;
|
|
|
|
fn validate(message: &Message) -> Result<Self::Ticket, SendError> {
|
|
// The inner payload should not be too large
|
|
let payload = message.encode();
|
|
ensure!(
|
|
payload.len() < T::MaxMessagePayloadSize::get() as usize,
|
|
SendError::MessageTooLarge
|
|
);
|
|
|
|
Ok(message.clone())
|
|
}
|
|
|
|
fn deliver(ticket: Self::Ticket) -> Result<H256, SendError> {
|
|
let origin = ticket.origin.into();
|
|
|
|
let message =
|
|
BoundedVec::try_from(ticket.encode()).map_err(|_| SendError::MessageTooLarge)?;
|
|
|
|
T::MessageQueue::enqueue_message(message.as_bounded_slice(), origin);
|
|
Self::deposit_event(Event::MessageQueued { message: ticket.clone() });
|
|
Ok(ticket.id)
|
|
}
|
|
}
|