Smart Contract

TestFlowCallbackHandlerBase

A.7d19efcd8e5b4a4a.TestFlowCallbackHandlerBase

Valid From

140,588,103

Deployed

1w ago
Feb 16, 2026, 08:31:53 PM UTC

Dependents

4 imports
1import FlowTransactionSchedulerBase from 0x7d19efcd8e5b4a4a
2
3access(all) contract TestFlowCallbackHandlerBase {
4    access(all) let HandlerStoragePath: StoragePath
5    access(all) let HandlerPublicPath: PublicPath
6
7    access(all) event CallbackExecuted(data: String)
8
9    access(all) resource Handler: FlowTransactionSchedulerBase.TransactionHandler {
10
11        access(FlowTransactionSchedulerBase.Execute)
12        fun executeTransaction(id: UInt64, data: AnyStruct?) {
13            if let stringRef = data as? &String {
14                if *stringRef == "fail" {
15                    panic("Callback execution failed as requested")
16                }
17                emit CallbackExecuted(data: *stringRef)
18            } else if let string: String = data as? String {
19                if string == "fail" {
20                    panic("Callback execution failed as requested")
21                }
22                emit CallbackExecuted(data: string)
23            } else {
24                emit CallbackExecuted(data: "bloop")
25            }
26        }
27    }
28
29    access(all) fun createHandler(): @Handler {
30        return <- create Handler()
31    }
32
33    access(all) init() {
34        self.HandlerStoragePath = /storage/testCallbackHandlerBase
35        self.HandlerPublicPath = /public/testCallbackHandlerBase
36    }
37}
38