mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 18:41:03 +00:00
remove account derivation functions (#1498)
This commit is contained in:
committed by
Bastian Köcher
parent
d327b25724
commit
ceefd1b05d
@@ -29,7 +29,7 @@ use frame_support::{
|
||||
use frame_system::limits;
|
||||
use sp_core::Hasher as HasherT;
|
||||
use sp_runtime::{
|
||||
traits::{BlakeTwo256, Convert, IdentifyAccount, Verify},
|
||||
traits::{BlakeTwo256, IdentifyAccount, Verify},
|
||||
FixedU128, MultiSignature, MultiSigner, Perbill,
|
||||
};
|
||||
use sp_std::vec::Vec;
|
||||
@@ -161,15 +161,6 @@ impl Chain for RialtoParachain {
|
||||
}
|
||||
}
|
||||
|
||||
/// Convert a 256-bit hash into an AccountId.
|
||||
pub struct AccountIdConverter;
|
||||
|
||||
impl Convert<sp_core::H256, AccountId> for AccountIdConverter {
|
||||
fn convert(hash: sp_core::H256) -> AccountId {
|
||||
hash.to_fixed_bytes().into()
|
||||
}
|
||||
}
|
||||
|
||||
frame_support::parameter_types! {
|
||||
pub BlockLength: limits::BlockLength =
|
||||
limits::BlockLength::max_with_normal_ratio(5 * 1024 * 1024, NORMAL_DISPATCH_RATIO);
|
||||
@@ -218,19 +209,6 @@ pub const TO_RIALTO_PARACHAIN_MESSAGE_DETAILS_METHOD: &str =
|
||||
pub const FROM_RIALTO_PARACHAIN_MESSAGE_DETAILS_METHOD: &str =
|
||||
"FromRialtoParachainInboundLaneApi_message_details";
|
||||
|
||||
// We use this to get the account on RialtoParachain (target) which is derived from Millau's
|
||||
// (source) account. We do this so we can fund the derived account on RialtoParachain at Genesis to
|
||||
// it can pay transaction fees.
|
||||
//
|
||||
// The reason we can use the same `AccountId` type for both chains is because they share the same
|
||||
// development seed phrase.
|
||||
//
|
||||
// Note that this should only be used for testing.
|
||||
pub fn derive_account_from_millau_id(id: bp_runtime::SourceAccount<AccountId>) -> AccountId {
|
||||
let encoded_id = bp_runtime::derive_account_id(bp_runtime::MILLAU_CHAIN_ID, id);
|
||||
AccountIdConverter::convert(encoded_id)
|
||||
}
|
||||
|
||||
sp_api::decl_runtime_apis! {
|
||||
/// API for querying information about the finalized RialtoParachain headers.
|
||||
///
|
||||
|
||||
Reference in New Issue
Block a user