6b597bebcf
- Fix pezpallet-welati EnsureOrigin implementations (3 fixes)
- Remove incorrect #[cfg(not(feature = "runtime-benchmarks"))] blocks
- Affects EnsureSerok, EnsureParlementer, EnsureDiwan
- Fix asset-hub-zagros governance origins macros (2 fixes)
- Remove non-benchmark try_successful_origin from decl_unit_ensures!
- Remove non-benchmark try_successful_origin from decl_ensure!
- Rename snowbridge -> pezsnowbridge for consistency
- Update WORKFLOW_PLAN.md with build status and package names
- Correct package names: pezkuwi-teyrchain-bin, pezstaging-node-cli
- Mark completed builds: pezkuwi, pezkuwi-teyrchain-bin,
pezstaging-node-cli, teyrchain-template-node
74 lines
1.6 KiB
Rust
74 lines
1.6 KiB
Rust
// SPDX-License-Identifier: Apache-2.0
|
|
// SPDX-FileCopyrightText: 2023 Snowfork <hello@snowfork.com>
|
|
|
|
use crate::FAILING_NONCE;
|
|
use pezsnowbridge_core::reward::{AddTip, AddTipError};
|
|
use pezsnowbridge_outbound_queue_primitives::{
|
|
v1::{Fee, Message as MessageV1, SendMessage as SendMessageV1},
|
|
v2::{Message, SendMessage},
|
|
SendMessageFeeProvider,
|
|
};
|
|
use pezsp_core::H256;
|
|
|
|
pub struct MockOkOutboundQueue;
|
|
impl SendMessage for MockOkOutboundQueue {
|
|
type Ticket = ();
|
|
|
|
fn validate(
|
|
_: &Message,
|
|
) -> Result<Self::Ticket, pezsnowbridge_outbound_queue_primitives::SendError> {
|
|
Ok(())
|
|
}
|
|
|
|
fn deliver(
|
|
_: Self::Ticket,
|
|
) -> Result<H256, pezsnowbridge_outbound_queue_primitives::SendError> {
|
|
Ok(H256::zero())
|
|
}
|
|
}
|
|
|
|
impl SendMessageFeeProvider for MockOkOutboundQueue {
|
|
type Balance = u128;
|
|
|
|
fn local_fee() -> Self::Balance {
|
|
0
|
|
}
|
|
}
|
|
|
|
impl AddTip for MockOkOutboundQueue {
|
|
fn add_tip(nonce: u64, _amount: u128) -> Result<(), AddTipError> {
|
|
if nonce == FAILING_NONCE {
|
|
return Err(AddTipError::NonceConsumed);
|
|
}
|
|
Ok(())
|
|
}
|
|
}
|
|
|
|
pub struct MockOkOutboundQueueV1;
|
|
impl SendMessageV1 for MockOkOutboundQueueV1 {
|
|
type Ticket = ();
|
|
|
|
fn validate(
|
|
_: &MessageV1,
|
|
) -> Result<
|
|
(Self::Ticket, Fee<<Self as SendMessageFeeProvider>::Balance>),
|
|
pezsnowbridge_outbound_queue_primitives::SendError,
|
|
> {
|
|
Ok(((), Fee::from((0, 0))))
|
|
}
|
|
|
|
fn deliver(
|
|
_: Self::Ticket,
|
|
) -> Result<H256, pezsnowbridge_outbound_queue_primitives::SendError> {
|
|
Ok(H256::zero())
|
|
}
|
|
}
|
|
|
|
impl SendMessageFeeProvider for MockOkOutboundQueueV1 {
|
|
type Balance = u128;
|
|
|
|
fn local_fee() -> Self::Balance {
|
|
0
|
|
}
|
|
}
|