mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 17:31:03 +00:00
move storage keys computation to primitivs (#1254)
This commit is contained in:
committed by
Bastian Köcher
parent
3aff81a707
commit
22b1e456ab
@@ -20,6 +20,7 @@ use crate::cli::{
|
||||
};
|
||||
|
||||
use codec::Encode;
|
||||
use frame_support::Twox64Concat;
|
||||
use num_traits::Zero;
|
||||
use polkadot_parachain::primitives::{
|
||||
HeadData as ParaHeadData, Id as ParaId, ValidationCode as ParaValidationCode,
|
||||
@@ -202,7 +203,7 @@ impl RegisterParachain {
|
||||
log::info!(target: "bridge", "Registered parachain: {:?}. Waiting for onboarding", para_id);
|
||||
|
||||
// wait until parathread is onboarded
|
||||
let para_state_key = bp_runtime::storage_map_final_key_twox64_concat(
|
||||
let para_state_key = bp_runtime::storage_map_final_key::<Twox64Concat>(
|
||||
PARAS_PALLET_NAME,
|
||||
PARAS_LIFECYCLES_STORAGE_NAME,
|
||||
¶_id.encode(),
|
||||
|
||||
@@ -32,7 +32,7 @@ use relay_substrate_client::{
|
||||
Client, Error as SubstrateError, HashOf, SignParam, SignatureOf, Subscription,
|
||||
TransactionSignScheme, TransactionStatusOf, UnsignedTransaction,
|
||||
};
|
||||
use sp_core::{blake2_256, storage::StorageKey, Bytes, Pair, H256, U256};
|
||||
use sp_core::{blake2_256, storage::StorageKey, Bytes, Pair, U256};
|
||||
use sp_runtime::traits::{Convert, Header as HeaderT};
|
||||
|
||||
use crate::cli::{
|
||||
@@ -266,11 +266,10 @@ impl SwapTokens {
|
||||
.await?;
|
||||
|
||||
// read state of swap after it has been created
|
||||
let token_swap_hash: H256 = token_swap.using_encoded(blake2_256).into();
|
||||
let token_swap_storage_key = bp_runtime::storage_map_final_key_identity(
|
||||
let token_swap_hash = token_swap.hash();
|
||||
let token_swap_storage_key = bp_token_swap::storage_keys::pending_swaps_key(
|
||||
TOKEN_SWAP_PALLET_NAME,
|
||||
pallet_bridge_token_swap::PENDING_SWAPS_MAP_NAME,
|
||||
token_swap_hash.as_ref(),
|
||||
token_swap_hash,
|
||||
);
|
||||
match read_token_swap_state(&source_client, swap_created_at, &token_swap_storage_key)
|
||||
.await?
|
||||
|
||||
@@ -197,7 +197,7 @@ where
|
||||
Vec::with_capacity(nonces.end().saturating_sub(*nonces.start()) as usize + 1);
|
||||
let mut message_nonce = *nonces.start();
|
||||
while message_nonce <= *nonces.end() {
|
||||
let message_key = pallet_bridge_messages::storage_keys::message_key(
|
||||
let message_key = bp_messages::storage_keys::message_key(
|
||||
P::TargetChain::WITH_CHAIN_MESSAGES_PALLET_NAME,
|
||||
&self.lane_id,
|
||||
message_nonce,
|
||||
@@ -206,7 +206,7 @@ where
|
||||
message_nonce += 1;
|
||||
}
|
||||
if proof_parameters.outbound_state_proof_required {
|
||||
storage_keys.push(pallet_bridge_messages::storage_keys::outbound_lane_data_key(
|
||||
storage_keys.push(bp_messages::storage_keys::outbound_lane_data_key(
|
||||
P::TargetChain::WITH_CHAIN_MESSAGES_PALLET_NAME,
|
||||
&self.lane_id,
|
||||
));
|
||||
|
||||
@@ -190,7 +190,7 @@ where
|
||||
SubstrateError,
|
||||
> {
|
||||
let (id, relayers_state) = self.unrewarded_relayers_state(id).await?;
|
||||
let inbound_data_key = pallet_bridge_messages::storage_keys::inbound_lane_data_key(
|
||||
let inbound_data_key = bp_messages::storage_keys::inbound_lane_data_key(
|
||||
P::SourceChain::WITH_CHAIN_MESSAGES_PALLET_NAME,
|
||||
&self.lane_id,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user