mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-31 02:51:01 +00:00
* cargo update -p parachain-info * flush * it compiles * clippy * temporary add more logging to cargo deny * Revert "temporary add more logging to cargo deny" This reverts commit 20daa88bca6d9a01dbe933579b1d57ae5c3a7bd8. * list installed Rust binaries before running cargo deny * changed prev commit * once again * try cargo update? * post-update fixes (nothing important)
This commit is contained in:
committed by
Bastian Köcher
parent
b4c7ffd3d3
commit
4d42bb22f3
@@ -103,8 +103,8 @@ impl RegisterParachain {
|
||||
let para_id: ParaId = relay_client
|
||||
.storage_value(StorageKey(para_id_key.to_vec()), None)
|
||||
.await?
|
||||
.unwrap_or(polkadot_primitives::v4::LOWEST_PUBLIC_ID)
|
||||
.max(polkadot_primitives::v4::LOWEST_PUBLIC_ID);
|
||||
.unwrap_or(polkadot_primitives::v5::LOWEST_PUBLIC_ID)
|
||||
.max(polkadot_primitives::v5::LOWEST_PUBLIC_ID);
|
||||
log::info!(target: "bridge", "Going to reserve parachain id: {:?}", para_id);
|
||||
|
||||
// step 1: reserve a parachain id
|
||||
|
||||
@@ -61,7 +61,7 @@ pub struct SendMessage {
|
||||
#[async_trait]
|
||||
trait MessageSender: MessagesCliBridge
|
||||
where
|
||||
Self::Source: ChainBase<Index = u32> + ChainWithTransactions + CliChain + CliEncodeMessage,
|
||||
Self::Source: ChainBase<Nonce = u32> + ChainWithTransactions + CliChain + CliEncodeMessage,
|
||||
<Self::Source as ChainBase>::Balance: Display + From<u64> + Into<u128>,
|
||||
<Self::Source as Chain>::Call: Sync,
|
||||
<Self::Source as ChainWithTransactions>::SignedTransaction: Sync,
|
||||
|
||||
@@ -21,7 +21,7 @@ use bp_runtime::ChainId;
|
||||
use codec::{Compact, Decode, Encode};
|
||||
use relay_substrate_client::{
|
||||
BalanceOf, Chain, ChainWithBalances, ChainWithMessages, ChainWithTransactions,
|
||||
ChainWithUtilityPallet, Error as SubstrateError, FullRuntimeUtilityPallet, IndexOf, SignParam,
|
||||
ChainWithUtilityPallet, Error as SubstrateError, FullRuntimeUtilityPallet, NonceOf, SignParam,
|
||||
UnderlyingChainProvider, UnsignedTransaction,
|
||||
};
|
||||
use sp_core::{storage::StorageKey, Pair};
|
||||
@@ -139,7 +139,7 @@ impl ChainWithTransactions for Millau {
|
||||
Some(
|
||||
UnsignedTransaction::new(
|
||||
tx.function.into(),
|
||||
Compact::<IndexOf<Self>>::decode(&mut &extra.5.encode()[..]).ok()?.into(),
|
||||
Compact::<NonceOf<Self>>::decode(&mut &extra.5.encode()[..]).ok()?.into(),
|
||||
)
|
||||
.tip(Compact::<BalanceOf<Self>>::decode(&mut &extra.7.encode()[..]).ok()?.into()),
|
||||
)
|
||||
|
||||
@@ -21,7 +21,7 @@ use bp_runtime::ChainId;
|
||||
use codec::{Compact, Decode, Encode};
|
||||
use relay_substrate_client::{
|
||||
BalanceOf, Chain, ChainWithBalances, ChainWithMessages, ChainWithTransactions,
|
||||
Error as SubstrateError, IndexOf, RelayChain, SignParam, UnderlyingChainProvider,
|
||||
Error as SubstrateError, NonceOf, RelayChain, SignParam, UnderlyingChainProvider,
|
||||
UnsignedTransaction,
|
||||
};
|
||||
use sp_core::{storage::StorageKey, Pair};
|
||||
@@ -139,7 +139,7 @@ impl ChainWithTransactions for Rialto {
|
||||
Some(
|
||||
UnsignedTransaction::new(
|
||||
tx.function.into(),
|
||||
Compact::<IndexOf<Self>>::decode(&mut &extra.5.encode()[..]).ok()?.into(),
|
||||
Compact::<NonceOf<Self>>::decode(&mut &extra.5.encode()[..]).ok()?.into(),
|
||||
)
|
||||
.tip(Compact::<BalanceOf<Self>>::decode(&mut &extra.7.encode()[..]).ok()?.into()),
|
||||
)
|
||||
|
||||
@@ -166,7 +166,7 @@ pub struct UnsignedTransaction<C: Chain> {
|
||||
/// Runtime call of this transaction.
|
||||
pub call: EncodedOrDecodedCall<C::Call>,
|
||||
/// Transaction nonce.
|
||||
pub nonce: C::Index,
|
||||
pub nonce: C::Nonce,
|
||||
/// Tip included into transaction.
|
||||
pub tip: C::Balance,
|
||||
/// Transaction era used by the chain.
|
||||
@@ -175,7 +175,7 @@ pub struct UnsignedTransaction<C: Chain> {
|
||||
|
||||
impl<C: Chain> UnsignedTransaction<C> {
|
||||
/// Create new unsigned transaction with given call, nonce, era and zero tip.
|
||||
pub fn new(call: EncodedOrDecodedCall<C::Call>, nonce: C::Index) -> Self {
|
||||
pub fn new(call: EncodedOrDecodedCall<C::Call>, nonce: C::Nonce) -> Self {
|
||||
Self { call, nonce, era: TransactionEra::Immortal, tip: Zero::zero() }
|
||||
}
|
||||
|
||||
|
||||
@@ -427,7 +427,7 @@ impl<C: Chain> Client<C> {
|
||||
/// Get the nonce of the given Substrate account.
|
||||
///
|
||||
/// Note: It's the caller's responsibility to make sure `account` is a valid SS58 address.
|
||||
pub async fn next_account_index(&self, account: C::AccountId) -> Result<C::Index> {
|
||||
pub async fn next_account_index(&self, account: C::AccountId) -> Result<C::Nonce> {
|
||||
self.jsonrpsee_execute(move |client| async move {
|
||||
Ok(SubstrateFrameSystemClient::<C>::account_next_index(&*client, account).await?)
|
||||
})
|
||||
@@ -474,7 +474,7 @@ impl<C: Chain> Client<C> {
|
||||
pub async fn submit_signed_extrinsic(
|
||||
&self,
|
||||
signer: &AccountKeyPairOf<C>,
|
||||
prepare_extrinsic: impl FnOnce(HeaderIdOf<C>, C::Index) -> Result<UnsignedTransaction<C>>
|
||||
prepare_extrinsic: impl FnOnce(HeaderIdOf<C>, C::Nonce) -> Result<UnsignedTransaction<C>>
|
||||
+ Send
|
||||
+ 'static,
|
||||
) -> Result<C::Hash>
|
||||
@@ -515,7 +515,7 @@ impl<C: Chain> Client<C> {
|
||||
pub async fn submit_and_watch_signed_extrinsic(
|
||||
&self,
|
||||
signer: &AccountKeyPairOf<C>,
|
||||
prepare_extrinsic: impl FnOnce(HeaderIdOf<C>, C::Index) -> Result<UnsignedTransaction<C>>
|
||||
prepare_extrinsic: impl FnOnce(HeaderIdOf<C>, C::Nonce) -> Result<UnsignedTransaction<C>>
|
||||
+ Send
|
||||
+ 'static,
|
||||
) -> Result<TransactionTracker<C, Self>>
|
||||
|
||||
@@ -50,7 +50,7 @@ pub use crate::{
|
||||
};
|
||||
pub use bp_runtime::{
|
||||
AccountIdOf, AccountPublicOf, BalanceOf, BlockNumberOf, Chain as ChainBase, HashOf, HeaderIdOf,
|
||||
HeaderOf, IndexOf, Parachain as ParachainBase, SignatureOf, TransactionEra, TransactionEraOf,
|
||||
HeaderOf, NonceOf, Parachain as ParachainBase, SignatureOf, TransactionEra, TransactionEraOf,
|
||||
UnderlyingChainProvider,
|
||||
};
|
||||
|
||||
|
||||
@@ -154,7 +154,7 @@ impl<C: Chain> SubstrateFinalityClient<C> for SubstrateBeefyFinalityClient {
|
||||
pub(crate) trait SubstrateFrameSystem<C> {
|
||||
/// Return index of next account transaction.
|
||||
#[method(name = "accountNextIndex")]
|
||||
async fn account_next_index(&self, account_id: C::AccountId) -> RpcResult<C::Index>;
|
||||
async fn account_next_index(&self, account_id: C::AccountId) -> RpcResult<C::Nonce>;
|
||||
}
|
||||
|
||||
/// RPC methods of Substrate `pallet_transaction_payment` frame pallet, that we are using.
|
||||
|
||||
@@ -38,7 +38,7 @@ impl bp_runtime::Chain for TestChain {
|
||||
|
||||
type AccountId = u32;
|
||||
type Balance = u32;
|
||||
type Index = u32;
|
||||
type Nonce = u32;
|
||||
type Signature = sp_runtime::testing::TestSignature;
|
||||
|
||||
fn max_extrinsic_size() -> u32 {
|
||||
@@ -80,7 +80,7 @@ impl bp_runtime::Chain for TestParachainBase {
|
||||
|
||||
type AccountId = u32;
|
||||
type Balance = u32;
|
||||
type Index = u32;
|
||||
type Nonce = u32;
|
||||
type Signature = sp_runtime::testing::TestSignature;
|
||||
|
||||
fn max_extrinsic_size() -> u32 {
|
||||
|
||||
@@ -54,8 +54,8 @@ impl<C: Chain> Environment<C> for Client<C> {
|
||||
/// 2) assume that the transaction is lost and resubmit another transaction instantly;
|
||||
///
|
||||
/// 3) wait for some time (if transaction is mortal - then until block where it dies; if it is
|
||||
/// immortal - then for some time that we assume is long enough to mine it) and assume that
|
||||
/// it is lost.
|
||||
/// immortal - then for some time that we assume is long enough to mine it) and assume that it is
|
||||
/// lost.
|
||||
///
|
||||
/// This struct implements third option as it seems to be the most optimal.
|
||||
pub struct TransactionTracker<C: Chain, E> {
|
||||
|
||||
@@ -46,7 +46,7 @@ pub async fn initialize<
|
||||
dry_run: bool,
|
||||
) where
|
||||
F: FnOnce(
|
||||
TargetChain::Index,
|
||||
TargetChain::Nonce,
|
||||
E::InitializationData,
|
||||
) -> Result<UnsignedTransaction<TargetChain>, SubstrateError>
|
||||
+ Send
|
||||
@@ -112,7 +112,7 @@ async fn do_initialize<
|
||||
>
|
||||
where
|
||||
F: FnOnce(
|
||||
TargetChain::Index,
|
||||
TargetChain::Nonce,
|
||||
E::InitializationData,
|
||||
) -> Result<UnsignedTransaction<TargetChain>, SubstrateError>
|
||||
+ Send
|
||||
|
||||
@@ -27,7 +27,7 @@ use pallet_balances::AccountData;
|
||||
use relay_substrate_client::{
|
||||
metrics::{FloatStorageValue, FloatStorageValueMetric},
|
||||
AccountIdOf, BalanceOf, Chain, ChainWithBalances, ChainWithMessages, Client,
|
||||
Error as SubstrateError, IndexOf,
|
||||
Error as SubstrateError, NonceOf,
|
||||
};
|
||||
use relay_utils::metrics::{MetricsParams, StandaloneMetric};
|
||||
use sp_core::storage::StorageData;
|
||||
@@ -133,7 +133,7 @@ where
|
||||
) -> Result<Option<Self::Value>, SubstrateError> {
|
||||
maybe_raw_value
|
||||
.map(|raw_value| {
|
||||
AccountInfo::<IndexOf<C>, AccountData<BalanceOf<C>>>::decode(&mut &raw_value.0[..])
|
||||
AccountInfo::<NonceOf<C>, AccountData<BalanceOf<C>>>::decode(&mut &raw_value.0[..])
|
||||
.map_err(SubstrateError::ResponseParseFailed)
|
||||
.map(|account_data| {
|
||||
convert_to_token_balance(account_data.data.free.into(), self.token_decimals)
|
||||
|
||||
@@ -318,8 +318,8 @@ async fn background_task<P: SubstrateParachainsPipeline>(
|
||||
//
|
||||
// 7) on-demand parachains relay sets `ParachainsSource::maximal_header_number` to the
|
||||
// `PH'.number()`.
|
||||
// 8) parachains finality relay sees that the parachain head has been
|
||||
// updated and relays `PH'` to the target chain.
|
||||
// 8) parachains finality relay sees that the parachain head has been updated and relays
|
||||
// `PH'` to the target chain.
|
||||
|
||||
// select headers to relay
|
||||
let relay_data = read_relay_data(
|
||||
|
||||
@@ -14,8 +14,8 @@
|
||||
//! Basic delivery strategy. The strategy selects nonces if:
|
||||
//!
|
||||
//! 1) there are more nonces on the source side than on the target side;
|
||||
//! 2) new nonces may be proved to target node (i.e. they have appeared at the
|
||||
//! block, which is known to the target node).
|
||||
//! 2) new nonces may be proved to target node (i.e. they have appeared at the block, which is known
|
||||
//! to the target node).
|
||||
|
||||
use crate::message_race_loop::{
|
||||
NoncesRange, RaceState, RaceStrategy, SourceClientNonces, TargetClientNonces,
|
||||
|
||||
Reference in New Issue
Block a user