mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 21:01:02 +00:00
Bump dependencies (#1180)
* substrate: d0f6c1c60da22e04dd25c2eca46ebfe6f1571af0
polkadot: dd4b2e6a34a08a01b876d14641e99e7011be3463
cumulus: 9379cd6c18
* fmt
* fixed lost refs
* spelling
* benckhmarks
* fmt
This commit is contained in:
committed by
Bastian Köcher
parent
6396239e18
commit
e23266c7e6
@@ -7,7 +7,7 @@ edition = "2018"
|
||||
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
|
||||
|
||||
[dependencies]
|
||||
smallvec = "1.6"
|
||||
smallvec = "1.7"
|
||||
|
||||
# Bridge Dependencies
|
||||
|
||||
|
||||
@@ -17,6 +17,7 @@ hash256-std-hasher = { version = "0.15.2", default-features = false }
|
||||
impl-codec = { version = "0.5.1", default-features = false }
|
||||
impl-serde = { version = "0.3.1", optional = true }
|
||||
parity-util-mem = { version = "0.10", default-features = false, features = ["primitive-types"] }
|
||||
scale-info = { version = "1.0", default-features = false, features = ["derive"] }
|
||||
serde = { version = "1.0", optional = true, features = ["derive"] }
|
||||
|
||||
# Substrate Based Dependencies
|
||||
@@ -42,6 +43,7 @@ std = [
|
||||
"impl-codec/std",
|
||||
"impl-serde",
|
||||
"parity-util-mem/std",
|
||||
"scale-info/std",
|
||||
"serde",
|
||||
"sp-api/std",
|
||||
"sp-core/std",
|
||||
|
||||
@@ -29,6 +29,7 @@ use frame_support::{
|
||||
Parameter, RuntimeDebug,
|
||||
};
|
||||
use frame_system::limits;
|
||||
use scale_info::TypeInfo;
|
||||
use sp_core::Hasher as HasherT;
|
||||
use sp_runtime::{
|
||||
traits::{Convert, IdentifyAccount, Verify},
|
||||
@@ -174,7 +175,7 @@ impl Chain for Millau {
|
||||
}
|
||||
|
||||
/// Millau Hasher (Blake2-256 ++ Keccak-256) implementation.
|
||||
#[derive(PartialEq, Eq, Clone, Copy, RuntimeDebug)]
|
||||
#[derive(PartialEq, Eq, Clone, Copy, RuntimeDebug, TypeInfo)]
|
||||
#[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
|
||||
pub struct BlakeTwoAndKeccak256;
|
||||
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
// along with Parity Bridges Common. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use parity_util_mem::MallocSizeOf;
|
||||
use scale_info::TypeInfo;
|
||||
use sp_runtime::traits::CheckEqual;
|
||||
|
||||
// `sp_core::H512` can't be used, because it doesn't implement `CheckEqual`, which is required
|
||||
@@ -22,7 +23,7 @@ use sp_runtime::traits::CheckEqual;
|
||||
|
||||
fixed_hash::construct_fixed_hash! {
|
||||
/// Hash type used in Millau chain.
|
||||
#[derive(MallocSizeOf)]
|
||||
#[derive(MallocSizeOf, TypeInfo)]
|
||||
pub struct MillauHash(64);
|
||||
}
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ edition = "2018"
|
||||
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
|
||||
|
||||
[dependencies]
|
||||
smallvec = "1.6"
|
||||
smallvec = "1.7"
|
||||
|
||||
# Bridge Dependencies
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
|
||||
|
||||
[dependencies]
|
||||
parity-scale-codec = { version = "2.2.0", default-features = false, features = ["derive"] }
|
||||
smallvec = "1.6"
|
||||
smallvec = "1.7"
|
||||
|
||||
# Bridge Dependencies
|
||||
bp-messages = { path = "../messages", default-features = false }
|
||||
|
||||
@@ -8,7 +8,8 @@ license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
|
||||
|
||||
[dependencies]
|
||||
parity-scale-codec = { version = "2.2.0", default-features = false, features = ["derive"] }
|
||||
smallvec = "1.6"
|
||||
scale-info = { version = "1.0", default-features = false, features = ["derive"] }
|
||||
smallvec = "1.7"
|
||||
|
||||
# Bridge Dependencies
|
||||
|
||||
@@ -34,6 +35,7 @@ std = [
|
||||
"bp-runtime/std",
|
||||
"frame-support/std",
|
||||
"parity-scale-codec/std",
|
||||
"scale-info/std",
|
||||
"sp-api/std",
|
||||
"sp-runtime/std",
|
||||
"sp-std/std",
|
||||
|
||||
@@ -21,10 +21,10 @@
|
||||
#![allow(clippy::unnecessary_mut_passed)]
|
||||
|
||||
use bp_messages::{LaneId, MessageDetails, MessageNonce, UnrewardedRelayersState};
|
||||
use bp_runtime::Chain;
|
||||
use frame_support::weights::{
|
||||
WeightToFeeCoefficient, WeightToFeeCoefficients, WeightToFeePolynomial,
|
||||
};
|
||||
use scale_info::TypeInfo;
|
||||
use sp_std::prelude::*;
|
||||
use sp_version::RuntimeVersion;
|
||||
|
||||
@@ -51,8 +51,6 @@ impl WeightToFeePolynomial for WeightToFee {
|
||||
}
|
||||
}
|
||||
|
||||
pub type UncheckedExtrinsic = bp_polkadot_core::UncheckedExtrinsic<Call>;
|
||||
|
||||
// NOTE: This needs to be kept up to date with the Westend runtime found in the Polkadot repo.
|
||||
pub const VERSION: RuntimeVersion = RuntimeVersion {
|
||||
spec_name: sp_version::create_runtime_str!("westend"),
|
||||
@@ -66,32 +64,11 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
|
||||
|
||||
/// Westend Runtime `Call` enum.
|
||||
///
|
||||
/// The enum represents a subset of possible `Call`s we can send to Westend chain.
|
||||
/// Ideally this code would be auto-generated from metadata, because we want to
|
||||
/// avoid depending directly on the ENTIRE runtime just to get the encoding of `Dispatchable`s.
|
||||
///
|
||||
/// All entries here (like pretty much in the entire file) must be kept in sync with Westend
|
||||
/// `construct_runtime`, so that we maintain SCALE-compatibility.
|
||||
///
|
||||
/// See: [link](https://github.com/paritytech/polkadot/blob/master/runtime/westend/src/lib.rs)
|
||||
#[derive(parity_scale_codec::Encode, parity_scale_codec::Decode, Debug, PartialEq, Eq, Clone)]
|
||||
pub enum Call {
|
||||
/// Rococo bridge pallet.
|
||||
#[codec(index = 40)]
|
||||
BridgeGrandpaRococo(BridgeGrandpaRococoCall),
|
||||
}
|
||||
|
||||
#[derive(parity_scale_codec::Encode, parity_scale_codec::Decode, Debug, PartialEq, Eq, Clone)]
|
||||
#[allow(non_camel_case_types)]
|
||||
pub enum BridgeGrandpaRococoCall {
|
||||
#[codec(index = 0)]
|
||||
submit_finality_proof(
|
||||
<PolkadotLike as Chain>::Header,
|
||||
bp_header_chain::justification::GrandpaJustification<<PolkadotLike as Chain>::Header>,
|
||||
),
|
||||
#[codec(index = 1)]
|
||||
initialize(bp_header_chain::InitializationData<<PolkadotLike as Chain>::Header>),
|
||||
}
|
||||
/// We are not currently submitting any Westend transactions => it is empty.
|
||||
#[derive(
|
||||
parity_scale_codec::Encode, parity_scale_codec::Decode, Debug, PartialEq, Eq, Clone, TypeInfo,
|
||||
)]
|
||||
pub enum Call {}
|
||||
|
||||
impl sp_runtime::traits::Dispatchable for Call {
|
||||
type Origin = ();
|
||||
|
||||
@@ -8,6 +8,7 @@ license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
|
||||
|
||||
[dependencies]
|
||||
codec = { package = "parity-scale-codec", version = "2.2.0", default-features = false }
|
||||
scale-info = { version = "1.0", default-features = false, features = ["derive"] }
|
||||
|
||||
# Substrate Dependencies
|
||||
|
||||
@@ -20,6 +21,7 @@ default = ["std"]
|
||||
std = [
|
||||
"codec/std",
|
||||
"frame-support/std",
|
||||
"scale-info/std",
|
||||
"sp-api/std",
|
||||
"sp-std/std",
|
||||
]
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
|
||||
use codec::{Decode, Encode, EncodeLike};
|
||||
use frame_support::{Parameter, RuntimeDebug};
|
||||
use scale_info::TypeInfo;
|
||||
use sp_api::decl_runtime_apis;
|
||||
use sp_std::marker::PhantomData;
|
||||
|
||||
@@ -48,7 +49,7 @@ pub enum Error {
|
||||
pub type Result<T> = sp_std::result::Result<T, Error>;
|
||||
|
||||
/// Peer blockchain lock funds transaction.
|
||||
#[derive(Encode, Decode, Clone, RuntimeDebug, PartialEq, Eq)]
|
||||
#[derive(Encode, Decode, Clone, RuntimeDebug, PartialEq, Eq, TypeInfo)]
|
||||
pub struct LockFundsTransaction<TransferId, Recipient, Amount> {
|
||||
/// Something that uniquely identifies this transfer.
|
||||
pub id: TransferId,
|
||||
@@ -63,7 +64,7 @@ pub trait MaybeLockFundsTransaction {
|
||||
/// Transaction type.
|
||||
type Transaction;
|
||||
/// Identifier that uniquely identifies this transfer.
|
||||
type Id: Decode + Encode + EncodeLike + sp_std::fmt::Debug;
|
||||
type Id: Decode + Encode + TypeInfo + EncodeLike + sp_std::fmt::Debug;
|
||||
/// Peer recipient type.
|
||||
type Recipient;
|
||||
/// Peer currency amount type.
|
||||
|
||||
@@ -18,6 +18,7 @@ parity-bytes = { version = "0.1", default-features = false }
|
||||
plain_hasher = { version = "0.2.2", default-features = false }
|
||||
primitive-types = { version = "0.10", default-features = false, features = ["codec", "rlp"] }
|
||||
rlp = { version = "0.5", default-features = false }
|
||||
scale-info = { version = "1.0", default-features = false, features = ["derive"] }
|
||||
serde = { version = "1.0", optional = true }
|
||||
serde-big-array = { version = "0.2", optional = true }
|
||||
triehash = { version = "0.8.2", default-features = false }
|
||||
@@ -47,6 +48,7 @@ std = [
|
||||
"primitive-types/std",
|
||||
"primitive-types/serde",
|
||||
"rlp/std",
|
||||
"scale-info/std",
|
||||
"serde/std",
|
||||
"serde-big-array",
|
||||
"sp-api/std",
|
||||
|
||||
@@ -28,6 +28,7 @@ use codec::{Decode, Encode};
|
||||
use ethbloom::{Bloom as EthBloom, Input as BloomInput};
|
||||
use fixed_hash::construct_fixed_hash;
|
||||
use rlp::{Decodable, DecoderError, Rlp, RlpStream};
|
||||
use scale_info::TypeInfo;
|
||||
use sp_io::hashing::keccak_256;
|
||||
use sp_runtime::RuntimeDebug;
|
||||
use sp_std::prelude::*;
|
||||
@@ -57,7 +58,7 @@ pub type Address = H160;
|
||||
pub mod signatures;
|
||||
|
||||
/// Complete header id.
|
||||
#[derive(Encode, Decode, Default, RuntimeDebug, PartialEq, Clone, Copy)]
|
||||
#[derive(Encode, Decode, Default, RuntimeDebug, PartialEq, Clone, Copy, TypeInfo)]
|
||||
pub struct HeaderId {
|
||||
/// Header number.
|
||||
pub number: u64,
|
||||
@@ -66,7 +67,7 @@ pub struct HeaderId {
|
||||
}
|
||||
|
||||
/// An Aura header.
|
||||
#[derive(Clone, Default, Encode, Decode, PartialEq, RuntimeDebug)]
|
||||
#[derive(Clone, Default, Encode, Decode, PartialEq, RuntimeDebug, TypeInfo)]
|
||||
#[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
|
||||
pub struct AuraHeader {
|
||||
/// Parent block hash.
|
||||
@@ -129,7 +130,7 @@ pub struct UnsignedTransaction {
|
||||
}
|
||||
|
||||
/// Information describing execution of a transaction.
|
||||
#[derive(Clone, Encode, Decode, PartialEq, RuntimeDebug)]
|
||||
#[derive(Clone, Encode, Decode, PartialEq, RuntimeDebug, TypeInfo)]
|
||||
pub struct Receipt {
|
||||
/// The total gas used in the block following execution of the transaction.
|
||||
pub gas_used: U256,
|
||||
@@ -142,7 +143,7 @@ pub struct Receipt {
|
||||
}
|
||||
|
||||
/// Transaction outcome store in the receipt.
|
||||
#[derive(Clone, Encode, Decode, PartialEq, RuntimeDebug)]
|
||||
#[derive(Clone, Encode, Decode, PartialEq, RuntimeDebug, TypeInfo)]
|
||||
pub enum TransactionOutcome {
|
||||
/// Status and state root are unknown under EIP-98 rules.
|
||||
Unknown,
|
||||
@@ -153,7 +154,7 @@ pub enum TransactionOutcome {
|
||||
}
|
||||
|
||||
/// A record of execution for a `LOG` operation.
|
||||
#[derive(Clone, Encode, Decode, PartialEq, RuntimeDebug)]
|
||||
#[derive(Clone, Encode, Decode, PartialEq, RuntimeDebug, TypeInfo)]
|
||||
pub struct LogEntry {
|
||||
/// The address of the contract executing at the point of the `LOG` operation.
|
||||
pub address: Address,
|
||||
@@ -164,7 +165,7 @@ pub struct LogEntry {
|
||||
}
|
||||
|
||||
/// Logs bloom.
|
||||
#[derive(Clone, Encode, Decode)]
|
||||
#[derive(Clone, Encode, Decode, TypeInfo)]
|
||||
#[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
|
||||
pub struct Bloom(#[cfg_attr(feature = "std", serde(with = "BigArray"))] [u8; 256]);
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@ license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
|
||||
[dependencies]
|
||||
codec = { package = "parity-scale-codec", version = "2.2.0", default-features = false }
|
||||
finality-grandpa = { version = "0.14.0", default-features = false }
|
||||
scale-info = { version = "1.0", default-features = false, features = ["derive"] }
|
||||
serde = { version = "1.0", optional = true }
|
||||
|
||||
# Substrate Dependencies
|
||||
@@ -30,6 +31,7 @@ std = [
|
||||
"finality-grandpa/std",
|
||||
"serde/std",
|
||||
"frame-support/std",
|
||||
"scale-info/std",
|
||||
"sp-core/std",
|
||||
"sp-finality-grandpa/std",
|
||||
"sp-runtime/std",
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
use codec::{Decode, Encode};
|
||||
use finality_grandpa::voter_set::VoterSet;
|
||||
use frame_support::RuntimeDebug;
|
||||
use scale_info::TypeInfo;
|
||||
use sp_finality_grandpa::{AuthorityId, AuthoritySignature, SetId};
|
||||
use sp_runtime::traits::Header as HeaderT;
|
||||
use sp_std::{
|
||||
@@ -34,7 +35,7 @@ use sp_std::{
|
||||
///
|
||||
/// This particular proof is used to prove that headers on a bridged chain
|
||||
/// (so not our chain) have been finalized correctly.
|
||||
#[derive(Encode, Decode, RuntimeDebug, Clone, PartialEq, Eq)]
|
||||
#[derive(Encode, Decode, RuntimeDebug, Clone, PartialEq, Eq, TypeInfo)]
|
||||
pub struct GrandpaJustification<Header: HeaderT> {
|
||||
/// The round (voting period) this justification is valid for.
|
||||
pub round: u64,
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
|
||||
use codec::{Codec, Decode, Encode, EncodeLike};
|
||||
use core::{clone::Clone, cmp::Eq, default::Default, fmt::Debug};
|
||||
use scale_info::TypeInfo;
|
||||
#[cfg(feature = "std")]
|
||||
use serde::{Deserialize, Serialize};
|
||||
use sp_finality_grandpa::{AuthorityList, ConsensusLog, SetId, GRANDPA_ENGINE_ID};
|
||||
@@ -32,11 +33,11 @@ pub mod justification;
|
||||
/// A type that can be used as a parameter in a dispatchable function.
|
||||
///
|
||||
/// When using `decl_module` all arguments for call functions must implement this trait.
|
||||
pub trait Parameter: Codec + EncodeLike + Clone + Eq + Debug {}
|
||||
impl<T> Parameter for T where T: Codec + EncodeLike + Clone + Eq + Debug {}
|
||||
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, Decode, RuntimeDebug, PartialEq, Clone)]
|
||||
#[derive(Default, Encode, Decode, RuntimeDebug, PartialEq, Clone, TypeInfo)]
|
||||
#[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
|
||||
pub struct AuthoritySet {
|
||||
/// List of GRANDPA authorities for the current round.
|
||||
@@ -55,7 +56,7 @@ impl AuthoritySet {
|
||||
/// Data required for initializing the bridge pallet.
|
||||
///
|
||||
/// The bridge needs to know where to start its sync from, and this provides that initial context.
|
||||
#[derive(Default, Encode, Decode, RuntimeDebug, PartialEq, Eq, Clone)]
|
||||
#[derive(Default, Encode, Decode, RuntimeDebug, PartialEq, Eq, Clone, TypeInfo)]
|
||||
#[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
|
||||
pub struct InitializationData<H: HeaderT> {
|
||||
/// The header from which we should start syncing.
|
||||
|
||||
@@ -9,6 +9,7 @@ license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
|
||||
[dependencies]
|
||||
bp-runtime = { path = "../runtime", default-features = false }
|
||||
codec = { package = "parity-scale-codec", version = "2.2.0", default-features = false }
|
||||
scale-info = { version = "1.0", default-features = false, features = ["derive"] }
|
||||
|
||||
# Substrate Dependencies
|
||||
|
||||
@@ -21,5 +22,6 @@ std = [
|
||||
"bp-runtime/std",
|
||||
"codec/std",
|
||||
"frame-support/std",
|
||||
"scale-info/std",
|
||||
"sp-std/std",
|
||||
]
|
||||
|
||||
@@ -25,6 +25,7 @@ use bp_runtime::{
|
||||
};
|
||||
use codec::{Decode, Encode};
|
||||
use frame_support::RuntimeDebug;
|
||||
use scale_info::TypeInfo;
|
||||
use sp_std::prelude::*;
|
||||
|
||||
/// Message dispatch weight.
|
||||
@@ -71,7 +72,7 @@ pub trait MessageDispatch<AccountId, BridgeMessageId> {
|
||||
/// The source chain can (and should) verify that the message can be dispatched on the target chain
|
||||
/// with a particular origin given the source chain's origin. This can be done with the
|
||||
/// `verify_message_origin()` function.
|
||||
#[derive(RuntimeDebug, Encode, Decode, Clone, PartialEq, Eq)]
|
||||
#[derive(RuntimeDebug, Encode, Decode, Clone, PartialEq, Eq, TypeInfo)]
|
||||
pub enum CallOrigin<SourceChainAccountId, TargetChainAccountPublic, TargetChainSignature> {
|
||||
/// Call is sent by the Root origin on the source chain. On the target chain it is dispatched
|
||||
/// from a derived account.
|
||||
@@ -111,7 +112,7 @@ pub enum CallOrigin<SourceChainAccountId, TargetChainAccountPublic, TargetChainS
|
||||
}
|
||||
|
||||
/// Message payload type used by dispatch module.
|
||||
#[derive(RuntimeDebug, Encode, Decode, Clone, PartialEq, Eq)]
|
||||
#[derive(RuntimeDebug, Encode, Decode, Clone, PartialEq, Eq, TypeInfo)]
|
||||
pub struct MessagePayload<
|
||||
SourceChainAccountId,
|
||||
TargetChainAccountPublic,
|
||||
|
||||
@@ -10,6 +10,7 @@ license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
|
||||
bitvec = { version = "0.20", default-features = false, features = ["alloc"] }
|
||||
codec = { package = "parity-scale-codec", version = "2.2.0", default-features = false, features = ["derive", "bit-vec"] }
|
||||
impl-trait-for-tuples = "0.2"
|
||||
scale-info = { version = "1.0", default-features = false, features = ["bit-vec", "derive"] }
|
||||
serde = { version = "1.0", optional = true, features = ["derive"] }
|
||||
|
||||
# Bridge dependencies
|
||||
@@ -29,6 +30,7 @@ std = [
|
||||
"codec/std",
|
||||
"frame-support/std",
|
||||
"frame-system/std",
|
||||
"scale-info/std",
|
||||
"serde",
|
||||
"sp-std/std"
|
||||
]
|
||||
|
||||
@@ -26,6 +26,7 @@ use bitvec::prelude::*;
|
||||
use bp_runtime::messages::DispatchFeePayment;
|
||||
use codec::{Decode, Encode};
|
||||
use frame_support::RuntimeDebug;
|
||||
use scale_info::TypeInfo;
|
||||
use sp_std::{collections::vec_deque::VecDeque, prelude::*};
|
||||
|
||||
pub mod source_chain;
|
||||
@@ -35,7 +36,7 @@ pub mod target_chain;
|
||||
pub use frame_support::weights::Weight;
|
||||
|
||||
/// Messages pallet operating mode.
|
||||
#[derive(Encode, Decode, Clone, Copy, PartialEq, Eq, RuntimeDebug)]
|
||||
#[derive(Encode, Decode, Clone, Copy, PartialEq, Eq, RuntimeDebug, TypeInfo)]
|
||||
#[cfg_attr(feature = "std", derive(serde::Serialize, serde::Deserialize))]
|
||||
pub enum OperatingMode {
|
||||
/// Normal mode, when all operations are allowed.
|
||||
@@ -81,7 +82,7 @@ pub type BridgeMessageId = (LaneId, MessageNonce);
|
||||
pub type MessagePayload = Vec<u8>;
|
||||
|
||||
/// Message key (unique message identifier) as it is stored in the storage.
|
||||
#[derive(Encode, Decode, Clone, PartialEq, Eq, RuntimeDebug)]
|
||||
#[derive(Encode, Decode, Clone, PartialEq, Eq, RuntimeDebug, TypeInfo)]
|
||||
pub struct MessageKey {
|
||||
/// ID of the message lane.
|
||||
pub lane_id: LaneId,
|
||||
@@ -90,7 +91,7 @@ pub struct MessageKey {
|
||||
}
|
||||
|
||||
/// Message data as it is stored in the storage.
|
||||
#[derive(Encode, Decode, Clone, PartialEq, Eq, RuntimeDebug)]
|
||||
#[derive(Encode, Decode, Clone, PartialEq, Eq, RuntimeDebug, TypeInfo)]
|
||||
pub struct MessageData<Fee> {
|
||||
/// Message payload.
|
||||
pub payload: MessagePayload,
|
||||
@@ -99,7 +100,7 @@ pub struct MessageData<Fee> {
|
||||
}
|
||||
|
||||
/// Message as it is stored in the storage.
|
||||
#[derive(Encode, Decode, Clone, PartialEq, Eq, RuntimeDebug)]
|
||||
#[derive(Encode, Decode, Clone, PartialEq, Eq, RuntimeDebug, TypeInfo)]
|
||||
pub struct Message<Fee> {
|
||||
/// Message key.
|
||||
pub key: MessageKey,
|
||||
@@ -108,7 +109,7 @@ pub struct Message<Fee> {
|
||||
}
|
||||
|
||||
/// Inbound lane data.
|
||||
#[derive(Encode, Decode, Clone, RuntimeDebug, PartialEq, Eq)]
|
||||
#[derive(Encode, Decode, Clone, RuntimeDebug, PartialEq, Eq, TypeInfo)]
|
||||
pub struct InboundLaneData<RelayerId> {
|
||||
/// Identifiers of relayers and messages that they have delivered to this lane (ordered by
|
||||
/// message nonce).
|
||||
@@ -198,7 +199,7 @@ pub type DispatchResultsBitVec = BitVec<Msb0, u8>;
|
||||
///
|
||||
/// This struct represents a continuous range of messages that have been delivered by the same
|
||||
/// relayer and whose confirmations are still pending.
|
||||
#[derive(Encode, Decode, Clone, RuntimeDebug, PartialEq, Eq)]
|
||||
#[derive(Encode, Decode, Clone, RuntimeDebug, PartialEq, Eq, TypeInfo)]
|
||||
pub struct UnrewardedRelayer<RelayerId> {
|
||||
/// Identifier of the relayer.
|
||||
pub relayer: RelayerId,
|
||||
@@ -207,7 +208,7 @@ pub struct UnrewardedRelayer<RelayerId> {
|
||||
}
|
||||
|
||||
/// Delivered messages with their dispatch result.
|
||||
#[derive(Clone, Default, Encode, Decode, RuntimeDebug, PartialEq, Eq)]
|
||||
#[derive(Clone, Default, Encode, Decode, RuntimeDebug, PartialEq, Eq, TypeInfo)]
|
||||
pub struct DeliveredMessages {
|
||||
/// Nonce of the first message that has been delivered (inclusive).
|
||||
pub begin: MessageNonce,
|
||||
@@ -267,7 +268,7 @@ impl DeliveredMessages {
|
||||
}
|
||||
|
||||
/// Gist of `InboundLaneData::relayers` field used by runtime APIs.
|
||||
#[derive(Clone, Default, Encode, Decode, RuntimeDebug, PartialEq, Eq)]
|
||||
#[derive(Clone, Default, Encode, Decode, RuntimeDebug, PartialEq, Eq, TypeInfo)]
|
||||
pub struct UnrewardedRelayersState {
|
||||
/// Number of entries in the `InboundLaneData::relayers` set.
|
||||
pub unrewarded_relayer_entries: MessageNonce,
|
||||
@@ -279,7 +280,7 @@ pub struct UnrewardedRelayersState {
|
||||
}
|
||||
|
||||
/// Outbound lane data.
|
||||
#[derive(Encode, Decode, Clone, RuntimeDebug, PartialEq, Eq)]
|
||||
#[derive(Encode, Decode, Clone, RuntimeDebug, PartialEq, Eq, TypeInfo)]
|
||||
pub struct OutboundLaneData {
|
||||
/// Nonce of the oldest message that we haven't yet pruned. May point to not-yet-generated
|
||||
/// message if all sent messages are already pruned.
|
||||
|
||||
@@ -21,13 +21,14 @@ use crate::{LaneId, Message, MessageData, MessageKey, OutboundLaneData};
|
||||
use bp_runtime::{messages::MessageDispatchResult, Size};
|
||||
use codec::{Decode, Encode, Error as CodecError};
|
||||
use frame_support::{weights::Weight, Parameter, RuntimeDebug};
|
||||
use scale_info::TypeInfo;
|
||||
use sp_std::{collections::btree_map::BTreeMap, fmt::Debug, prelude::*};
|
||||
|
||||
/// Proved messages from the source chain.
|
||||
pub type ProvedMessages<Message> = BTreeMap<LaneId, ProvedLaneMessages<Message>>;
|
||||
|
||||
/// Proved messages from single lane of the source chain.
|
||||
#[derive(RuntimeDebug, Encode, Decode, Clone, PartialEq, Eq)]
|
||||
#[derive(RuntimeDebug, Encode, Decode, Clone, PartialEq, Eq, TypeInfo)]
|
||||
pub struct ProvedLaneMessages<Message> {
|
||||
/// Optional outbound lane state.
|
||||
pub lane_state: Option<OutboundLaneData>,
|
||||
|
||||
@@ -8,6 +8,7 @@ license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
|
||||
|
||||
[dependencies]
|
||||
parity-scale-codec = { version = "2.2.0", default-features = false, features = ["derive"] }
|
||||
scale-info = { version = "1.0", default-features = false, features = ["derive"] }
|
||||
|
||||
# Bridge Dependencies
|
||||
|
||||
@@ -35,6 +36,7 @@ std = [
|
||||
"frame-support/std",
|
||||
"frame-system/std",
|
||||
"parity-scale-codec/std",
|
||||
"scale-info/std",
|
||||
"sp-api/std",
|
||||
"sp-core/std",
|
||||
"sp-runtime/std",
|
||||
|
||||
@@ -29,6 +29,7 @@ use frame_support::{
|
||||
};
|
||||
use frame_system::limits;
|
||||
use parity_scale_codec::Compact;
|
||||
use scale_info::{StaticTypeInfo, TypeInfo};
|
||||
use sp_core::Hasher as HasherT;
|
||||
use sp_runtime::{
|
||||
generic,
|
||||
@@ -255,7 +256,7 @@ pub type AdditionalSigned = (u32, u32, Hash, Hash, (), (), ());
|
||||
|
||||
/// A simplified version of signed extensions meant for producing signed transactions
|
||||
/// and signed payload in the client code.
|
||||
#[derive(PartialEq, Eq, Clone, RuntimeDebug)]
|
||||
#[derive(PartialEq, Eq, Clone, RuntimeDebug, TypeInfo)]
|
||||
pub struct SignedExtensions<Call> {
|
||||
encode_payload: SignedExtra,
|
||||
additional_signed: AdditionalSigned,
|
||||
@@ -322,7 +323,14 @@ impl<Call> SignedExtensions<Call> {
|
||||
|
||||
impl<Call> sp_runtime::traits::SignedExtension for SignedExtensions<Call>
|
||||
where
|
||||
Call: parity_scale_codec::Codec + sp_std::fmt::Debug + Sync + Send + Clone + Eq + PartialEq,
|
||||
Call: parity_scale_codec::Codec
|
||||
+ sp_std::fmt::Debug
|
||||
+ Sync
|
||||
+ Send
|
||||
+ Clone
|
||||
+ Eq
|
||||
+ PartialEq
|
||||
+ StaticTypeInfo,
|
||||
Call: Dispatchable,
|
||||
{
|
||||
const IDENTIFIER: &'static str = "Not needed.";
|
||||
|
||||
@@ -10,6 +10,7 @@ license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
|
||||
codec = { package = "parity-scale-codec", version = "2.2.0", default-features = false }
|
||||
hash-db = { version = "0.15.2", default-features = false }
|
||||
num-traits = { version = "0.2", default-features = false }
|
||||
scale-info = { version = "1.0", default-features = false, features = ["derive"] }
|
||||
|
||||
# Substrate Dependencies
|
||||
|
||||
@@ -28,6 +29,7 @@ std = [
|
||||
"frame-support/std",
|
||||
"hash-db/std",
|
||||
"num-traits/std",
|
||||
"scale-info/std",
|
||||
"sp-core/std",
|
||||
"sp-io/std",
|
||||
"sp-runtime/std",
|
||||
|
||||
@@ -18,9 +18,10 @@
|
||||
|
||||
use codec::{Decode, Encode};
|
||||
use frame_support::{weights::Weight, RuntimeDebug};
|
||||
use scale_info::TypeInfo;
|
||||
|
||||
/// Where message dispatch fee is paid?
|
||||
#[derive(Encode, Decode, RuntimeDebug, Clone, Copy, PartialEq, Eq)]
|
||||
#[derive(Encode, Decode, RuntimeDebug, Clone, Copy, PartialEq, Eq, TypeInfo)]
|
||||
pub enum DispatchFeePayment {
|
||||
/// The dispatch fee is paid at the source chain.
|
||||
AtSourceChain,
|
||||
@@ -34,7 +35,7 @@ pub enum DispatchFeePayment {
|
||||
}
|
||||
|
||||
/// Message dispatch result.
|
||||
#[derive(Encode, Decode, RuntimeDebug, Clone, PartialEq, Eq)]
|
||||
#[derive(Encode, Decode, RuntimeDebug, Clone, PartialEq, Eq, TypeInfo)]
|
||||
pub struct MessageDispatchResult {
|
||||
/// Dispatch result flag. This flag is relayed back to the source chain and, generally
|
||||
/// speaking, may bring any (that fits in single bit) information from the dispatcher at
|
||||
|
||||
@@ -8,6 +8,7 @@ license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
|
||||
|
||||
[dependencies]
|
||||
codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false }
|
||||
scale-info = { version = "1.0", default-features = false, features = ["derive"] }
|
||||
|
||||
# Substrate Dependencies
|
||||
|
||||
@@ -20,6 +21,7 @@ default = ["std"]
|
||||
std = [
|
||||
"codec/std",
|
||||
"frame-support/std",
|
||||
"scale-info/std",
|
||||
"sp-core/std",
|
||||
"sp-std/std",
|
||||
]
|
||||
|
||||
@@ -18,11 +18,12 @@
|
||||
|
||||
use codec::{Decode, Encode};
|
||||
use frame_support::{weights::Weight, RuntimeDebug};
|
||||
use scale_info::TypeInfo;
|
||||
use sp_core::U256;
|
||||
use sp_std::vec::Vec;
|
||||
|
||||
/// Pending token swap state.
|
||||
#[derive(Encode, Decode, Clone, RuntimeDebug, PartialEq, Eq)]
|
||||
#[derive(Encode, Decode, Clone, RuntimeDebug, PartialEq, Eq, TypeInfo)]
|
||||
pub enum TokenSwapState {
|
||||
/// The swap has been started using the `start_claim` call, but we have no proof that it has
|
||||
/// happened at the Bridged chain.
|
||||
@@ -39,7 +40,7 @@ pub enum TokenSwapState {
|
||||
///
|
||||
/// Different swap types give a different guarantees regarding possible swap
|
||||
/// replay protection.
|
||||
#[derive(Encode, Decode, Clone, RuntimeDebug, PartialEq, Eq)]
|
||||
#[derive(Encode, Decode, Clone, RuntimeDebug, PartialEq, Eq, TypeInfo)]
|
||||
pub enum TokenSwapType<ThisBlockNumber> {
|
||||
/// The `target_account_at_bridged_chain` is temporary and only have funds for single swap.
|
||||
///
|
||||
@@ -68,7 +69,7 @@ pub enum TokenSwapType<ThisBlockNumber> {
|
||||
/// when chain changes, the meaning of This and Bridged are still used to point to the same chains.
|
||||
/// This chain is always the chain where swap has been started. And the Bridged chain is the other
|
||||
/// chain.
|
||||
#[derive(Encode, Decode, Clone, RuntimeDebug, PartialEq, Eq)]
|
||||
#[derive(Encode, Decode, Clone, RuntimeDebug, PartialEq, Eq, TypeInfo)]
|
||||
pub struct TokenSwap<ThisBlockNumber, ThisBalance, ThisAccountId, BridgedBalance, BridgedAccountId>
|
||||
{
|
||||
/// The type of the swap.
|
||||
@@ -88,7 +89,7 @@ pub struct TokenSwap<ThisBlockNumber, ThisBalance, ThisAccountId, BridgedBalance
|
||||
pub type RawBridgedTransferCall = Vec<u8>;
|
||||
|
||||
/// Token swap creation parameters.
|
||||
#[derive(Encode, Decode, Clone, RuntimeDebug, PartialEq, Eq)]
|
||||
#[derive(Encode, Decode, Clone, RuntimeDebug, PartialEq, Eq, TypeInfo)]
|
||||
pub struct TokenSwapCreation<BridgedAccountPublic, ThisChainBalance, BridgedAccountSignature> {
|
||||
/// Public key of the `target_account_at_bridged_chain` account used to verify
|
||||
/// `bridged_currency_transfer_signature`.
|
||||
|
||||
Reference in New Issue
Block a user