Skip to content

Commit

Permalink
test case 2 (storage)
Browse files Browse the repository at this point in the history
  • Loading branch information
wirednkod committed Sep 28, 2023
1 parent f1831a4 commit 077c08d
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions .zombienet-tests/0002-checkSync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,30 @@ export async function run(nodeName: string, networkInfo: any) {
let count = 0

await new Promise(async (resolve, reject) => {
let requested = false
const chainHeadFollower = chainHead(
true,
(event) => {
if (event.type === "finalized" && ++count === 2) {
resolve(chainHeadFollower.unfollow())
if (event.type === "newBlock") {
chainHeadFollower.unpin([event.blockHash])
return
}
if (requested || event.type !== "initialized") return
const latestFinalized = event.finalizedBlockHash
requested = true

chainHeadFollower
.storage(
latestFinalized,
"descendantsValues",
"0x5f3e4907f716ac89b6347d15ececedca88dcde934c658227ee1dfafcd6e16903",
null,
)
.then((some) => {
console.log("111", some)
resolve(chainHeadFollower.unfollow())
})
chainHeadFollower.unpin([latestFinalized])
},
reject,
)
Expand Down

0 comments on commit 077c08d

Please sign in to comment.