Clone + Debug on Payloads/Addresses, and compare child storage results (#1203)

* Clone + Debug on Payloads/Addresses, and compare child storage results

* , to .

* clippy and fixes

* fix

* use derivative instead to remove boilerplate impls

* add missing import

* tidy up and extend wasm test timeout

* try 5 mins instead of 2
This commit is contained in:
James Wilson
2023-10-18 22:05:38 +01:00
committed by GitHub
parent a3b076bad1
commit 71fbfebf5a
13 changed files with 548 additions and 326 deletions
@@ -60,6 +60,46 @@ async fn storage_iter() {
assert_eq!(len, 13);
}
#[tokio::test]
async fn storage_child_values_same_across_backends() {
let ctx = test_context().await;
let unstable_client = ctx.unstable_client().await;
let legacy_client = ctx.legacy_client().await;
let addr = node_runtime::storage().system().account_iter();
let block_ref = legacy_client
.blocks()
.at_latest()
.await
.unwrap()
.reference();
let a: Vec<_> = unstable_client
.storage()
.at(block_ref.clone())
.iter(addr.clone())
.await
.unwrap()
.collect()
.await;
let b: Vec<_> = legacy_client
.storage()
.at(block_ref.clone())
.iter(addr)
.await
.unwrap()
.collect()
.await;
for (a, b) in a.into_iter().zip(b.into_iter()) {
let a = a.unwrap();
let b = b.unwrap();
assert_eq!(a, b);
}
}
#[tokio::test]
async fn transaction_validation() {
let ctx = test_context().await;