mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-30 22:27:56 +00:00
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:
@@ -16,7 +16,6 @@ use subxt::{
|
||||
client::OnlineClient,
|
||||
config::{Config, Hasher},
|
||||
utils::AccountId32,
|
||||
SubstrateConfig,
|
||||
};
|
||||
use subxt_rpcs::methods::chain_head::{
|
||||
ArchiveStorageEventItem, Bytes, StorageQuery, StorageQueryType,
|
||||
@@ -178,6 +177,7 @@ async fn archive_v1_storage() {
|
||||
let ctx = test_context().await;
|
||||
let rpc = ctx.chainhead_rpc_methods().await;
|
||||
let api = ctx.client();
|
||||
let hasher = api.hasher();
|
||||
let mut blocks = fetch_finalized_blocks(&ctx, 3).await;
|
||||
|
||||
while let Some(block) = blocks.next().await {
|
||||
@@ -236,9 +236,7 @@ async fn archive_v1_storage() {
|
||||
ArchiveStorageEventItem {
|
||||
key: Bytes(account_info_addr),
|
||||
value: None,
|
||||
hash: Some(<SubstrateConfig as Config>::Hasher::hash(
|
||||
&subxt_account_info
|
||||
)),
|
||||
hash: Some(hasher.hash(&subxt_account_info)),
|
||||
closest_descendant_merkle_value: None,
|
||||
child_trie_key: None
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user