Metadata V16: Be more dynamic over which hasher is used. (#1974)

* Use DynamicHasher256 to support Blake2 or Keccack depending on chain

* remove Config::Hash associated type, replace with HashFor<Config> alias

* Fix doc links

* fix wasm tests

* Don't strip system pallet associated types. check System.Hashing, not Hash. Rename BlockHash trait to Hash

* Tweak comment

* fmt

* fix merge

* Fix typo
This commit is contained in:
James Wilson
2025-04-23 10:12:48 +01:00
committed by GitHub
parent a8ae55a61b
commit 21b3f52191
43 changed files with 573 additions and 371 deletions
-1
View File
@@ -20,7 +20,6 @@ use runtime::runtime_types::xcm::v3::junctions::Junctions;
pub enum AssetHubConfig {}
impl Config for AssetHubConfig {
type Hash = <SubstrateConfig as Config>::Hash;
type AccountId = <SubstrateConfig as Config>::AccountId;
type Address = <PolkadotConfig as Config>::Address;
type Signature = <SubstrateConfig as Config>::Signature;
+2 -3
View File
@@ -3,7 +3,7 @@ use codec::Encode;
use subxt::client::ClientState;
use subxt::config::{
transaction_extensions::Params, Config, ExtrinsicParams, ExtrinsicParamsEncoder,
ExtrinsicParamsError,
ExtrinsicParamsError, HashFor,
};
use subxt_signer::sr25519::dev;
@@ -15,7 +15,6 @@ pub mod runtime {}
pub enum CustomConfig {}
impl Config for CustomConfig {
type Hash = subxt::utils::H256;
type AccountId = subxt::utils::AccountId32;
type Address = subxt::utils::MultiAddress<Self::AccountId, ()>;
type Signature = subxt::utils::MultiSignature;
@@ -28,7 +27,7 @@ impl Config for CustomConfig {
// This represents some arbitrary (and nonsensical) custom parameters that
// will be attached to transaction extra and additional payloads:
pub struct CustomExtrinsicParams<T: Config> {
genesis_hash: T::Hash,
genesis_hash: HashFor<T>,
tip: u128,
foo: bool,
}
@@ -19,7 +19,6 @@ pub mod runtime {}
pub enum CustomConfig {}
impl Config for CustomConfig {
type Hash = subxt::utils::H256;
type AccountId = subxt::utils::AccountId32;
type Address = subxt::utils::MultiAddress<Self::AccountId, ()>;
type Signature = subxt::utils::MultiSignature;
-1
View File
@@ -15,7 +15,6 @@ mod eth_runtime {}
enum EthRuntimeConfig {}
impl subxt::Config for EthRuntimeConfig {
type Hash = subxt::utils::H256;
type AccountId = AccountId20;
type Address = AccountId20;
type Signature = Signature;