Skip to content

Commit 9ae4443

Browse files
committed
add unknown status
1 parent 224ca21 commit 9ae4443

File tree

3 files changed

+22
-25
lines changed

3 files changed

+22
-25
lines changed

contracts/FlowCallbackScheduler.cdc

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ access(all) contract FlowCallbackScheduler {
1717
}
1818

1919
access(all) enum Status: UInt8 {
20+
/// unknown statuses are used for handling historic callbacks with null statuses
21+
access(all) case Unknown
2022
/// mutable statuses
2123
access(all) case Scheduled
2224
access(all) case Processed
@@ -247,7 +249,8 @@ access(all) contract FlowCallbackScheduler {
247249
/// refund multiplier is the portion of the fees that are refunded when a callback is cancelled
248250
access(all) var refundMultiplier: UFix64
249251

250-
/// historic status limit is the maximum age of a historic canceled callback status we keep before getting pruned
252+
/// historic status age limit is the maximum age in timestamp seconds
253+
/// of a historic canceled callback status to keep before getting pruned
251254
access(all) var historicStatusAgeLimit: UFix64
252255

253256
access(all) init(
@@ -426,7 +429,7 @@ access(all) contract FlowCallbackScheduler {
426429
Priority.Low: 2.0
427430
},
428431
refundMultiplier: 0.5,
429-
historicStatusAgeLimit: 30.0 * 24.0 * 60.0 * 60.0 // 5 days
432+
historicStatusAgeLimit: 30.0 * 24.0 * 60.0 * 60.0 // 30 days
430433
)
431434
}
432435

@@ -482,7 +485,7 @@ access(all) contract FlowCallbackScheduler {
482485
return Status.Succeeded
483486
}
484487

485-
return nil
488+
return Status.Unknown
486489
}
487490

488491
/// schedule is the primary entry point for scheduling a new callback within the scheduler contract.

0 commit comments

Comments
 (0)