import { TestRuntime, TestBlockEvent } from "@tenderly/actions-test";
test('block hello world', async () => {
// If you use TestRuntime, any changes to storage won't reflect
// in production storage.
let runtime = new TestRuntime()
// Test* events are available for other types.
let event = new TestBlockEvent()
event.blockHash = '0x123456789'
// If you use TestRuntime, you can pre-populate secrets.
// In real runtime, you can add secrets through dashboard only.
runtime.context.secrets.put("API_TOKEN", "test-token")
await runtime.execute(blockHelloWorldFn, event)
// Verify storage was modified as expected.
// This checks in-memory test storage and not a real production storage!
let result = await runtime.context.storage.getStr(
'BLOCK_HELLO_WORLD/LAST_BLOCK_HASH'
expect(result).toBe('0x123456789')