Skip to content

Commit

Permalink
Opengov fasttrack (#372)
Browse files Browse the repository at this point in the history
* remove cruft

* test suite lint

* test format

* test format

* fix types in tests

* fixed lockfile

* progress

* Procedure impl

* added to lib

* removed only modifier

* progress

* progress

* Static analysis suggestions

* Fixes to openTech helper

* new opengov helpers
  • Loading branch information
timbrinded authored Feb 5, 2024
1 parent 37127bc commit 6d811ef
Show file tree
Hide file tree
Showing 74 changed files with 2,602 additions and 3,186 deletions.
8 changes: 8 additions & 0 deletions .changeset/thick-mugs-fly.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
"@moonwall/types": patch
"@moonwall/util": patch
"@moonwall/cli": patch
"@moonwall/tests": patch
---

Gov Helpers
28 changes: 0 additions & 28 deletions .prettierignore

This file was deleted.

6 changes: 0 additions & 6 deletions .prettierrc

This file was deleted.

17 changes: 17 additions & 0 deletions packages/cli/src/internal/foundations/devModeHelpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -222,3 +222,20 @@ export async function createDevBlock<
result: Array.isArray(transactions) ? result : (result[0] as any),
};
}

export const fastFowardToNextEvent = async (context: DevModeContext) => {
const [entry] = await context.pjsApi.query.scheduler.agenda.entries();
const [key, _] = entry;
if (key.isEmpty) {
throw new Error("No items in scheduler.agenda");
}
const desiredHeight = Number(key.toHuman());
const currentHeight = (await context.pjsApi.rpc.chain.getHeader()).number.toNumber();

console.log(
`⏩️ Current height: ${currentHeight}, desired height: ${desiredHeight}, jumping ${
desiredHeight - currentHeight + 1
} blocks`
);
await context.jumpBlocks?.(desiredHeight - currentHeight + 1);
};
Loading

0 comments on commit 6d811ef

Please sign in to comment.