mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-06 04:28:01 +00:00
committed by
Bastian Köcher
parent
e85b3fd998
commit
ba75e63fcd
@@ -27,7 +27,7 @@ use frame_support::{
|
||||
dispatch::DispatchClass,
|
||||
parameter_types,
|
||||
sp_runtime::{MultiAddress, MultiSigner},
|
||||
weights::{constants, WeightToFeeCoefficient, WeightToFeeCoefficients, WeightToFeePolynomial},
|
||||
weights::constants,
|
||||
};
|
||||
use frame_system::limits;
|
||||
|
||||
@@ -80,25 +80,6 @@ parameter_types! {
|
||||
.build_or_panic();
|
||||
}
|
||||
|
||||
/// [`WeightToFee`] should reflect cumulus/bridge-hub-* [`WeightToFee`]
|
||||
pub struct WeightToFee;
|
||||
impl WeightToFeePolynomial for WeightToFee {
|
||||
type Balance = Balance;
|
||||
fn polynomial() -> WeightToFeeCoefficients<Self::Balance> {
|
||||
pub const CENTS: Balance = polkadot_runtime_constants::currency::CENTS;
|
||||
|
||||
// In BridgeHub, we map the extrinsic base weight to 1/100 CENT.
|
||||
let p = CENTS;
|
||||
let q = 100 * Balance::from(constants::ExtrinsicBaseWeight::get().ref_time());
|
||||
smallvec::smallvec![WeightToFeeCoefficient {
|
||||
degree: 1,
|
||||
negative: false,
|
||||
coeff_frac: Perbill::from_rational(p % q, q),
|
||||
coeff_integer: p / q,
|
||||
}]
|
||||
}
|
||||
}
|
||||
|
||||
/// Public key of the chain account that may be used to verify signatures.
|
||||
pub type AccountSigner = MultiSigner;
|
||||
|
||||
|
||||
-2
@@ -14,8 +14,6 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Parity Bridges Common. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#![allow(unused_macros)] // TODO (https://github.com/paritytech/parity-bridges-common/issues/1629): remove me
|
||||
|
||||
use async_trait::async_trait;
|
||||
use std::sync::Arc;
|
||||
|
||||
|
||||
@@ -136,7 +136,6 @@ impl ChainWithMessages for BridgeHubRococo {
|
||||
const MAX_UNCONFIRMED_MESSAGES_IN_CONFIRMATION_TX: MessageNonce =
|
||||
bp_bridge_hub_rococo::MAX_UNCONFIRMED_MESSAGES_IN_CONFIRMATION_TX;
|
||||
|
||||
type WeightToFee = bp_bridge_hub_rococo::WeightToFee;
|
||||
// TODO: fix (https://github.com/paritytech/parity-bridges-common/issues/1640)
|
||||
type WeightInfo = ();
|
||||
}
|
||||
|
||||
@@ -136,7 +136,6 @@ impl ChainWithMessages for BridgeHubWococo {
|
||||
const MAX_UNCONFIRMED_MESSAGES_IN_CONFIRMATION_TX: MessageNonce =
|
||||
bp_bridge_hub_wococo::MAX_UNCONFIRMED_MESSAGES_IN_CONFIRMATION_TX;
|
||||
|
||||
type WeightToFee = bp_bridge_hub_wococo::WeightToFee;
|
||||
// TODO: fix (https://github.com/paritytech/parity-bridges-common/issues/1640)
|
||||
type WeightInfo = ();
|
||||
}
|
||||
|
||||
@@ -69,7 +69,6 @@ impl ChainWithMessages for Millau {
|
||||
bp_millau::MAX_UNREWARDED_RELAYERS_IN_CONFIRMATION_TX;
|
||||
const MAX_UNCONFIRMED_MESSAGES_IN_CONFIRMATION_TX: MessageNonce =
|
||||
bp_millau::MAX_UNCONFIRMED_MESSAGES_IN_CONFIRMATION_TX;
|
||||
type WeightToFee = bp_millau::WeightToFee;
|
||||
type WeightInfo = ();
|
||||
}
|
||||
|
||||
|
||||
@@ -89,7 +89,6 @@ impl ChainWithMessages for RialtoParachain {
|
||||
bp_rialto_parachain::MAX_UNREWARDED_RELAYERS_IN_CONFIRMATION_TX;
|
||||
const MAX_UNCONFIRMED_MESSAGES_IN_CONFIRMATION_TX: MessageNonce =
|
||||
bp_rialto_parachain::MAX_UNCONFIRMED_MESSAGES_IN_CONFIRMATION_TX;
|
||||
type WeightToFee = bp_rialto_parachain::WeightToFee;
|
||||
type WeightInfo = ();
|
||||
}
|
||||
|
||||
|
||||
@@ -88,7 +88,6 @@ impl ChainWithMessages for Rialto {
|
||||
bp_rialto::MAX_UNREWARDED_RELAYERS_IN_CONFIRMATION_TX;
|
||||
const MAX_UNCONFIRMED_MESSAGES_IN_CONFIRMATION_TX: MessageNonce =
|
||||
bp_rialto::MAX_UNCONFIRMED_MESSAGES_IN_CONFIRMATION_TX;
|
||||
type WeightToFee = bp_rialto::WeightToFee;
|
||||
type WeightInfo = ();
|
||||
}
|
||||
|
||||
|
||||
@@ -19,7 +19,6 @@ use bp_runtime::{
|
||||
Chain as ChainBase, EncodedOrDecodedCall, HashOf, TransactionEra, TransactionEraOf,
|
||||
};
|
||||
use codec::{Codec, Encode};
|
||||
use frame_support::weights::WeightToFee;
|
||||
use jsonrpsee::core::{DeserializeOwned, Serialize};
|
||||
use num_traits::Zero;
|
||||
use sc_transaction_pool_api::TransactionStatus;
|
||||
@@ -111,16 +110,12 @@ pub trait ChainWithMessages: Chain {
|
||||
/// `ChainWithMessages`.
|
||||
const MAX_UNCONFIRMED_MESSAGES_IN_CONFIRMATION_TX: MessageNonce;
|
||||
|
||||
/// Type that is used by the chain, to convert from weight to fee.
|
||||
type WeightToFee: WeightToFee<Balance = Self::Balance>;
|
||||
/// Weights of message pallet calls.
|
||||
type WeightInfo: pallet_bridge_messages::WeightInfoExt;
|
||||
}
|
||||
|
||||
/// Call type used by the chain.
|
||||
pub type CallOf<C> = <C as Chain>::Call;
|
||||
/// Weight-to-Fee type used by the chain.
|
||||
pub type WeightToFeeOf<C> = <C as ChainWithMessages>::WeightToFee;
|
||||
/// Transaction status of the chain.
|
||||
pub type TransactionStatusOf<C> = TransactionStatus<HashOf<C>, HashOf<C>>;
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ pub use crate::{
|
||||
chain::{
|
||||
AccountKeyPairOf, BlockWithJustification, CallOf, Chain, ChainWithBalances,
|
||||
ChainWithGrandpa, ChainWithMessages, ChainWithTransactions, RelayChain, SignParam,
|
||||
TransactionStatusOf, UnsignedTransaction, WeightToFeeOf,
|
||||
TransactionStatusOf, UnsignedTransaction,
|
||||
},
|
||||
client::{ChainRuntimeVersion, Client, OpaqueGrandpaAuthoritiesSet, Subscription},
|
||||
error::{Error, Result},
|
||||
|
||||
Reference in New Issue
Block a user