Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion bridges/bin/runtime-common/src/extensions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ where
#[macro_export]
macro_rules! generate_bridge_reject_obsolete_headers_and_messages {
($call:ty, $account_id:ty, $($filter_call:ty),*) => {
#[derive(Clone, codec::Decode, codec::DecodeWithMemTracking, Default, codec::Encode, Eq, PartialEq, sp_runtime::RuntimeDebug, scale_info::TypeInfo)]
#[derive(Clone, codec::Decode, codec::DecodeWithMemTracking, Default, codec::Encode, Eq, PartialEq, Debug, scale_info::TypeInfo)]
pub struct BridgeRejectObsoleteHeadersAndMessages;
impl sp_runtime::traits::TransactionExtension<$call> for BridgeRejectObsoleteHeadersAndMessages {
const IDENTIFIER: &'static str = "BridgeRejectObsoleteHeadersAndMessages";
Expand Down
6 changes: 3 additions & 3 deletions bridges/modules/grandpa/src/call_ext.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ use bp_header_chain::{
SubmitFinalityProofInfo,
};
use bp_runtime::{BlockNumberOf, Chain, OwnedBridgeModule};
use core::fmt::Debug;
use frame_support::{
dispatch::CallableCallFor,
traits::{Get, IsSubType},
Expand All @@ -32,12 +33,11 @@ use sp_consensus_grandpa::SetId;
use sp_runtime::{
traits::{CheckedSub, Header, Zero},
transaction_validity::{InvalidTransaction, TransactionValidityError},
RuntimeDebug, SaturatedConversion,
SaturatedConversion,
};
use sp_std::fmt::Debug;

/// Verified `SubmitFinalityProofInfo<N>`.
#[derive(Copy, Clone, PartialEq, RuntimeDebug)]
#[derive(Copy, Clone, PartialEq, Debug)]
pub struct VerifiedSubmitFinalityProofInfo<N: Debug> {
/// Base call information.
pub base: SubmitFinalityProofInfo<N>,
Expand Down
4 changes: 2 additions & 2 deletions bridges/modules/grandpa/src/storage_types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ use crate::{Config, Error};

use bp_header_chain::{AuthoritySet, ChainWithGrandpa};
use codec::{Decode, Encode, MaxEncodedLen};
use frame_support::{traits::Get, BoundedVec, CloneNoBound, RuntimeDebugNoBound};
use frame_support::{traits::Get, BoundedVec, CloneNoBound, DebugNoBound};
use scale_info::TypeInfo;
use sp_consensus_grandpa::{AuthorityId, AuthorityList, AuthorityWeight, SetId};
use sp_std::marker::PhantomData;
Expand All @@ -39,7 +39,7 @@ impl<T: Config<I>, I: 'static> Get<u32> for StoredAuthorityListLimit<T, I> {
}

/// A bounded GRANDPA Authority List and ID.
#[derive(CloneNoBound, Decode, Encode, Eq, TypeInfo, MaxEncodedLen, RuntimeDebugNoBound)]
#[derive(CloneNoBound, Decode, Encode, Eq, TypeInfo, MaxEncodedLen, DebugNoBound)]
#[scale_info(skip_type_params(T, I))]
pub struct StoredAuthoritySet<T: Config<I>, I: 'static> {
/// List of GRANDPA authorities for the current round.
Expand Down
4 changes: 2 additions & 2 deletions bridges/modules/messages/src/inbound_lane.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ use bp_messages::{
use bp_runtime::AccountIdOf;
use codec::{Decode, Encode, EncodeLike, MaxEncodedLen};
use scale_info::{Type, TypeInfo};
use sp_runtime::RuntimeDebug;
use sp_std::prelude::PartialEq;
use Debug;

/// Inbound lane storage.
pub trait InboundLaneStorage {
Expand Down Expand Up @@ -58,7 +58,7 @@ pub trait InboundLaneStorage {
/// these generic bounds all over the code.
///
/// The encoding of this type matches encoding of the corresponding `MessageData`.
#[derive(Encode, Decode, Clone, RuntimeDebug, PartialEq, Eq)]
#[derive(Encode, Decode, Clone, Debug, PartialEq, Eq)]
pub struct StoredInboundLaneData<T: Config<I>, I: 'static>(
pub InboundLaneData<AccountIdOf<BridgedChainOf<T, I>>>,
);
Expand Down
6 changes: 2 additions & 4 deletions bridges/modules/messages/src/lanes_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,12 @@ use bp_messages::{
};
use bp_runtime::AccountIdOf;
use codec::{Decode, DecodeWithMemTracking, Encode, MaxEncodedLen};
use frame_support::{ensure, sp_runtime::RuntimeDebug, PalletError};
use frame_support::{ensure, PalletError};
use scale_info::TypeInfo;
use sp_std::marker::PhantomData;

/// Lanes manager errors.
#[derive(
Encode, Decode, DecodeWithMemTracking, RuntimeDebug, PartialEq, Eq, PalletError, TypeInfo,
)]
#[derive(Encode, Decode, DecodeWithMemTracking, Debug, PartialEq, Eq, PalletError, TypeInfo)]
pub enum LanesManagerError {
/// Inbound lane already exists.
InboundLaneAlreadyExists,
Expand Down
6 changes: 2 additions & 4 deletions bridges/modules/messages/src/outbound_lane.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ use bp_messages::{
use codec::{Decode, DecodeWithMemTracking, Encode};
use frame_support::{traits::Get, BoundedVec, PalletError};
use scale_info::TypeInfo;
use sp_runtime::RuntimeDebug;
use sp_std::{collections::vec_deque::VecDeque, marker::PhantomData, ops::RangeInclusive};
use Debug;

/// Outbound lane storage.
pub trait OutboundLaneStorage {
Expand Down Expand Up @@ -65,9 +65,7 @@ impl<T: Config<I>, I: 'static> Get<u32> for StoredMessagePayloadLimit<T, I> {
pub type StoredMessagePayload<T, I> = BoundedVec<u8, StoredMessagePayloadLimit<T, I>>;

/// Result of messages receival confirmation.
#[derive(
Encode, Decode, DecodeWithMemTracking, RuntimeDebug, PartialEq, Eq, PalletError, TypeInfo,
)]
#[derive(Encode, Decode, DecodeWithMemTracking, Debug, PartialEq, Eq, PalletError, TypeInfo)]
pub enum ReceptionConfirmationError {
/// Bridged chain is trying to confirm more messages than we have generated. May be a result
/// of invalid bridged chain storage.
Expand Down
4 changes: 2 additions & 2 deletions bridges/modules/parachains/src/call_ext.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ use pallet_bridge_grandpa::SubmitFinalityProofHelper;
use sp_runtime::{
traits::Zero,
transaction_validity::{InvalidTransaction, TransactionValidityError},
RuntimeDebug,
Debug,
};

/// Verified `SubmitParachainHeadsInfo`.
#[derive(PartialEq, RuntimeDebug)]
#[derive(PartialEq, Debug)]
pub struct VerifiedSubmitParachainHeadsInfo {
/// Base call information.
pub base: SubmitParachainHeadsInfo,
Expand Down
8 changes: 4 additions & 4 deletions bridges/modules/relayers/src/extension/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ use frame_support::{
dispatch::{DispatchInfo, PostDispatchInfo},
pallet_prelude::TransactionSource,
weights::Weight,
CloneNoBound, DefaultNoBound, EqNoBound, PartialEqNoBound, RuntimeDebugNoBound,
CloneNoBound, DebugNoBound, DefaultNoBound, EqNoBound, PartialEqNoBound,
};
use frame_system::Config as SystemConfig;
use pallet_bridge_messages::{
Expand All @@ -52,7 +52,7 @@ use sp_runtime::{
TransactionExtension, ValidateResult, Zero,
},
transaction_validity::{InvalidTransaction, TransactionValidityError, ValidTransactionBuilder},
DispatchResult, RuntimeDebug,
DispatchResult,
};

pub use grandpa_adapter::WithGrandpaChainExtensionConfig;
Expand Down Expand Up @@ -96,7 +96,7 @@ impl<AccountId, RemoteGrandpaChainBlockNumber: Debug, LaneId: Clone + Copy + Deb
}

/// The actions on relayer account that need to be performed because of his actions.
#[derive(RuntimeDebug, PartialEq)]
#[derive(Debug, PartialEq)]
pub enum RelayerAccountAction<AccountId, RewardBalance, LaneId> {
/// Do nothing with relayer account.
None,
Expand All @@ -121,7 +121,7 @@ pub enum RelayerAccountAction<AccountId, RewardBalance, LaneId> {
Encode,
EqNoBound,
PartialEqNoBound,
RuntimeDebugNoBound,
DebugNoBound,
TypeInfo,
)]
#[scale_info(skip_type_params(Runtime, Config, LaneId))]
Expand Down
6 changes: 3 additions & 3 deletions bridges/primitives/beefy/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ use scale_info::TypeInfo;
use serde::{Deserialize, Serialize};
use sp_runtime::{
traits::{Convert, MaybeSerializeDeserialize},
RuntimeAppPublic, RuntimeDebug,
Debug, RuntimeAppPublic,
};
use sp_std::prelude::*;

Expand Down Expand Up @@ -130,7 +130,7 @@ pub type BeefyMmrLeafOf<C> = sp_consensus_beefy::mmr::MmrLeaf<
///
/// Provides the initial context that the bridge needs in order to know
/// where to start the sync process from.
#[derive(Encode, Decode, RuntimeDebug, PartialEq, Clone, TypeInfo, Serialize, Deserialize)]
#[derive(Encode, Decode, Debug, PartialEq, Clone, TypeInfo, Serialize, Deserialize)]
pub struct InitializationData<BlockNumber, Hash> {
/// Pallet operating mode.
pub operating_mode: BasicOperatingMode,
Expand All @@ -142,7 +142,7 @@ pub struct InitializationData<BlockNumber, Hash> {
}

/// Basic data, stored by the pallet for every imported commitment.
#[derive(Encode, Decode, RuntimeDebug, PartialEq, TypeInfo)]
#[derive(Encode, Decode, Debug, PartialEq, TypeInfo)]
pub struct ImportedCommitment<BlockNumber, BlockHash, MmrHash> {
/// Block number and hash of the finalized block parent.
pub parent_number_and_hash: (BlockNumber, BlockHash),
Expand Down
4 changes: 2 additions & 2 deletions bridges/primitives/header-chain/src/call_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ use crate::{justification, InitializationData};

use bp_runtime::HeaderOf;
use codec::{Decode, Encode};
use frame_support::{weights::Weight, RuntimeDebugNoBound};
use frame_support::{weights::Weight, DebugNoBound};
use scale_info::TypeInfo;
use sp_consensus_grandpa::SetId;
use sp_runtime::traits::{Header as HeaderT, Zero};
Expand Down Expand Up @@ -60,7 +60,7 @@ pub enum BridgeGrandpaCall<Header: HeaderT> {
pub type BridgeGrandpaCallOf<C> = BridgeGrandpaCall<HeaderOf<C>>;

/// A digest information on the `BridgeGrandpaCall::submit_finality_proof` call.
#[derive(Copy, Clone, PartialEq, RuntimeDebugNoBound)]
#[derive(Copy, Clone, PartialEq, DebugNoBound)]
pub struct SubmitFinalityProofInfo<N: Debug> {
/// Number of the finality target.
pub block_number: N,
Expand Down
4 changes: 2 additions & 2 deletions bridges/primitives/header-chain/src/justification/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ use bp_runtime::{BlockNumberOf, Chain, HashOf, HeaderId};
use codec::{Decode, DecodeWithMemTracking, Encode, MaxEncodedLen};
use scale_info::TypeInfo;
use sp_consensus_grandpa::{AuthorityId, AuthoritySignature};
use sp_runtime::{traits::Header as HeaderT, RuntimeDebug, SaturatedConversion};
use sp_runtime::{traits::Header as HeaderT, SaturatedConversion};
use sp_std::prelude::*;

/// A GRANDPA Justification is a proof that a given header was finalized
Expand Down Expand Up @@ -119,7 +119,7 @@ impl<H: HeaderT> crate::FinalityProof<H::Hash, H::Number> for GrandpaJustificati
}

/// Justification verification error.
#[derive(Eq, RuntimeDebug, PartialEq)]
#[derive(Eq, Debug, PartialEq)]
pub enum Error {
/// Failed to decode justification.
JustificationDecode,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ use crate::{justification::GrandpaJustification, AuthoritySet};
use bp_runtime::HeaderId;
use finality_grandpa::voter_set::VoterSet;
use sp_consensus_grandpa::{AuthorityId, AuthoritySignature, SetId};
use sp_runtime::{traits::Header as HeaderT, RuntimeDebug};
use sp_runtime::traits::Header as HeaderT;
use sp_std::{
collections::{
btree_map::{
Expand All @@ -47,7 +47,7 @@ type SignedPrecommit<Header> = finality_grandpa::SignedPrecommit<
>;

/// Votes ancestries with useful methods.
#[derive(RuntimeDebug)]
#[derive(Debug)]
pub struct AncestryChain<Header: HeaderT> {
/// We expect all forks in the ancestry chain to be descendants of base.
base: HeaderId<Header::Hash, Header::Number>,
Expand Down Expand Up @@ -136,7 +136,7 @@ impl<Header: HeaderT> AncestryChain<Header> {
}

/// Justification verification error.
#[derive(Eq, RuntimeDebug, PartialEq)]
#[derive(Eq, Debug, PartialEq)]
pub enum Error {
/// Could not convert `AuthorityList` to `VoterSet`.
InvalidAuthorityList,
Expand All @@ -154,7 +154,7 @@ pub enum Error {
}

/// Justification verification error.
#[derive(Eq, RuntimeDebug, PartialEq)]
#[derive(Eq, Debug, PartialEq)]
pub enum PrecommitError {
/// Justification contains redundant votes.
RedundantAuthorityVote,
Expand All @@ -170,7 +170,7 @@ pub enum PrecommitError {
}

/// The context needed for validating GRANDPA finality proofs.
#[derive(RuntimeDebug)]
#[derive(Debug)]
pub struct JustificationVerificationContext {
/// The authority set used to verify the justification.
pub voter_set: VoterSet<AuthorityId>,
Expand Down
10 changes: 4 additions & 6 deletions bridges/primitives/header-chain/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ use serde::{Deserialize, Serialize};
use sp_consensus_grandpa::{
AuthorityList, ConsensusLog, ScheduledChange, SetId, GRANDPA_ENGINE_ID,
};
use sp_runtime::{traits::Header as HeaderT, Digest, RuntimeDebug, SaturatedConversion};
use sp_runtime::{traits::Header as HeaderT, Digest, SaturatedConversion};
use sp_std::{boxed::Box, vec::Vec};

pub use call_info::{BridgeGrandpaCall, BridgeGrandpaCallOf, SubmitFinalityProofInfo};
Expand All @@ -60,7 +60,7 @@ pub enum HeaderChainError {
///
/// Even though we may store full header, our applications (XCM) only use couple of header
/// fields. Extracting those values makes on-chain storage and PoV smaller, which is good.
#[derive(Clone, Decode, Encode, Eq, MaxEncodedLen, PartialEq, RuntimeDebug, TypeInfo)]
#[derive(Clone, Decode, Encode, Eq, MaxEncodedLen, PartialEq, Debug, TypeInfo)]
pub struct StoredHeaderData<Number, Hash> {
/// Header number.
pub number: Number,
Expand Down Expand Up @@ -103,9 +103,7 @@ pub trait Parameter: Codec + EncodeLike + Clone + Eq + Debug + TypeInfo {}
impl<T> Parameter for T where T: Codec + EncodeLike + Clone + Eq + Debug + TypeInfo {}

/// A GRANDPA Authority List and ID.
#[derive(
Default, Encode, Eq, Decode, DecodeWithMemTracking, RuntimeDebug, PartialEq, Clone, TypeInfo,
)]
#[derive(Default, Encode, Eq, Decode, DecodeWithMemTracking, Debug, PartialEq, Clone, TypeInfo)]
#[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
pub struct AuthoritySet {
/// List of GRANDPA authorities for the current round.
Expand All @@ -129,7 +127,7 @@ impl AuthoritySet {
Encode,
Decode,
DecodeWithMemTracking,
RuntimeDebug,
Debug,
PartialEq,
Eq,
Clone,
Expand Down
12 changes: 6 additions & 6 deletions bridges/primitives/messages/src/call_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ use crate::{MessageNonce, UnrewardedRelayersState};
use codec::{Decode, Encode};
use frame_support::weights::Weight;
use scale_info::TypeInfo;
use sp_core::RuntimeDebug;
use sp_std::ops::RangeInclusive;
use Debug;

/// A minimized version of `pallet-bridge-messages::Call` that can be used without a runtime.
#[derive(Encode, Decode, Debug, PartialEq, Eq, Clone, TypeInfo)]
Expand Down Expand Up @@ -51,7 +51,7 @@ pub enum BridgeMessagesCall<AccountId, MessagesProof, MessagesDeliveryProof> {
}

/// Generic info about a messages delivery/confirmation proof.
#[derive(PartialEq, RuntimeDebug)]
#[derive(PartialEq, Debug)]
pub struct BaseMessagesProofInfo<LaneId> {
/// Message lane, used by the call.
pub lane_id: LaneId,
Expand All @@ -75,7 +75,7 @@ impl<LaneId> BaseMessagesProofInfo<LaneId> {
}

/// Occupation state of the unrewarded relayers vector.
#[derive(PartialEq, RuntimeDebug)]
#[derive(PartialEq, Debug)]
#[cfg_attr(test, derive(Default))]
pub struct UnrewardedRelayerOccupation {
/// The number of remaining unoccupied entries for new relayers.
Expand All @@ -85,7 +85,7 @@ pub struct UnrewardedRelayerOccupation {
}

/// Info about a `ReceiveMessagesProof` call which tries to update a single lane.
#[derive(PartialEq, RuntimeDebug)]
#[derive(PartialEq, Debug)]
pub struct ReceiveMessagesProofInfo<LaneId> {
/// Base messages proof info
pub base: BaseMessagesProofInfo<LaneId>,
Expand Down Expand Up @@ -125,7 +125,7 @@ impl<LaneId> ReceiveMessagesProofInfo<LaneId> {
}

/// Info about a `ReceiveMessagesDeliveryProof` call which tries to update a single lane.
#[derive(PartialEq, RuntimeDebug)]
#[derive(PartialEq, Debug)]
pub struct ReceiveMessagesDeliveryProofInfo<LaneId>(pub BaseMessagesProofInfo<LaneId>);

impl<LaneId> ReceiveMessagesDeliveryProofInfo<LaneId> {
Expand All @@ -137,7 +137,7 @@ impl<LaneId> ReceiveMessagesDeliveryProofInfo<LaneId> {

/// Info about a `ReceiveMessagesProof` or a `ReceiveMessagesDeliveryProof` call
/// which tries to update a single lane.
#[derive(PartialEq, RuntimeDebug)]
#[derive(PartialEq, Debug)]
pub enum MessagesCallInfo<LaneId: Clone + Copy> {
/// Messages delivery call info.
ReceiveMessagesProof(ReceiveMessagesProofInfo<LaneId>),
Expand Down
4 changes: 2 additions & 2 deletions bridges/primitives/messages/src/lane.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
use codec::{Codec, Decode, DecodeWithMemTracking, Encode, EncodeLike, MaxEncodedLen};
use scale_info::TypeInfo;
use serde::{de::DeserializeOwned, Deserialize, Serialize};
use sp_core::{RuntimeDebug, TypeId, H256};
use sp_core::{TypeId, H256};
use sp_io::hashing::blake2_256;
use sp_std::fmt::Debug;

Expand Down Expand Up @@ -199,7 +199,7 @@ impl TryFrom<Vec<u8>> for HashedLaneId {
}

/// Lane state.
#[derive(Clone, Copy, Decode, Encode, Eq, PartialEq, TypeInfo, MaxEncodedLen, RuntimeDebug)]
#[derive(Clone, Copy, Decode, Encode, Eq, PartialEq, TypeInfo, MaxEncodedLen, Debug)]
pub enum LaneState {
/// Lane is opened and messages may be sent/received over it.
Opened,
Expand Down
Loading
Loading