diff --git a/.gitignore b/.gitignore index c2abc8b19..79536103a 100644 --- a/.gitignore +++ b/.gitignore @@ -13,11 +13,14 @@ node_modules .vscode git +codecov.json coverage.json coverage.lcov lcov.info *.pkey +imports* + # Private flow.jsons private.flow.json diff --git a/contracts/FlowTransactionScheduler.cdc b/contracts/FlowTransactionScheduler.cdc new file mode 100644 index 000000000..0fbe904c5 --- /dev/null +++ b/contracts/FlowTransactionScheduler.cdc @@ -0,0 +1,1450 @@ +import "FungibleToken" +import "FlowToken" +import "FlowFees" +import "FlowStorageFees" +import "ViewResolver" + +/// FlowTransactionScheduler enables smart contracts to schedule autonomous execution in the future. +/// +/// This contract implements FLIP 330's scheduled transaction system, allowing contracts to "wake up" and execute +/// logic at predefined times without external triggers. +/// +/// Scheduled transactions are prioritized (High/Medium/Low) with different execution guarantees and fee multipliers: +/// - High priority guarantees first-block execution, +/// - Medium priority provides best-effort scheduling, +/// - Low priority executes opportunistically when capacity allows after the time it was scheduled. +/// +/// The system uses time slots with execution effort limits to manage network resources, +/// ensuring predictable performance while enabling novel autonomous blockchain patterns like recurring +/// payments, automated arbitrage, and time-based contract logic. +access(all) contract FlowTransactionScheduler { + + /// singleton instance used to store all scheduled transaction data + /// and route all scheduled transaction functionality + access(self) var sharedScheduler: Capability + + /// storage path for the singleton scheduler resource + access(all) let storagePath: StoragePath + + /// Enums + + /// Priority + access(all) enum Priority: UInt8 { + access(all) case High + access(all) case Medium + access(all) case Low + } + + /// Status + access(all) enum Status: UInt8 { + /// unknown statuses are used for handling historic scheduled transactions with null statuses + access(all) case Unknown + /// mutable status + access(all) case Scheduled + /// finalized statuses + access(all) case Executed + access(all) case Canceled + } + + /// Events + + /// Emitted when a transaction is scheduled + access(all) event Scheduled( + id: UInt64, + priority: UInt8, + timestamp: UFix64, + executionEffort: UInt64, + fees: UFix64, + transactionHandlerOwner: Address, + transactionHandlerTypeIdentifier: String + ) + + /// Emitted when a scheduled transaction's scheduled timestamp is reached and it is ready for execution + access(all) event PendingExecution( + id: UInt64, + priority: UInt8, + executionEffort: UInt64, + fees: UFix64, + transactionHandlerOwner: Address, + transactionHandlerTypeIdentifier: String + ) + + /// Emitted when a scheduled transaction is executed by the FVM + access(all) event Executed( + id: UInt64, + priority: UInt8, + executionEffort: UInt64, + transactionHandlerOwner: Address, + transactionHandlerTypeIdentifier: String + ) + + /// Emitted when a scheduled transaction is canceled by the creator of the transaction + access(all) event Canceled( + id: UInt64, + priority: UInt8, + feesReturned: UFix64, + feesDeducted: UFix64, + transactionHandlerOwner: Address, + transactionHandlerTypeIdentifier: String + ) + + /// Emitted when a collection limit is reached + /// The limit that was reached is non-nil and is the limit that was reached + /// The other limit that was not reached is nil + access(all) event CollectionLimitReached( + collectionEffortLimit: UInt64?, + collectionTransactionsLimit: Int? + ) + + // Emitted when one or more of the configuration details fields are updated + // Event listeners can listen to this and query the new configuration + // if they need to + access(all) event ConfigUpdated() + + /// Entitlements + access(all) entitlement Execute + access(all) entitlement Process + access(all) entitlement Cancel + access(all) entitlement UpdateConfig + + /// Interfaces + + /// TransactionHandler is an interface that defines a single method executeTransaction that + /// must be implemented by the resource that contains the logic to be executed by the scheduled transaction. + /// An authorized capability to this resource is provided when scheduling a transaction. + /// The transaction scheduler uses this capability to execute the transaction when its scheduled timestamp arrives. + access(all) resource interface TransactionHandler: ViewResolver.Resolver { + + access(all) view fun getViews(): [Type] { + return [] + } + + access(all) fun resolveView(_ view: Type): AnyStruct? { + return nil + } + + /// Executes the implemented transaction logic + /// + /// @param id: The id of the scheduled transaction (this can be useful for any internal tracking) + /// @param data: The data that was passed when the transaction was originally scheduled + /// that may be useful for the execution of the transaction logic + access(Execute) fun executeTransaction(id: UInt64, data: AnyStruct?) + } + + /// Structs + + /// ScheduledTransaction is the resource that the user receives after scheduling a transaction. + /// It allows them to get the status of their transaction and can be passed back + /// to the scheduler contract to cancel the transaction if it has not yet been executed. + access(all) resource ScheduledTransaction { + access(all) let id: UInt64 + access(all) let timestamp: UFix64 + + access(all) view fun status(): Status? { + return FlowTransactionScheduler.sharedScheduler.borrow()!.getStatus(id: self.id) + } + + init( + id: UInt64, + timestamp: UFix64 + ) { + self.id = id + self.timestamp = timestamp + } + + // event emitted when the resource is destroyed + access(all) event ResourceDestroyed(id: UInt64 = self.id, timestamp: UFix64 = self.timestamp) + } + + /// EstimatedScheduledTransaction contains data for estimating transaction scheduling. + access(all) struct EstimatedScheduledTransaction { + /// flowFee is the estimated fee in Flow for the transaction to be scheduled + access(all) let flowFee: UFix64? + /// timestamp is estimated timestamp that the transaction will be executed at + access(all) let timestamp: UFix64? + /// error is an optional error message if the transaction cannot be scheduled + access(all) let error: String? + + access(contract) view init(flowFee: UFix64?, timestamp: UFix64?, error: String?) { + self.flowFee = flowFee + self.timestamp = timestamp + self.error = error + } + } + + /// Transaction data is a representation of a scheduled transaction + /// It is the source of truth for an individual transaction and stores the + /// capability to the handler that contains the logic that will be executed by the transaction. + access(all) struct TransactionData { + access(all) let id: UInt64 + access(all) let priority: Priority + access(all) let executionEffort: UInt64 + access(all) var status: Status + + /// Fee amount to pay for the transaction + access(all) let fees: UFix64 + + /// The timestamp that the transaction is scheduled for + /// For medium priority transactions, it may be different than the requested timestamp + /// For low priority transactions, it is the requested timestamp, + /// but the timestamp where the transaction is actually executed may be different + access(all) var scheduledTimestamp: UFix64 + + /// Capability to the logic that the transaction will execute + access(contract) let handler: Capability + + /// Type identifier of the transaction handler + access(all) let handlerTypeIdentifier: String + access(all) let handlerAddress: Address + + /// Optional data that can be passed to the handler + access(contract) let data: AnyStruct? + + access(contract) init( + id: UInt64, + handler: Capability, + scheduledTimestamp: UFix64, + data: AnyStruct?, + priority: Priority, + executionEffort: UInt64, + fees: UFix64, + ) { + self.id = id + self.handler = handler + self.data = data + self.priority = priority + self.executionEffort = executionEffort + self.fees = fees + self.status = Status.Scheduled + let handlerRef = handler.borrow() + ?? panic("Invalid transaction handler: Could not borrow a reference to the transaction handler") + self.handlerAddress = handler.address + self.handlerTypeIdentifier = handlerRef.getType().identifier + self.scheduledTimestamp = scheduledTimestamp + } + + /// setStatus updates the status of the transaction. + /// It panics if the transaction status is already finalized. + access(contract) fun setStatus(newStatus: Status) { + pre { + newStatus != Status.Unknown: "Invalid status: New status cannot be Unknown" + self.status != Status.Executed && self.status != Status.Canceled: + "Invalid status: Transaction with id \(self.id) is already finalized" + newStatus == Status.Executed ? self.status == Status.Scheduled : true: + "Invalid status: Transaction with id \(self.id) can only be set as Executed if it is Scheduled" + newStatus == Status.Canceled ? self.status == Status.Scheduled : true: + "Invalid status: Transaction with id \(self.id) can only be set as Canceled if it is Scheduled" + } + + self.status = newStatus + } + + /// setScheduledTimestamp updates the scheduled timestamp of the transaction. + /// It panics if the transaction status is already finalized. + access(contract) fun setScheduledTimestamp(newTimestamp: UFix64) { + pre { + self.status != Status.Executed && self.status != Status.Canceled: + "Invalid status: Transaction with id \(self.id) is already finalized" + } + self.scheduledTimestamp = newTimestamp + } + + /// payAndRefundFees withdraws fees from the transaction based on the refund multiplier. + /// It deposits any leftover fees to the FlowFees vault to be used to pay node operator rewards + /// like any other transaction on the Flow network. + access(contract) fun payAndRefundFees(refundMultiplier: UFix64): @FlowToken.Vault { + pre { + refundMultiplier >= 0.0 && refundMultiplier <= 1.0: + "Invalid refund multiplier: The multiplier must be between 0.0 and 1.0 but got \(refundMultiplier)" + } + if refundMultiplier == 0.0 { + FlowFees.deposit(from: <-FlowTransactionScheduler.withdrawFees(amount: self.fees)) + return <-FlowToken.createEmptyVault(vaultType: Type<@FlowToken.Vault>()) + } else { + let amountToReturn = self.fees * refundMultiplier + let amountToKeep = self.fees - amountToReturn + let feesToReturn <- FlowTransactionScheduler.withdrawFees(amount: amountToReturn) + FlowFees.deposit(from: <-FlowTransactionScheduler.withdrawFees(amount: amountToKeep)) + return <-feesToReturn + } + } + + /// getData copies and returns the data field + access(contract) view fun getData(): AnyStruct? { + return self.data + } + } + + /// Struct interface representing all the base configuration details in the Scheduler contract + /// that is used for governing the protocol + /// This is an interface to allow for the configuration details to be updated in the future + access(all) struct interface SchedulerConfig { + + /// maximum effort that can be used for any transaction + access(all) var maximumIndividualEffort: UInt64 + + /// minimum execution effort is the minimum effort that can be + /// used for any transaction + access(all) var minimumExecutionEffort: UInt64 + + /// slot total effort limit is the maximum effort that can be + /// cumulatively allocated to one timeslot by all priorities + access(all) var slotTotalEffortLimit: UInt64 + + /// slot shared effort limit is the maximum effort + /// that can be allocated to high and medium priority + /// transactions combined after their exclusive effort reserves have been filled + access(all) var slotSharedEffortLimit: UInt64 + + /// priority effort reserve is the amount of effort that is + /// reserved exclusively for each priority + access(all) var priorityEffortReserve: {Priority: UInt64} + + /// priority effort limit is the maximum cumulative effort per priority in a timeslot + access(all) var priorityEffortLimit: {Priority: UInt64} + + /// max data size is the maximum data size that can be stored for a transaction + access(all) var maxDataSizeMB: UFix64 + + /// priority fee multipliers are values we use to calculate the added + /// processing fee for each priority + access(all) var priorityFeeMultipliers: {Priority: UFix64} + + /// refund multiplier is the portion of the fees that are refunded when any transaction is cancelled + access(all) var refundMultiplier: UFix64 + + /// canceledTransactionsLimit is the maximum number of canceled transactions + /// to keep in the canceledTransactions array + access(all) var canceledTransactionsLimit: UInt + + /// collectionEffortLimit is the maximum effort that can be used for all transactions in a collection + access(all) var collectionEffortLimit: UInt64 + + /// collectionTransactionsLimit is the maximum number of transactions that can be processed in a collection + access(all) var collectionTransactionsLimit: Int + + access(all) init( + maximumIndividualEffort: UInt64, + minimumExecutionEffort: UInt64, + slotSharedEffortLimit: UInt64, + priorityEffortReserve: {Priority: UInt64}, + priorityEffortLimit: {Priority: UInt64}, + maxDataSizeMB: UFix64, + priorityFeeMultipliers: {Priority: UFix64}, + refundMultiplier: UFix64, + canceledTransactionsLimit: UInt, + collectionEffortLimit: UInt64, + collectionTransactionsLimit: Int + ) { + pre { + refundMultiplier >= 0.0 && refundMultiplier <= 1.0: + "Invalid refund multiplier: The multiplier must be between 0.0 and 1.0 but got \(refundMultiplier)" + priorityFeeMultipliers[Priority.Low]! >= 1.0: + "Invalid priority fee multiplier: Low priority multiplier must be greater than or equal to 1.0 but got \(priorityFeeMultipliers[Priority.Low]!)" + priorityFeeMultipliers[Priority.Medium]! > priorityFeeMultipliers[Priority.Low]!: + "Invalid priority fee multiplier: Medium priority multiplier must be greater than or equal to \(priorityFeeMultipliers[Priority.Low]!) but got \(priorityFeeMultipliers[Priority.Medium]!)" + priorityFeeMultipliers[Priority.High]! > priorityFeeMultipliers[Priority.Medium]!: + "Invalid priority fee multiplier: High priority multiplier must be greater than or equal to \(priorityFeeMultipliers[Priority.Medium]!) but got \(priorityFeeMultipliers[Priority.High]!)" + priorityEffortLimit[Priority.High]! >= priorityEffortReserve[Priority.High]!: + "Invalid priority effort limit: High priority effort limit must be greater than or equal to the priority effort reserve of \(priorityEffortReserve[Priority.High]!)" + priorityEffortLimit[Priority.Medium]! >= priorityEffortReserve[Priority.Medium]!: + "Invalid priority effort limit: Medium priority effort limit must be greater than or equal to the priority effort reserve of \(priorityEffortReserve[Priority.Medium]!)" + priorityEffortLimit[Priority.Low]! >= priorityEffortReserve[Priority.Low]!: + "Invalid priority effort limit: Low priority effort limit must be greater than or equal to the priority effort reserve of \(priorityEffortReserve[Priority.Low]!)" + collectionTransactionsLimit >= 0: + "Invalid collection transactions limit: Collection transactions limit must be greater than or equal to 0 but got \(collectionTransactionsLimit)" + canceledTransactionsLimit >= 1: + "Invalid canceled transactions limit: Canceled transactions limit must be greater than or equal to 1 but got \(canceledTransactionsLimit)" + } + post { + self.collectionEffortLimit > self.slotTotalEffortLimit: + "Invalid collection effort limit: Collection effort limit must be greater than \(self.slotTotalEffortLimit) but got \(self.collectionEffortLimit)" + } + } + } + + /// Concrete implementation of the SchedulerConfig interface + /// This struct is used to store the configuration details in the Scheduler contract + access(all) struct Config: SchedulerConfig { + access(all) var maximumIndividualEffort: UInt64 + access(all) var minimumExecutionEffort: UInt64 + access(all) var slotTotalEffortLimit: UInt64 + access(all) var slotSharedEffortLimit: UInt64 + access(all) var priorityEffortReserve: {Priority: UInt64} + access(all) var priorityEffortLimit: {Priority: UInt64} + access(all) var maxDataSizeMB: UFix64 + access(all) var priorityFeeMultipliers: {Priority: UFix64} + access(all) var refundMultiplier: UFix64 + access(all) var canceledTransactionsLimit: UInt + access(all) var collectionEffortLimit: UInt64 + access(all) var collectionTransactionsLimit: Int + + access(all) init( + maximumIndividualEffort: UInt64, + minimumExecutionEffort: UInt64, + slotSharedEffortLimit: UInt64, + priorityEffortReserve: {Priority: UInt64}, + priorityEffortLimit: {Priority: UInt64}, + maxDataSizeMB: UFix64, + priorityFeeMultipliers: {Priority: UFix64}, + refundMultiplier: UFix64, + canceledTransactionsLimit: UInt, + collectionEffortLimit: UInt64, + collectionTransactionsLimit: Int + ) { + self.maximumIndividualEffort = maximumIndividualEffort + self.minimumExecutionEffort = minimumExecutionEffort + self.slotTotalEffortLimit = slotSharedEffortLimit + priorityEffortReserve[Priority.High]! + priorityEffortReserve[Priority.Medium]! + self.slotSharedEffortLimit = slotSharedEffortLimit + self.priorityEffortReserve = priorityEffortReserve + self.priorityEffortLimit = priorityEffortLimit + self.maxDataSizeMB = maxDataSizeMB + self.priorityFeeMultipliers = priorityFeeMultipliers + self.refundMultiplier = refundMultiplier + self.canceledTransactionsLimit = canceledTransactionsLimit + self.collectionEffortLimit = collectionEffortLimit + self.collectionTransactionsLimit = collectionTransactionsLimit + } + } + + + /// SortedTimestamps maintains timestamps sorted in ascending order for efficient processing + /// It encapsulates all operations related to maintaining and querying sorted timestamps + access(all) struct SortedTimestamps { + /// Internal sorted array of timestamps + access(self) var timestamps: [UFix64] + + access(all) init() { + self.timestamps = [] + } + + /// Add a timestamp to the sorted array maintaining sorted order + access(all) fun add(timestamp: UFix64) { + + var insertIndex = 0 + for i, ts in self.timestamps { + if timestamp < ts { + insertIndex = i + break + } + insertIndex = i + 1 + } + self.timestamps.insert(at: insertIndex, timestamp) + } + + /// Remove a timestamp from the sorted array + access(all) fun remove(timestamp: UFix64) { + + let index = self.timestamps.firstIndex(of: timestamp) + if index != nil { + self.timestamps.remove(at: index!) + } + } + + /// Get all timestamps that are in the past (less than or equal to current timestamp) + access(all) fun getBefore(current: UFix64): [UFix64] { + let pastTimestamps: [UFix64] = [] + for timestamp in self.timestamps { + if timestamp <= current { + pastTimestamps.append(timestamp) + } else { + break // No need to check further since array is sorted + } + } + return pastTimestamps + } + + /// Check if there are any timestamps that need processing + /// Returns true if processing is needed, false for early exit + access(all) fun hasBefore(current: UFix64): Bool { + return self.timestamps.length > 0 && self.timestamps[0] <= current + } + + /// Get the whole array of timestamps + access(all) fun getAll(): [UFix64] { + return self.timestamps + } + } + + /// Resources + + /// Shared scheduler is a resource that is used as a singleton in the scheduler contract and contains + /// all the functionality to schedule, process and execute transactions as well as the internal state. + access(all) resource SharedScheduler { + /// nextID contains the next transaction ID to be assigned + /// This the ID is monotonically increasing and is used to identify each transaction + access(contract) var nextID: UInt64 + + /// transactions is a map of transaction IDs to TransactionData structs + access(contract) var transactions: {UInt64: TransactionData} + + /// slot queue is a map of timestamps to Priorities to transaction IDs and their execution efforts + access(contract) var slotQueue: {UFix64: {Priority: {UInt64: UInt64}}} + + /// slot used effort is a map of timestamps map of priorities and + /// efforts that has been used for the timeslot + access(contract) var slotUsedEffort: {UFix64: {Priority: UInt64}} + + /// sorted timestamps manager for efficient processing + access(contract) var sortedTimestamps: SortedTimestamps + + /// canceled transactions keeps a record of canceled transaction IDs up to a canceledTransactionsLimit + access(contract) var canceledTransactions: [UInt64] + + /// Struct that contains all the configuration details for the transaction scheduler protocol + /// Can be updated by the owner of the contract + access(contract) var config: {SchedulerConfig} + + access(all) init() { + self.nextID = 1 + self.canceledTransactions = [0 as UInt64] + + self.transactions = {} + self.slotUsedEffort = {} + self.slotQueue = {} + self.sortedTimestamps = SortedTimestamps() + + /* Default slot efforts and limits look like this: + + Timestamp Slot (35kee) + ┌─────────────────────────┐ + │ ┌─────────────┐ │ + │ │ High Only │ │ High: 30kee max + │ │ 20kee │ │ (20 exclusive + 10 shared) + │ └─────────────┘ │ + | ┌───────────────┐ | + │ | Shared Pool │ | + | │ (High+Medium) │ | + | │ 10kee │ | + | └───────────────┘ | + │ ┌─────────────┐ │ Medium: 15kee max + │ │ Medium Only │ │ (5 exclusive + 10 shared) + │ │ 5kee │ │ + │ └─────────────┘ │ + │ ┌─────────────────────┐ │ Low: 5kee max + │ │ Low (if space left) │ │ (execution time only) + │ │ 5kee │ │ + │ └─────────────────────┘ │ + └─────────────────────────┘ + */ + + let sharedEffortLimit: UInt64 = 10_000 + let highPriorityEffortReserve: UInt64 = 20_000 + let mediumPriorityEffortReserve: UInt64 = 5_000 + + self.config = Config( + maximumIndividualEffort: 9999, + minimumExecutionEffort: 10, + slotSharedEffortLimit: sharedEffortLimit, + priorityEffortReserve: { + Priority.High: highPriorityEffortReserve, + Priority.Medium: mediumPriorityEffortReserve, + Priority.Low: 0 + }, + priorityEffortLimit: { + Priority.High: highPriorityEffortReserve + sharedEffortLimit, + Priority.Medium: mediumPriorityEffortReserve + sharedEffortLimit, + Priority.Low: 5_000 + }, + maxDataSizeMB: 3.0, + priorityFeeMultipliers: { + Priority.High: 10.0, + Priority.Medium: 5.0, + Priority.Low: 2.0 + }, + refundMultiplier: 0.5, + canceledTransactionsLimit: 1000, + collectionEffortLimit: 500_000, // Maximum effort for all transactions in a collection + collectionTransactionsLimit: 150 // Maximum number of transactions in a collection + ) + } + + /// Gets a copy of the struct containing all the configuration details + /// of the Scheduler resource + access(contract) view fun getConfig(): {SchedulerConfig} { + return self.config + } + + /// sets all the configuration details for the Scheduler resource + access(UpdateConfig) fun setConfig(newConfig: {SchedulerConfig}) { + self.config = newConfig + emit ConfigUpdated() + } + + /// getTransaction returns a copy of the specified transaction + access(contract) view fun getTransaction(id: UInt64): TransactionData? { + return self.transactions[id] + } + + /// borrowTransaction borrows a reference to the specified transaction + access(contract) view fun borrowTransaction(id: UInt64): &TransactionData? { + return &self.transactions[id] + } + + /// getCanceledTransactions returns a copy of the canceled transactions array + access(contract) view fun getCanceledTransactions(): [UInt64] { + return self.canceledTransactions + } + + /// getTransactionsForTimeframe returns a dictionary of transactions scheduled within a specified time range, + /// organized by timestamp and priority with arrays of transaction IDs. + /// WARNING: If you provide a time range that is too large, the function will likely fail to complete + /// because the function will run out of gas. Keep the time range small. + /// + /// @param startTimestamp: The start timestamp (inclusive) for the time range + /// @param endTimestamp: The end timestamp (inclusive) for the time range + /// @return {UFix64: {Priority: [UInt64]}}: A dictionary mapping timestamps to priorities to arrays of transaction IDs + access(contract) fun getTransactionsForTimeframe(startTimestamp: UFix64, endTimestamp: UFix64): {UFix64: {UInt8: [UInt64]}} { + var transactionsInTimeframe: {UFix64: {UInt8: [UInt64]}} = {} + + // Validate input parameters + if startTimestamp > endTimestamp { + return transactionsInTimeframe + } + + // Get all timestamps that fall within the specified range + let allTimestampsBeforeEnd = self.sortedTimestamps.getBefore(current: endTimestamp) + + for timestamp in allTimestampsBeforeEnd { + // Check if this timestamp falls within our range + if timestamp < startTimestamp { continue } + + let transactionPriorities = self.slotQueue[timestamp] ?? {} + + var timestampTransactions: {UInt8: [UInt64]} = {} + + for priority in transactionPriorities.keys { + let transactionIDs = transactionPriorities[priority] ?? {} + var priorityTransactions: [UInt64] = [] + + for id in transactionIDs.keys { + priorityTransactions.append(id) + } + + if priorityTransactions.length > 0 { + timestampTransactions[priority.rawValue] = priorityTransactions + } + } + + if timestampTransactions.keys.length > 0 { + transactionsInTimeframe[timestamp] = timestampTransactions + } + + } + + return transactionsInTimeframe + } + + /// calculate fee by converting execution effort to a fee in Flow tokens. + /// @param executionEffort: The execution effort of the transaction + /// @param priority: The priority of the transaction + /// @param dataSizeMB: The size of the data that was passed when the transaction was originally scheduled + /// @return UFix64: The fee in Flow tokens that is required to pay for the transaction + access(contract) fun calculateFee(executionEffort: UInt64, priority: Priority, dataSizeMB: UFix64): UFix64 { + // Use the official FlowFees calculation + let baseFee = FlowFees.computeFees(inclusionEffort: 1.0, executionEffort: UFix64(executionEffort)) + + // Scale the execution fee by the multiplier for the priority + let scaledExecutionFee = baseFee * self.config.priorityFeeMultipliers[priority]! + + // Calculate the FLOW required to pay for storage of the transaction data + let storageFee = FlowStorageFees.storageCapacityToFlow(dataSizeMB) + + return scaledExecutionFee + storageFee + } + + /// getNextIDAndIncrement returns the next ID and increments the ID counter + access(self) fun getNextIDAndIncrement(): UInt64 { + let nextID = self.nextID + self.nextID = self.nextID + 1 + return nextID + } + + /// get status of the scheduled transaction + /// @param id: The ID of the transaction to get the status of + /// @return Status: The status of the transaction, if the transaction is not found Unknown is returned. + access(contract) view fun getStatus(id: UInt64): Status? { + // if the transaction ID is greater than the next ID, it is not scheduled yet and has never existed + if id == 0 as UInt64 || id >= self.nextID { + return nil + } + + // This should always return Scheduled or Executed + if let tx = self.borrowTransaction(id: id) { + return tx.status + } + + // if the transaction was canceled and it is still not pruned from + // list return canceled status + if self.canceledTransactions.contains(id) { + return Status.Canceled + } + + // if transaction ID is after first canceled ID it must be executed + // otherwise it would have been canceled and part of this list + let firstCanceledID = self.canceledTransactions[0] + if id > firstCanceledID { + return Status.Executed + } + + // the transaction list was pruned and the transaction status might be + // either canceled or execute so we return unknown + return Status.Unknown + } + + /// schedule is the primary entry point for scheduling a new transaction within the scheduler contract. + /// If scheduling the transaction is not possible either due to invalid arguments or due to + /// unavailable slots, the function panics. + // + /// The schedule function accepts the following arguments: + /// @param: transaction: A capability to a resource in storage that implements the transaction handler + /// interface. This handler will be invoked at execution time and will receive the specified data payload. + /// @param: timestamp: Specifies the earliest block timestamp at which the transaction is eligible for execution + /// (Unix timestamp so fractional seconds values are ignored). It must be set in the future. + /// @param: priority: An enum value (`High`, `Medium`, or `Low`) that influences the scheduling behavior and determines + /// how soon after the timestamp the transaction will be executed. + /// @param: executionEffort: Defines the maximum computational resources allocated to the transaction. This also determines + /// the fee charged. Unused execution effort is not refunded. + /// @param: fees: A Vault resource containing sufficient funds to cover the required execution effort. + access(contract) fun schedule( + handlerCap: Capability, + data: AnyStruct?, + timestamp: UFix64, + priority: Priority, + executionEffort: UInt64, + fees: @FlowToken.Vault + ): @ScheduledTransaction { + + // Use the estimate function to validate inputs + let estimate = self.estimate( + data: data, + timestamp: timestamp, + priority: priority, + executionEffort: executionEffort + ) + + // Estimate returns an error for low priority transactions + // so need to check that the error is fine + // because low priority transactions are allowed in schedule + if estimate.error != nil && estimate.timestamp == nil { + panic(estimate.error!) + } + + assert ( + fees.balance >= estimate.flowFee!, + message: "Insufficient fees: The Fee balance of \(fees.balance) is not sufficient to pay the required amount of \(estimate.flowFee!) for execution of the transaction." + ) + + let transactionID = self.getNextIDAndIncrement() + let transactionData = TransactionData( + id: transactionID, + handler: handlerCap, + scheduledTimestamp: estimate.timestamp!, + data: data, + priority: priority, + executionEffort: executionEffort, + fees: fees.balance, + ) + + // Deposit the fees to the service account's vault + FlowTransactionScheduler.depositFees(from: <-fees) + + emit Scheduled( + id: transactionData.id, + priority: transactionData.priority.rawValue, + timestamp: transactionData.scheduledTimestamp, + executionEffort: transactionData.executionEffort, + fees: transactionData.fees, + transactionHandlerOwner: transactionData.handler.address, + transactionHandlerTypeIdentifier: transactionData.handlerTypeIdentifier + ) + + // Add the transaction to the slot queue and update the internal state + self.addTransaction(slot: estimate.timestamp!, txData: transactionData) + + return <-create ScheduledTransaction( + id: transactionID, + timestamp: estimate.timestamp! + ) + } + + /// The estimate function calculates the required fee in Flow and expected execution timestamp for + /// a transaction based on the requested timestamp, priority, and execution effort. + // + /// If the provided arguments are invalid or the transaction cannot be scheduled (e.g., due to + /// insufficient computation effort or unavailable time slots) the estimate function + /// returns an EstimatedScheduledTransaction struct with a non-nil error message. + /// + /// This helps developers ensure sufficient funding and preview the expected scheduling window, + /// reducing the risk of unnecessary cancellations. + /// + /// @param data: The data that was passed when the transaction was originally scheduled + /// @param timestamp: The requested timestamp for the transaction + /// @param priority: The priority of the transaction + /// @param executionEffort: The execution effort of the transaction + /// @return EstimatedScheduledTransaction: A struct containing the estimated fee, timestamp, and error message + access(contract) fun estimate( + data: AnyStruct?, + timestamp: UFix64, + priority: Priority, + executionEffort: UInt64 + ): EstimatedScheduledTransaction { + // Remove fractional values from the timestamp + let sanitizedTimestamp = UFix64(UInt64(timestamp)) + + if sanitizedTimestamp <= getCurrentBlock().timestamp { + return EstimatedScheduledTransaction( + flowFee: nil, + timestamp: nil, + error: "Invalid timestamp: \(sanitizedTimestamp) is in the past, current timestamp: \(getCurrentBlock().timestamp)" + ) + } + + if executionEffort > self.config.maximumIndividualEffort { + return EstimatedScheduledTransaction( + flowFee: nil, + timestamp: nil, + error: "Invalid execution effort: \(executionEffort) is greater than the maximum transaction effort of \(self.config.maximumIndividualEffort)" + ) + } + + if executionEffort > self.config.priorityEffortLimit[priority]! { + return EstimatedScheduledTransaction( + flowFee: nil, + timestamp: nil, + error: "Invalid execution effort: \(executionEffort) is greater than the priority's max effort of \(self.config.priorityEffortLimit[priority]!)" + ) + } + + if executionEffort < self.config.minimumExecutionEffort { + return EstimatedScheduledTransaction( + flowFee: nil, + timestamp: nil, + error: "Invalid execution effort: \(executionEffort) is less than the minimum execution effort of \(self.config.minimumExecutionEffort)" + ) + } + + let dataSizeMB = FlowTransactionScheduler.getSizeOfData(data) + if dataSizeMB > self.config.maxDataSizeMB { + return EstimatedScheduledTransaction( + flowFee: nil, + timestamp: nil, + error: "Invalid data size: \(dataSizeMB) is greater than the maximum data size of \(self.config.maxDataSizeMB)MB" + ) + } + + let fee = self.calculateFee(executionEffort: executionEffort, priority: priority, dataSizeMB: dataSizeMB) + + let scheduledTimestamp = self.calculateScheduledTimestamp( + timestamp: sanitizedTimestamp, + priority: priority, + executionEffort: executionEffort + ) + + if scheduledTimestamp == nil { + return EstimatedScheduledTransaction( + flowFee: nil, + timestamp: nil, + error: "Invalid execution effort: \(executionEffort) is greater than the priority's available effort for the requested timestamp." + ) + } + + if priority == Priority.Low { + return EstimatedScheduledTransaction( + flowFee: fee, + timestamp: scheduledTimestamp, + error: "Invalid Priority: Cannot estimate for Low Priority transactions. They will be included in the first block with available space after their requested timestamp." + ) + } + + return EstimatedScheduledTransaction(flowFee: fee, timestamp: scheduledTimestamp, error: nil) + } + + /// calculateScheduledTimestamp calculates the timestamp at which a transaction + /// can be scheduled. It takes into account the priority of the transaction and + /// the execution effort. + /// - If the transaction is high priority, it returns the timestamp if there is enough + /// space or nil if there is no space left. + /// - If the transaction is medium or low priority and there is space left in the requested timestamp, + /// it returns the requested timestamp. If there is not enough space, it finds the next timestamp with space. + /// + /// @param timestamp: The requested timestamp for the transaction + /// @param priority: The priority of the transaction + /// @param executionEffort: The execution effort of the transaction + /// @return UFix64?: The timestamp at which the transaction can be scheduled, or nil if there is no space left for a high priority transaction + access(contract) view fun calculateScheduledTimestamp( + timestamp: UFix64, + priority: Priority, + executionEffort: UInt64 + ): UFix64? { + + let used = self.slotUsedEffort[timestamp] + // if nothing is scheduled at this timestamp, we can schedule at provided timestamp + if used == nil { + return timestamp + } + + let available = self.getSlotAvailableEffort(timestamp: timestamp, priority: priority) + // if theres enough space, we can tentatively schedule at provided timestamp + if executionEffort <= available { + return timestamp + } + + if priority == Priority.High { + // high priority demands scheduling at exact timestamp or failing + return nil + } + + // if there is no space left for medium or low priority we search for next available timestamp + // todo: check how big the callstack can grow and if we should avoid recursion + // todo: we should refactor this into loops, because we could need to recurse 100s of times + return self.calculateScheduledTimestamp( + timestamp: timestamp + 1.0, + priority: priority, + executionEffort: executionEffort + ) + } + + /// slot available effort returns the amount of effort that is available for a given timestamp and priority. + access(contract) view fun getSlotAvailableEffort(timestamp: UFix64, priority: Priority): UInt64 { + + // Remove fractional values from the timestamp + let sanitizedTimestamp = UFix64(UInt64(timestamp)) + + // Get the theoretical maximum allowed for the priority including shared + let priorityLimit = self.config.priorityEffortLimit[priority]! + + // If nothing has been claimed for the requested timestamp, + // return the full amount + if !self.slotUsedEffort.containsKey(sanitizedTimestamp) { + return priorityLimit + } + + // Get the mapping of how much effort has been used + // for each priority for the timestamp + let slotPriorityEffortsUsed = self.slotUsedEffort[sanitizedTimestamp]! + + // Get the exclusive reserves for each priority + let highReserve = self.config.priorityEffortReserve[Priority.High]! + let mediumReserve = self.config.priorityEffortReserve[Priority.Medium]! + + // Get how much effort has been used for each priority + let highUsed = slotPriorityEffortsUsed[Priority.High] ?? 0 + let mediumUsed = slotPriorityEffortsUsed[Priority.Medium] ?? 0 + + // If it is low priority, return whatever effort is remaining + // under 5000, subtracting the currently used effort for low priority + if priority == Priority.Low { + let highPlusMediumUsed = highUsed + mediumUsed + let totalEffortRemaining = self.config.slotTotalEffortLimit.saturatingSubtract(highPlusMediumUsed) + let lowEffortRemaining = totalEffortRemaining < priorityLimit ? totalEffortRemaining : priorityLimit + let lowUsed = slotPriorityEffortsUsed[Priority.Low] ?? 0 + return lowEffortRemaining.saturatingSubtract(lowUsed) + } + + // Get how much shared effort has been used for each priority + // Ensure the results are always zero or positive + let highSharedUsed: UInt64 = highUsed.saturatingSubtract(highReserve) + let mediumSharedUsed: UInt64 = mediumUsed.saturatingSubtract(mediumReserve) + + // Get the theoretical total shared amount between priorities + let totalShared = (self.config.slotTotalEffortLimit.saturatingSubtract(highReserve)).saturatingSubtract(mediumReserve) + + // Get the amount of shared effort currently available + let highPlusMediumSharedUsed = highSharedUsed + mediumSharedUsed + // prevent underflow + let sharedAvailable = totalShared.saturatingSubtract(highPlusMediumSharedUsed) + + // we calculate available by calculating available shared effort and + // adding any unused reserves for that priority + let reserve = self.config.priorityEffortReserve[priority]! + let used = slotPriorityEffortsUsed[priority] ?? 0 + let unusedReserve: UInt64 = reserve.saturatingSubtract(used) + let available = sharedAvailable + unusedReserve + + return available + } + + /// add transaction to the queue and updates all the internal state as well as emit an event + access(self) fun addTransaction(slot: UFix64, txData: TransactionData) { + + // If nothing is in the queue for this slot, initialize the slot + if self.slotQueue[slot] == nil { + self.slotQueue[slot] = {} + + // This also means that the used effort record for this slot has not been initialized + self.slotUsedEffort[slot] = { + Priority.High: 0, + Priority.Medium: 0, + Priority.Low: 0 + } + + self.sortedTimestamps.add(timestamp: slot) + } + + // Add this transaction id to the slot + let slotQueue = self.slotQueue[slot]! + if let priorityQueue = slotQueue[txData.priority] { + priorityQueue[txData.id] = txData.executionEffort + slotQueue[txData.priority] = priorityQueue + } else { + slotQueue[txData.priority] = { + txData.id: txData.executionEffort + } + } + + self.slotQueue[slot] = slotQueue + + // Add the execution effort for this transaction to the total for the slot's priority + let slotEfforts = self.slotUsedEffort[slot]! + var newPriorityEffort = slotEfforts[txData.priority]! + txData.executionEffort + slotEfforts[txData.priority] = newPriorityEffort + var newTotalEffort: UInt64 = 0 + for priority in slotEfforts.keys { + newTotalEffort = newTotalEffort.saturatingAdd(slotEfforts[priority]!) + } + self.slotUsedEffort[slot] = slotEfforts + + // Need to potentially reschedule low priority transactions to make room for the new transaction + // Iterate through them and record which ones to reschedule until the total effort is less than the limit + let lowTransactionsToReschedule: [UInt64] = [] + if newTotalEffort > self.config.slotTotalEffortLimit { + let lowPriorityTransactions = slotQueue[Priority.Low]! + for id in lowPriorityTransactions.keys { + if newTotalEffort <= self.config.slotTotalEffortLimit { + break + } + lowTransactionsToReschedule.append(id) + newTotalEffort = newTotalEffort.saturatingSubtract(lowPriorityTransactions[id]!) + } + } + + // Store the transaction in the transactions map + self.transactions[txData.id] = txData + + // Reschedule low priority transactions if needed + self.rescheduleLowPriorityTransactions(slot: slot, transactions: lowTransactionsToReschedule) + } + + /// rescheduleLowPriorityTransactions reschedules low priority transactions to make room for a new transaction + /// @param slot: The slot that the transactions are currently scheduled at + /// @param transactions: The transactions to reschedule + access(self) fun rescheduleLowPriorityTransactions(slot: UFix64, transactions: [UInt64]) { + for id in transactions { + let tx = self.borrowTransaction(id: id) + ?? panic("Invalid ID: \(id) transaction not found") // critical bug + + assert ( + tx.priority == Priority.Low, + message: "Invalid Priority: Cannot reschedule transaction with id \(id) because it is not low priority" + ) + + assert ( + tx.scheduledTimestamp == slot, + message: "Invalid Timestamp: Cannot reschedule transaction with id \(id) because it is not scheduled at the same slot as the new transaction" + ) + + let newTimestamp = self.calculateScheduledTimestamp( + timestamp: slot + 1.0, + priority: Priority.Low, + executionEffort: tx.executionEffort + )! + + let effort = tx.executionEffort + + let transactionData = self.removeTransaction(txData: tx) + + // Subtract the execution effort for this transaction from the slot's priority + let slotEfforts = self.slotUsedEffort[slot]! + slotEfforts[Priority.Low] = slotEfforts[Priority.Low]!.saturatingSubtract(effort) + self.slotUsedEffort[slot] = slotEfforts + + // Update the transaction's scheduled timestamp and add it back to the slot queue + transactionData.setScheduledTimestamp(newTimestamp: newTimestamp) + self.addTransaction(slot: newTimestamp, txData: transactionData) + } + } + + /// remove the transaction from the slot queue. + access(self) fun removeTransaction(txData: &TransactionData): TransactionData { + + let transactionID = txData.id + let slot = txData.scheduledTimestamp + let transactionPriority = txData.priority + + // remove transaction object + let transactionObject = self.transactions.remove(key: transactionID)! + + // garbage collect slots + if let transactionQueue = self.slotQueue[slot] { + + if let priorityQueue = transactionQueue[transactionPriority] { + priorityQueue[transactionID] = nil + if priorityQueue.keys.length == 0 { + transactionQueue.remove(key: transactionPriority) + } else { + transactionQueue[transactionPriority] = priorityQueue + } + + self.slotQueue[slot] = transactionQueue + } + + // if the slot is now empty remove it from the maps + if transactionQueue.keys.length == 0 { + self.slotQueue.remove(key: slot) + self.slotUsedEffort.remove(key: slot) + + self.sortedTimestamps.remove(timestamp: slot) + } + } + + return transactionObject + } + + /// pendingQueue creates a list of transactions that are ready for execution. + /// For transaction to be ready for execution it must be scheduled. + /// + /// The queue is sorted by timestamp and then by priority (high, medium, low). + /// The queue will contain transactions from all timestamps that are in the past. + /// Low priority transactions will only be added if there is effort available in the slot. + /// The return value can be empty if there are no transactions ready for execution. + access(Process) fun pendingQueue(): [&TransactionData] { + let currentTimestamp = getCurrentBlock().timestamp + var pendingTransactions: [&TransactionData] = [] + + // total effort across different timestamps guards collection being over the effort limit + var collectionAvailableEffort = self.config.collectionEffortLimit + var transactionsAvailableCount = self.config.collectionTransactionsLimit + + // Collect past timestamps efficiently from sorted array + let pastTimestamps = self.sortedTimestamps.getBefore(current: currentTimestamp) + + for timestamp in pastTimestamps { + let transactionPriorities = self.slotQueue[timestamp] ?? {} + var high: [&TransactionData] = [] + var medium: [&TransactionData] = [] + var low: [&TransactionData] = [] + + for priority in transactionPriorities.keys { + let transactionIDs = transactionPriorities[priority] ?? {} + for id in transactionIDs.keys { + let tx = self.borrowTransaction(id: id) + ?? panic("Invalid ID: \(id) transaction not found during initial processing") // critical bug + + // Only add scheduled transactions to the queue + if tx.status != Status.Scheduled { + continue + } + + // this is safeguard to prevent collection growing too large in case of block production slowdown + if tx.executionEffort >= collectionAvailableEffort || transactionsAvailableCount == 0 { + emit CollectionLimitReached( + collectionEffortLimit: transactionsAvailableCount == 0 ? nil : self.config.collectionEffortLimit, + collectionTransactionsLimit: transactionsAvailableCount == 0 ? self.config.collectionTransactionsLimit : nil + ) + break + } + + collectionAvailableEffort = collectionAvailableEffort.saturatingSubtract(tx.executionEffort) + transactionsAvailableCount = transactionsAvailableCount - 1 + + switch tx.priority { + case Priority.High: + high.append(tx) + case Priority.Medium: + medium.append(tx) + case Priority.Low: + low.append(tx) + } + } + } + + pendingTransactions = pendingTransactions + .concat(high) + .concat(medium) + .concat(low) + } + + return pendingTransactions + } + + /// removeExecutedTransactions removes all transactions that are marked as executed. + access(self) fun removeExecutedTransactions(_ currentTimestamp: UFix64) { + let pastTimestamps = self.sortedTimestamps.getBefore(current: currentTimestamp) + + for timestamp in pastTimestamps { + let transactionPriorities = self.slotQueue[timestamp] ?? {} + + for priority in transactionPriorities.keys { + let transactionIDs = transactionPriorities[priority] ?? {} + for id in transactionIDs.keys { + let tx = self.borrowTransaction(id: id) + ?? panic("Invalid ID: \(id) transaction not found during initial processing") // critical bug + + // Only remove executed transactions + if tx.status != Status.Executed { + continue + } + + // charge the full fee for transaction execution + destroy tx.payAndRefundFees(refundMultiplier: 0.0) + + self.removeTransaction(txData: tx) + } + } + } + } + + /// process scheduled transactions and prepare them for execution. + /// + /// First, it removes transactions that have already been executed. + /// Then, it iterates over past timestamps in the queue and processes the transactions that are + /// eligible for execution. It also emits an event for each transaction that is processed. + /// + /// This function is only called by the FVM to process transactions. + access(Process) fun process() { + let currentTimestamp = getCurrentBlock().timestamp + // Early exit if no timestamps need processing + if !self.sortedTimestamps.hasBefore(current: currentTimestamp) { + return + } + + self.removeExecutedTransactions(currentTimestamp) + + let pendingTransactions = self.pendingQueue() + + if pendingTransactions.length == 0 { + return + } + + for tx in pendingTransactions { + // Only emit the pending execution event if the transaction handler capability is borrowable + // This is to prevent a situation where the transaction handler is not available + // In that case, the transaction is no longer valid because it cannot be executed + if let transactionHandler = tx.handler.borrow() { + emit PendingExecution( + id: tx.id, + priority: tx.priority.rawValue, + executionEffort: tx.executionEffort, + fees: tx.fees, + transactionHandlerOwner: tx.handler.address, + transactionHandlerTypeIdentifier: transactionHandler.getType().identifier + ) + } + + // after pending execution event is emitted we set the transaction as executed because we + // must rely on execution node to actually execute it. Execution of the transaction is + // done in a separate transaction that calls executeTransaction(id) function. + // Executing the transaction can not update the status of transaction or any other shared state, + // since that blocks concurrent transaction execution. + // Therefore an optimistic update to executed is made here to avoid race condition. + tx.setStatus(newStatus: Status.Executed) + } + } + + /// cancel a scheduled transaction and return a portion of the fees that were paid. + /// + /// @param id: The ID of the transaction to cancel + /// @return: The fees to be returned to the caller + access(Cancel) fun cancel(id: UInt64): @FlowToken.Vault { + let tx = self.borrowTransaction(id: id) ?? + panic("Invalid ID: \(id) transaction not found") + + assert( + tx.status == Status.Scheduled, + message: "Transaction must be in a scheduled state in order to be canceled" + ) + + // Subtract the execution effort for this transaction from the slot's priority + let slotEfforts = self.slotUsedEffort[tx.scheduledTimestamp]! + slotEfforts[tx.priority] = slotEfforts[tx.priority]!.saturatingSubtract(tx.executionEffort) + self.slotUsedEffort[tx.scheduledTimestamp] = slotEfforts + + let totalFees = tx.fees + let refundedFees <- tx.payAndRefundFees(refundMultiplier: self.config.refundMultiplier) + + // if the transaction was canceled, add it to the canceled transactions array + // maintain sorted order by inserting at the correct position + var insertIndex = 0 + for i, canceledID in self.canceledTransactions { + if id < canceledID { + insertIndex = i + break + } + insertIndex = i + 1 + } + self.canceledTransactions.insert(at: insertIndex, id) + + // keep the array under the limit + if UInt(self.canceledTransactions.length) > self.config.canceledTransactionsLimit { + self.canceledTransactions.remove(at: 0) + } + + emit Canceled( + id: tx.id, + priority: tx.priority.rawValue, + feesReturned: refundedFees.balance, + feesDeducted: totalFees - refundedFees.balance, + transactionHandlerOwner: tx.handler.address, + transactionHandlerTypeIdentifier: tx.handlerTypeIdentifier + ) + + self.removeTransaction(txData: tx) + + return <-refundedFees + } + + /// execute transaction is a system function that is called by FVM to execute a transaction by ID. + /// The transaction must be found and in correct state or the function panics and this is a fatal error + /// + /// This function is only called by the FVM to execute transactions. + /// WARNING: this function should not change any shared state, it will be run concurrently and it must not be blocking. + access(Execute) fun executeTransaction(id: UInt64) { + let tx = self.borrowTransaction(id: id) ?? + panic("Invalid ID: Transaction with id \(id) not found") + + assert ( + tx.status == Status.Executed, + message: "Invalid ID: Cannot execute transaction with id \(id) because it has incorrect status \(tx.status.rawValue)" + ) + + let transactionHandler = tx.handler.borrow() + ?? panic("Invalid transaction handler: Could not borrow a reference to the transaction handler") + + emit Executed( + id: tx.id, + priority: tx.priority.rawValue, + executionEffort: tx.executionEffort, + transactionHandlerOwner: tx.handler.address, + transactionHandlerTypeIdentifier: transactionHandler.getType().identifier + ) + + transactionHandler.executeTransaction(id: id, data: tx.getData()) + } + } + + /// Deposit fees to this contract's account's vault + access(contract) fun depositFees(from: @FlowToken.Vault) { + let vaultRef = self.account.storage.borrow<&FlowToken.Vault>(from: /storage/flowTokenVault) + ?? panic("Unable to borrow reference to the default token vault") + vaultRef.deposit(from: <-from) + } + + /// Withdraw fees from this contract's account's vault + access(contract) fun withdrawFees(amount: UFix64): @FlowToken.Vault { + let vaultRef = self.account.storage.borrow(from: /storage/flowTokenVault) + ?? panic("Unable to borrow reference to the default token vault") + + return <-vaultRef.withdraw(amount: amount) as! @FlowToken.Vault + } + + access(all) fun schedule( + handlerCap: Capability, + data: AnyStruct?, + timestamp: UFix64, + priority: Priority, + executionEffort: UInt64, + fees: @FlowToken.Vault + ): @ScheduledTransaction { + return <-self.sharedScheduler.borrow()!.schedule( + handlerCap: handlerCap, + data: data, + timestamp: timestamp, + priority: priority, + executionEffort: executionEffort, + fees: <-fees + ) + } + + access(all) fun estimate( + data: AnyStruct?, + timestamp: UFix64, + priority: Priority, + executionEffort: UInt64 + ): EstimatedScheduledTransaction { + return self.sharedScheduler.borrow()! + .estimate( + data: data, + timestamp: timestamp, + priority: priority, + executionEffort: executionEffort, + ) + } + + access(all) fun cancel(scheduledTx: @ScheduledTransaction): @FlowToken.Vault { + let id = scheduledTx.id + destroy scheduledTx + return <-self.sharedScheduler.borrow()!.cancel(id: id) + } + + /// getTransactionData returns the transaction data for a given ID + /// This function can only get the data for a transaction that is currently scheduled or pending execution + /// because finalized transaction metadata is not stored in the contract + /// @param id: The ID of the transaction to get the data for + /// @return: The transaction data for the given ID + access(all) view fun getTransactionData(id: UInt64): TransactionData? { + return self.sharedScheduler.borrow()!.getTransaction(id: id) + } + + access(all) view fun getCanceledTransactions(): [UInt64] { + return self.sharedScheduler.borrow()!.getCanceledTransactions() + } + + access(all) view fun getStatus(id: UInt64): Status? { + return self.sharedScheduler.borrow()!.getStatus(id: id) + } + + /// getTransactionsForTimeframe returns the IDs of the transactions that are scheduled for a given timeframe + /// @param startTimestamp: The start timestamp to get the IDs for + /// @param endTimestamp: The end timestamp to get the IDs for + /// @return: The IDs of the transactions that are scheduled for the given timeframe + access(all) fun getTransactionsForTimeframe(startTimestamp: UFix64, endTimestamp: UFix64): {UFix64: {UInt8: [UInt64]}} { + return self.sharedScheduler.borrow()!.getTransactionsForTimeframe(startTimestamp: startTimestamp, endTimestamp: endTimestamp) + } + + access(all) view fun getSlotAvailableEffort(timestamp: UFix64, priority: Priority): UInt64 { + return self.sharedScheduler.borrow()!.getSlotAvailableEffort(timestamp: timestamp, priority: priority) + } + + access(all) fun getConfig(): {SchedulerConfig} { + return self.sharedScheduler.borrow()!.getConfig() + } + + /// getSizeOfData takes a transaction's data + /// argument and stores it in the contract account's storage, + /// checking storage used before and after to see how large the data is in MB + /// If data is nil, the function returns 0.0 + access(all) fun getSizeOfData(_ data: AnyStruct?): UFix64 { + if data == nil { + return 0.0 + } else { + let type = data!.getType() + if type.isSubtype(of: Type()) + || type.isSubtype(of: Type()) + || type.isSubtype(of: Type
()) + || type.isSubtype(of: Type()) + || type.isSubtype(of: Type()) + { + return 0.0 + } + } + let storagePath = /storage/dataTemp + let storageUsedBefore = self.account.storage.used + self.account.storage.save(data!, to: storagePath) + let storageUsedAfter = self.account.storage.used + self.account.storage.load(from: storagePath) + + return FlowStorageFees.convertUInt64StorageBytesToUFix64Megabytes(storageUsedAfter.saturatingSubtract(storageUsedBefore)) + } + + access(all) init() { + self.storagePath = /storage/sharedScheduler + let scheduler <- create SharedScheduler() + let oldScheduler <- self.account.storage.load<@AnyResource>(from: self.storagePath) + destroy oldScheduler + self.account.storage.save(<-scheduler, to: self.storagePath) + + self.sharedScheduler = self.account.capabilities.storage + .issue(self.storagePath) + } +} \ No newline at end of file diff --git a/contracts/testContracts/TestFlowScheduledTransactionHandler.cdc b/contracts/testContracts/TestFlowScheduledTransactionHandler.cdc new file mode 100644 index 000000000..936e2dc61 --- /dev/null +++ b/contracts/testContracts/TestFlowScheduledTransactionHandler.cdc @@ -0,0 +1,105 @@ +import "FlowTransactionScheduler" +import "FlowToken" +import "FungibleToken" + +// ⚠️ WARNING: UNSAFE FOR PRODUCTION ⚠️ +// This is a TEST CONTRACT ONLY and should NEVER be used in production! +// This contract is designed solely for testing FlowTransactionScheduler functionality +// and contains unsafe implementations that could lead to loss of funds or security vulnerabilities. +// +// DO NOT DEPLOY THIS CONTRACT OR A SIMILAR CONTRACT TO MAINNET OR ANY PRODUCTION ENVIRONMENT +// UNLESS YOU ARE SURE WHAT YOU ARE DOING! +// +// TestFlowScheduledTransactionHandler is a simplified test contract for testing FlowTransactionScheduler +access(all) contract TestFlowScheduledTransactionHandler { + access(all) var scheduledTransactions: @{UInt64: FlowTransactionScheduler.ScheduledTransaction} + access(all) var succeededTransactions: [UInt64] + + access(all) let HandlerStoragePath: StoragePath + access(all) let HandlerPublicPath: PublicPath + + access(all) resource Handler: FlowTransactionScheduler.TransactionHandler { + + access(all) let name: String + access(all) let description: String + + init(name: String, description: String) { + self.name = name + self.description = description + } + + access(FlowTransactionScheduler.Execute) + fun executeTransaction(id: UInt64, data: AnyStruct?) { + // Most transactions will have string data + if let dataString = data as? String { + // intentional failure test case + if dataString == "fail" { + panic("Transaction \(id) failed") + } else if dataString == "cancel" { + // This should always fail because the transaction can't cancel itself during execution + destroy <-TestFlowScheduledTransactionHandler.cancelTransaction(id: id) + } else { + // All other regular test cases should succeed + TestFlowScheduledTransactionHandler.succeededTransactions.append(id) + } + } else if let dataCap = data as? Capability { + // Testing scheduling a transaction with a transaction + let scheduledTransaction <- FlowTransactionScheduler.schedule( + handlerCap: dataCap, + data: "test data", + timestamp: getCurrentBlock().timestamp + 10.0, + priority: FlowTransactionScheduler.Priority.High, + executionEffort: UInt64(1000), + fees: <-TestFlowScheduledTransactionHandler.getFeeFromVault(amount: 1.0) + ) + TestFlowScheduledTransactionHandler.addScheduledTransaction(scheduledTx: <-scheduledTransaction) + } else { + panic("TestFlowScheduledTransactionHandler.executeTransaction: Invalid data type for transaction with id \(id). Type is \(data.getType().identifier)") + } + } + } + + access(all) fun createHandler(): @Handler { + return <- create Handler(name: "Test FlowTransactionHandler Resource", description: "Executes a variety of transactions for different test cases") + } + + // ⚠️ WARNING: UNSAFE FOR PRODUCTION ⚠️ + // This function is part of a TEST CONTRACT and should NEVER be used in production! + // It contains unsafe implementations that could lead to loss of funds or security vulnerabilities. + access(all) fun addScheduledTransaction(scheduledTx: @FlowTransactionScheduler.ScheduledTransaction) { + let status = scheduledTx.status() + if status == nil { + panic("Invalid status for transaction with id \(scheduledTx.id)") + } + self.scheduledTransactions[scheduledTx.id] <-! scheduledTx + } + + // ⚠️ WARNING: UNSAFE FOR PRODUCTION ⚠️ + // This function is part of a TEST CONTRACT and should NEVER be used in production! + // It contains unsafe implementations that could lead to loss of funds or security vulnerabilities. + access(all) fun cancelTransaction(id: UInt64): @FlowToken.Vault { + let scheduledTx <- self.scheduledTransactions.remove(key: id) + ?? panic("Invalid ID: \(id) transaction not found") + return <-FlowTransactionScheduler.cancel(scheduledTx: <-scheduledTx!) + } + + access(all) fun getSucceededTransactions(): [UInt64] { + return self.succeededTransactions + } + + access(contract) fun getFeeFromVault(amount: UFix64): @FlowToken.Vault { + // borrow a reference to the vault that will be used for fees + let vault = self.account.storage.borrow(from: /storage/flowTokenVault) + ?? panic("Could not borrow FlowToken vault") + + return <- vault.withdraw(amount: amount) as! @FlowToken.Vault + } + + access(all) init() { + self.scheduledTransactions <- {} + self.succeededTransactions = [] + + self.HandlerStoragePath = /storage/testTransactionHandler + self.HandlerPublicPath = /public/testTransactionHandler + } +} \ No newline at end of file diff --git a/flow.json b/flow.json index d9eeed952..4538c29e8 100644 --- a/flow.json +++ b/flow.json @@ -17,6 +17,13 @@ "testnet": "8c5303eaa26202d6" } }, + "FlowTransactionScheduler": { + "source": "./contracts/FlowTransactionScheduler.cdc", + "aliases": { + "emulator": "f8d6e0586b0a20c7", + "testing": "0000000000000001" + } + }, "FlowClusterQC": { "source": "./contracts/epochs/FlowClusterQC.cdc", "aliases": { @@ -44,12 +51,21 @@ "testnet": "9eca2b38b18b5dfe" } }, + "FlowExecutionParameters": { + "source": "./contracts/FlowExecutionParameters.cdc", + "aliases": { + "emulator": "f8d6e0586b0a20c7", + "mainnet": "f426ff57ee8f6110", + "testing": "0000000000000007", + "testnet": "6997a2f2cf57b73a" + } + }, "FlowFees": { "source": "./contracts/FlowFees.cdc", "aliases": { "emulator": "e5a8b7f23e8b548f", "mainnet": "f919ee77447b7497", - "testing": "0000000000000007", + "testing": "0000000000000004", "testnet": "912d5440f7e3769e" } }, @@ -62,15 +78,6 @@ "testnet": "9eca2b38b18b5dfe" } }, - "FlowExecutionParameters": { - "source": "./contracts/FlowExecutionParameters.cdc", - "aliases": { - "emulator": "f8d6e0586b0a20c7", - "mainnet": "f426ff57ee8f6110", - "testing": "0000000000000007", - "testnet": "6997a2f2cf57b73a" - } - }, "FlowServiceAccount": { "source": "./contracts/FlowServiceAccount.cdc", "aliases": { @@ -94,7 +101,7 @@ "aliases": { "emulator": "f8d6e0586b0a20c7", "mainnet": "e467b9dd11fa00df", - "testing": "0000000000000007", + "testing": "0000000000000001", "testnet": "8c5303eaa26202d6" } }, @@ -103,7 +110,7 @@ "aliases": { "emulator": "0ae53cb6e3f42a79", "mainnet": "1654653399040a61", - "testing": "0000000000000007", + "testing": "0000000000000003", "testnet": "7e60df042a9c0868" } }, @@ -112,14 +119,14 @@ "aliases": { "emulator": "ee82856bf20e2aa6", "mainnet": "f233dcee88fe0abe", - "testing": "0000000000000007", + "testing": "0000000000000002", "testnet": "9a0766d93b6608b7" } }, "LinearCodeAddressGenerator": { "source": "./contracts/LinearCodeAddressGenerator.cdc", "aliases": { - "testing": "0x0000000000000007" + "testing": "0000000000000007" } }, "LockedTokens": { @@ -157,6 +164,13 @@ "testing": "0000000000000007", "testnet": "7aad92e5a0715d21" } + }, + "TestFlowScheduledTransactionHandler": { + "source": "./contracts/testContracts/TestFlowScheduledTransactionHandler.cdc", + "aliases": { + "emulator": "f8d6e0586b0a20c7", + "testing": "0000000000000001" + } } }, "networks": { @@ -168,7 +182,14 @@ "accounts": { "emulator-account": { "address": "f8d6e0586b0a20c7", - "key": "7677f7c9410f8773b482737c778b5d7c6acfdbbae718d61e4727a07667f66004" + "key": "aff3a277caf2bdd6582c156ae7b07dbca537da7833309de88e56987faa2c0f1b" + } + }, + "deployments": { + "emulator": { + "emulator-account": [ + "TestFlowScheduledTransactionHandler" + ] } } } \ No newline at end of file diff --git a/lib/go/contracts/contracts.go b/lib/go/contracts/contracts.go index 0c619295f..b9f5ed608 100644 --- a/lib/go/contracts/contracts.go +++ b/lib/go/contracts/contracts.go @@ -44,28 +44,31 @@ const ( flowRandomBeaconHistoryFilename = "RandomBeaconHistory.cdc" cryptoFilename = "Crypto.cdc" linearCodeAddressGeneratorFilename = "LinearCodeAddressGenerator.cdc" + flowTransactionSchedulerFilename = "FlowTransactionScheduler.cdc" // Test contracts // only used for testing - TESTFlowIdentityTableFilename = "testContracts/TestFlowIDTableStaking.cdc" + TESTFlowIdentityTableFilename = "testContracts/TestFlowIDTableStaking.cdc" + TESTflowScheduledTransactionHandlerFilename = "testContracts/TestFlowScheduledTransactionHandler.cdc" // Each contract has placeholder addresses that need to be replaced // depending on which network they are being used with - placeholderFungibleTokenAddress = "\"FungibleToken\"" - placeholderFungibleTokenMVAddress = "\"FungibleTokenMetadataViews\"" - placeholderMetadataViewsAddress = "\"MetadataViews\"" - placeholderFlowTokenAddress = "\"FlowToken\"" - placeholderIDTableAddress = "\"FlowIDTableStaking\"" - placeholderBurnerAddress = "\"Burner\"" - placeholderStakingProxyAddress = "\"StakingProxy\"" - placeholderQCAddr = "\"FlowClusterQC\"" - placeholderDKGAddr = "\"FlowDKG\"" - placeholderEpochAddr = "\"FlowEpoch\"" - placeholderFlowFeesAddress = "\"FlowFees\"" - placeholderStorageFeesAddress = "\"FlowStorageFees\"" - placeholderLockedTokensAddress = "\"LockedTokens\"" - placeholderStakingCollectionAddress = "\"FlowStakingCollection\"" - placeholderNodeVersionBeaconAddress = "\"NodeVersionBeacon\"" + placeholderFungibleTokenAddress = "\"FungibleToken\"" + placeholderFungibleTokenMVAddress = "\"FungibleTokenMetadataViews\"" + placeholderMetadataViewsAddress = "\"MetadataViews\"" + placeholderFlowTokenAddress = "\"FlowToken\"" + placeholderIDTableAddress = "\"FlowIDTableStaking\"" + placeholderBurnerAddress = "\"Burner\"" + placeholderStakingProxyAddress = "\"StakingProxy\"" + placeholderQCAddr = "\"FlowClusterQC\"" + placeholderDKGAddr = "\"FlowDKG\"" + placeholderEpochAddr = "\"FlowEpoch\"" + placeholderFlowFeesAddress = "\"FlowFees\"" + placeholderStorageFeesAddress = "\"FlowStorageFees\"" + placeholderLockedTokensAddress = "\"LockedTokens\"" + placeholderStakingCollectionAddress = "\"FlowStakingCollection\"" + placeholderNodeVersionBeaconAddress = "\"NodeVersionBeacon\"" + placeholderFlowTransactionSchedulerAddress = "\"FlowTransactionScheduler\"" ) // Adds a `0x` prefix to the provided address string @@ -293,6 +296,15 @@ func RandomBeaconHistory() []byte { return assets.MustAsset(flowRandomBeaconHistoryFilename) } +// FlowTransactionScheduler returns the FlowTransactionScheduler contract. +func FlowTransactionScheduler(env templates.Environment) []byte { + code := assets.MustAssetString(flowTransactionSchedulerFilename) + + code = templates.ReplaceAddresses(code, env) + + return []byte(code) +} + // FlowContractAudits returns the deprecated FlowContractAudits contract. // This contract is no longer used on any network func FlowContractAudits() []byte { @@ -368,6 +380,15 @@ func TestFlowFees(fungibleTokenAddress, flowTokenAddress, storageFeesAddress str return []byte(code) } +// TestFlowScheduledTransactionHandler returns the TestFlowScheduledTransactionHandler contract. +func TestFlowScheduledTransactionHandler(env templates.Environment) []byte { + code := assets.MustAssetString(TESTflowScheduledTransactionHandlerFilename) + + code = templates.ReplaceAddresses(code, env) + + return []byte(code) +} + func ExampleToken(env templates.Environment) []byte { return ftcontracts.ExampleToken(env.FungibleTokenAddress, env.MetadataViewsAddress, env.FungibleTokenMetadataViewsAddress) } diff --git a/lib/go/contracts/contracts_test.go b/lib/go/contracts/contracts_test.go index e31ed8bea..0817a0e6b 100644 --- a/lib/go/contracts/contracts_test.go +++ b/lib/go/contracts/contracts_test.go @@ -41,6 +41,7 @@ func SetAllAddresses(env *templates.Environment) { env.ServiceAccountAddress = fakeAddr env.NodeVersionBeaconAddress = fakeAddr env.RandomBeaconHistoryAddress = fakeAddr + env.FlowTransactionSchedulerAddress = fakeAddr } // Tests that a specific contract path should succeed when retrieving it @@ -164,6 +165,23 @@ func TestStakingCollection(t *testing.T) { assert.Contains(t, contract, "import LockedTokens from 0x") } +func TestFlowTransactionScheduler(t *testing.T) { + env := templates.Environment{} + SetAllAddresses(&env) + contract := string(contracts.FlowTransactionScheduler(env)) + GetCadenceContractShouldSucceed(t, contract) + assert.Contains(t, contract, "import FlowToken from 0x") + assert.Contains(t, contract, "import FlowFees from 0x") +} + +func TestFlowScheduledTransactionHandler(t *testing.T) { + env := templates.Environment{} + SetAllAddresses(&env) + contract := string(contracts.TestFlowScheduledTransactionHandler(env)) + GetCadenceContractShouldSucceed(t, contract) + assert.Contains(t, contract, "import FlowTransactionScheduler from 0x") +} + func TestNodeVersionBeacon(t *testing.T) { contract := string(contracts.NodeVersionBeacon()) GetCadenceContractShouldSucceed(t, contract) diff --git a/lib/go/contracts/go.mod b/lib/go/contracts/go.mod index cfd61e093..ed127b3a9 100644 --- a/lib/go/contracts/go.mod +++ b/lib/go/contracts/go.mod @@ -1,12 +1,12 @@ module github.com/onflow/flow-core-contracts/lib/go/contracts -go 1.22 +go 1.23.0 -toolchain go1.22.4 +toolchain go1.23.1 require ( github.com/kevinburke/go-bindata v3.24.0+incompatible - github.com/onflow/flow-core-contracts/lib/go/templates v1.6.1-0.20250226163127-3c9723416637 + github.com/onflow/flow-core-contracts/lib/go/templates v1.7.2-0.20250910191958-e8d0be12d23a github.com/onflow/flow-ft/lib/go/contracts v1.0.1 github.com/onflow/flow-go-sdk v1.0.0-preview.54 github.com/onflow/flow-nft/lib/go/contracts v1.2.4 @@ -59,10 +59,10 @@ require ( github.com/x448/float16 v0.8.4 // indirect github.com/zeebo/blake3 v0.2.3 // indirect go.opentelemetry.io/otel v1.24.0 // indirect - golang.org/x/crypto v0.19.0 // indirect + golang.org/x/crypto v0.35.0 // indirect golang.org/x/exp v0.0.0-20240119083558-1b970713d09a // indirect - golang.org/x/sys v0.17.0 // indirect - golang.org/x/text v0.14.0 // indirect + golang.org/x/sys v0.30.0 // indirect + golang.org/x/text v0.22.0 // indirect golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 // indirect gonum.org/v1/gonum v0.14.0 // indirect google.golang.org/protobuf v1.33.0 // indirect diff --git a/lib/go/contracts/go.sum b/lib/go/contracts/go.sum index 31aaef5db..6b48e3305 100644 --- a/lib/go/contracts/go.sum +++ b/lib/go/contracts/go.sum @@ -221,8 +221,8 @@ github.com/onflow/cadence v1.0.0-preview.51 h1:L+toCS2Sw9bsExc2PxeNMmAK96fn2LdTO github.com/onflow/cadence v1.0.0-preview.51/go.mod h1:7wvvecnAZtYOspLOS3Lh+FuAmMeSrXhAWiycC3kQ1UU= github.com/onflow/crypto v0.25.1 h1:0txy2PKPMM873JbpxQNbJmuOJtD56bfs48RQfm0ts5A= github.com/onflow/crypto v0.25.1/go.mod h1:C8FbaX0x8y+FxWjbkHy0Q4EASCDR9bSPWZqlpCLYyVI= -github.com/onflow/flow-core-contracts/lib/go/templates v1.6.1-0.20250226163127-3c9723416637 h1:EhhRQDEAc5K3NOtFF+Qd7eXKOToYxEOtSqOtt70ia/Y= -github.com/onflow/flow-core-contracts/lib/go/templates v1.6.1-0.20250226163127-3c9723416637/go.mod h1:pN768Al/wLRlf3bwugv9TyxniqJxMu4sxnX9eQJam64= +github.com/onflow/flow-core-contracts/lib/go/templates v1.7.2-0.20250910191958-e8d0be12d23a h1:D1NNRCJLDiQ52lVEbKz9A+BOoVBlMpau/F/Q20dz2AA= +github.com/onflow/flow-core-contracts/lib/go/templates v1.7.2-0.20250910191958-e8d0be12d23a/go.mod h1:yBkysayvSKZ/yFO3fEX4YQ/FEZtV6Tnov8ix0lBeiqM= github.com/onflow/flow-ft/lib/go/contracts v1.0.1 h1:Ts5ob+CoCY2EjEd0W6vdLJ7hLL3SsEftzXG2JlmSe24= github.com/onflow/flow-ft/lib/go/contracts v1.0.1/go.mod h1:PwsL8fC81cjnUnTfmyL/HOIyHnyaw/JA474Wfj2tl6A= github.com/onflow/flow-ft/lib/go/templates v1.0.1 h1:FDYKAiGowABtoMNusLuRCILIZDtVqJ/5tYI4VkF5zfM= @@ -343,8 +343,8 @@ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.19.0 h1:ENy+Az/9Y1vSrlrvBSyna3PITt4tiZLf7sgCjZBX7Wo= -golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= +golang.org/x/crypto v0.35.0 h1:b15kiHdrGCHrP6LvwaQ3c03kgNhhiMgvlhxHQhmg2Xs= +golang.org/x/crypto v0.35.0/go.mod h1:dy7dXNW32cAb/6/PRuTNsix8T+vJAqvuIy5Bli/x0YQ= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -380,8 +380,8 @@ golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.14.0 h1:dGoOF9QVLYng8IHTm7BAyWqCqSheQ5pYWGhzW00YJr0= -golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.17.0 h1:zY54UmvipHiNd+pm+m0x9KhZ9hl1/7QNMyxXbc6ICqA= +golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -435,6 +435,8 @@ golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.11.0 h1:GGz8+XQP4FvTTrjZPzNKTMFtSXH80RAzG+5ghFPgK9w= +golang.org/x/sync v0.11.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -477,8 +479,8 @@ golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y= -golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.30.0 h1:QjkSwP/36a20jFYWkSue1YwXzLmsV5Gfq7Eiy72C1uc= +golang.org/x/sys v0.30.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -486,8 +488,8 @@ golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3 golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= -golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/text v0.22.0 h1:bofq7m3/HAFvbF51jz3Q9wLg3jkvSPuiZu/pD1XwgtM= +golang.org/x/text v0.22.0/go.mod h1:YRoo4H8PVmsu+E3Ou7cqLVH8oXWIHVoX0jqUWALQhfY= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -539,8 +541,8 @@ golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4f golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= -golang.org/x/tools v0.17.0 h1:FvmRgNOcs3kOa+T20R1uhfP9F6HgG2mfxDv1vrx1Htc= -golang.org/x/tools v0.17.0/go.mod h1:xsh6VxdV005rRVaS6SSAf9oiAqljS7UZUacMZ8Bnsps= +golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d h1:vU5i/LfpvrRCpgM/VPfJLg5KjxD3E+hfT1SH+d9zLwg= +golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= diff --git a/lib/go/contracts/internal/assets/assets.go b/lib/go/contracts/internal/assets/assets.go index 9706d58da..1fcc73ae0 100644 --- a/lib/go/contracts/internal/assets/assets.go +++ b/lib/go/contracts/internal/assets/assets.go @@ -8,6 +8,7 @@ // FlowStakingCollection.cdc (64.644kB) // FlowStorageFees.cdc (9.096kB) // FlowToken.cdc (13.11kB) +// FlowTransactionScheduler.cdc (69.497kB) // LinearCodeAddressGenerator.cdc (4.793kB) // LockedTokens.cdc (34.201kB) // NodeVersionBeacon.cdc (24.614kB) @@ -17,6 +18,7 @@ // epochs/FlowDKG.cdc (29.087kB) // epochs/FlowEpoch.cdc (64.983kB) // testContracts/TestFlowIDTableStaking.cdc (9.238kB) +// testContracts/TestFlowScheduledTransactionHandler.cdc (5.173kB) package assets @@ -245,6 +247,26 @@ func flowtokenCdc() (*asset, error) { return a, nil } +var _flowtransactionschedulerCdc = "\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xec\x7d\x4d\x93\x1c\xb7\x91\xe8\x5d\xbf\x02\xd4\x41\xee\xb6\x86\xcd\x91\xbd\xda\x58\x77\x70\x48\x53\xfc\xb0\x27\x96\x92\xf8\xc8\xa1\xf7\x20\x2b\x2c\x4c\x15\xba\x1b\x6f\xaa\x0b\xed\x02\x6a\x7a\x5a\x14\x23\x5e\xec\xf9\x1d\xf6\xb0\x87\xf7\xfb\xf6\x97\xbc\x40\xe2\xa3\xf0\x91\xa8\xae\x19\x52\xfe\x0a\x4f\x6c\x78\xc5\x2e\x20\x91\x48\x24\x12\x99\x89\x44\x26\xdf\xee\x44\xa7\xc8\xa7\x2f\xfa\x76\xcd\x2f\x1b\x76\x21\xae\x58\xfb\xe9\x27\xfe\xe7\x46\xec\x91\x9f\x5e\x30\x26\xe3\x5f\xde\x28\xd1\xd1\x35\x8b\x3f\xfc\x81\xb3\xfd\x6b\x26\x45\x73\xcd\xba\x4f\x3f\xf9\xe4\xc1\x83\x07\x04\x00\x76\xb4\x95\xb4\x52\x5c\xb4\x6f\xaa\x0d\xab\xfb\x86\x75\x84\xb5\xf4\xb2\x61\x92\xc8\x2d\xed\x14\xa9\x44\xab\x3a\x5a\x29\x49\x94\x20\xd2\x36\x22\xb4\x57\xa2\x15\x5b\xd1\x4b\xc2\x6e\x58\xd5\x6b\x08\x84\xb7\x44\x6d\x18\x59\xf5\xaa\xef\xd8\x42\x0f\x02\x03\x5d\x6c\xb8\xf4\x60\x08\xdf\xee\x1a\xb6\x65\xad\x92\xe4\xc5\xcb\xf3\x57\xe4\xd7\xbf\x3e\xfd\x85\xf4\x80\x6b\xa2\x06\x94\x88\x3c\x48\xc5\xb6\x27\x84\x36\x8d\xd8\xf3\x76\x1d\x23\xf3\xe9\x9e\x5e\x31\xd2\xef\x3e\x25\xb4\xad\x2d\x1a\x0c\x46\x6c\xc4\x9a\x57\x84\x2a\xb2\xeb\x58\xcd\x56\xbc\xd5\x70\xf9\x96\x49\xb2\xe7\x6a\x23\x7a\x45\xd8\x8d\x62\x5d\x4b\x1b\xa2\x3a\xbe\x5e\xb3\x4e\x2e\x88\xc7\xf7\x0d\x86\x8b\x24\xb4\x63\x64\xd7\x71\xd1\x71\xc5\x7f\x64\x35\x99\xfd\x9e\xaf\x37\x0f\xbe\x66\x35\xef\xb7\x0f\x5e\x8a\xfd\x1c\x80\x93\x9a\xaf\x56\xac\x63\xad\x0a\x08\xb3\xee\x69\x47\x5b\xc5\x98\x04\x54\x57\x8c\x91\x6d\xdf\x28\xbe\x6b\x38\xeb\xe4\x12\x86\x26\x84\xdc\x27\x1a\xa4\x1b\xe4\x10\x76\x5b\xf1\x4e\xaa\xfb\x97\x8d\xa8\xae\x06\xb8\x27\xbe\x9f\xc1\x62\xe8\xb9\xeb\xc4\x35\xaf\x99\x24\x97\x4c\xaa\xfb\x6c\xb5\xd2\x4c\x60\x69\xcc\xdb\xf5\xd0\xf1\xa5\xd8\x0f\xbd\x2c\x09\x25\x11\x3b\xcd\x35\x7d\xcb\xa5\xe2\x15\x6d\x9a\x03\xd9\x6f\x58\x4b\x2a\xba\xa3\x95\x6e\x08\xeb\x21\x09\x5d\x29\xd6\xc1\x92\x6b\xe2\x12\xae\xc8\x9e\x06\x4b\x19\x90\xf4\x62\xc3\xec\x62\x92\x5e\x32\x69\xda\xcb\x46\x28\xb3\x22\x01\xa9\x2c\xae\x0d\xdf\x72\xb3\xca\x5b\xda\xd2\x35\x23\x2d\x53\x7b\xd1\x5d\x91\x8e\x49\xd1\x77\x15\x93\x66\x0e\xac\x95\x7d\xa7\x39\x43\xaf\x34\xaf\x94\xe6\x5c\xb2\x63\xdd\x4a\x74\x5b\xda\x56\x8c\xec\x37\xbc\x61\x86\xa5\x75\xb3\x56\x5c\xb3\x26\xe4\x5e\x20\x69\xb5\xa1\xbc\x25\x3b\xaa\x34\x53\x48\xd2\xf0\x2b\x46\x3a\x56\xf5\x9d\x06\x0d\xe3\xec\xe8\x01\x78\xf6\x04\xfa\x6e\xa9\x62\x35\xa1\xdd\x25\x57\x7a\xab\x9d\xc0\xaa\xea\x39\xdd\xbf\xa4\x92\xd5\x03\xb3\x03\x23\x2e\x3e\xa1\x55\xc5\xa4\x9c\xd1\xa6\x99\x0f\xdf\x8a\xfb\xef\xdd\x27\x9f\x10\x42\x88\x1e\x56\xf2\x76\xdd\x30\x05\x7b\x4b\x2a\x98\x50\xaf\x07\xd0\x5b\x51\x89\x8e\xe9\x95\x28\xec\x9d\x9a\x2a\xea\xe1\x68\xfc\x3a\xd1\xab\xb1\x0e\xab\xbe\x85\xff\xa0\x0d\x57\x07\xe8\x69\xd1\x96\xac\x59\xcd\xc9\x35\xed\x88\xdc\xd0\x8e\xd5\x1e\xd3\x25\x79\x4a\x77\xf4\x92\xeb\x0e\x0f\x69\xaf\x36\xb3\xa7\x1a\xc5\x66\x4e\x3e\x7b\x13\xb7\x7c\x14\x4c\xc9\x88\x27\x4d\xed\x0d\x59\x09\xc3\x3f\xc3\x3c\xa5\x27\x83\x5b\xe9\x10\x15\xa0\x60\xc3\x94\x83\xf2\x8a\xaa\xcd\x92\xbc\x19\xfe\x31\x8c\xf3\xbc\xed\xb7\x72\xf8\xe7\x2b\xcb\xe4\x19\x34\xd6\xf6\x5b\xff\x75\x49\xde\x9e\xb7\xea\xdf\xc8\x3b\x68\x96\x36\xad\xa8\x64\xb0\x45\xcb\x5f\xcd\x46\x2c\x7f\x7f\x29\xf6\xf0\xf1\xfd\x80\xd9\x1b\x45\x55\x2f\x71\xbc\xcc\xb7\x1c\x2b\xdd\xaf\x6f\xaf\x5a\xb1\x6f\x89\x84\x36\xcc\x08\x28\xe0\x0e\x4d\xd5\x0d\x6d\x6b\xe0\xf8\x0d\xd7\xb4\xe2\x15\xbe\xea\x76\xff\xb5\xbd\x66\x0b\x0b\xa8\x8c\xfd\x5b\x33\x64\x84\xc6\xb6\x37\x9b\x4e\x0e\xd3\x40\xfb\x7a\xa9\x1a\xf5\x5e\x71\xcd\x6f\x5a\x9c\x1e\x1f\xfd\xb9\x11\x4f\x75\xb9\x85\x61\x3f\xdb\x22\x20\xf1\xf3\x6b\xbd\x77\x83\x7f\x6f\xb9\xd2\x3b\x18\xa4\x1a\x8d\x76\x01\x0f\x04\x58\xbe\x26\x1a\xce\x30\x93\x99\xc7\x84\xd7\x66\x8d\xfe\xf5\x5f\x4e\xfc\x6f\xbb\x98\xa7\x86\x0f\x70\x12\x29\xba\xdd\x2d\xc9\xdb\x17\xfc\x26\xec\xe3\xe5\xe0\x73\x10\x83\x39\xd0\x15\x63\x32\xef\x16\x4c\xe0\xf7\x7a\xdd\x59\xf7\xed\xbe\xd5\xfb\xf3\x49\x5d\x77\x4c\xca\xb1\x96\x17\x87\x1d\x3b\xaf\x59\xab\xf8\x8a\xeb\x2e\x6f\x14\x08\x3d\xdd\x78\x5e\xa4\x18\xca\x4b\xf1\x31\xee\x26\xa9\x29\xda\x31\xaa\x3f\x80\x18\xe2\xca\xfe\x52\x1f\x80\x51\xfd\x94\x0b\xd4\x7e\xc5\xda\x9a\xb7\xeb\xe7\xae\xd9\x1d\x89\xfe\x77\x4d\x59\x4d\x31\x7b\x38\xd7\xe4\xf2\x00\x22\xf3\xc5\x1f\xbe\x2e\x50\xcc\xed\x93\x9f\x8b\x52\x7f\x3b\x34\xa9\xec\x7e\x77\x34\xa9\x3a\x46\x95\xe8\x88\x58\x19\xad\x64\x68\x5d\x20\x95\x13\x18\x77\x24\x95\xe6\x99\xd7\x4c\xf5\x5d\xcb\xea\x9c\x77\xf4\xd7\x67\xac\xee\x2b\x85\x7d\xfd\x8b\x53\xb1\x12\x4d\xc3\x0c\xe9\x40\xbb\x0a\x36\xa6\xef\xa2\xf5\x34\xf3\x51\x6d\xa8\x51\xe7\xdc\xde\xe5\x92\xb4\xa2\xbd\xdf\xf2\xc6\x6c\x63\x09\x24\xc6\x1b\x47\xf0\x84\xda\xb0\x2e\x6d\xd8\x0a\x15\x41\xe6\x4d\x69\x85\x3c\xd6\x2f\x35\x84\xd7\xa6\xcf\xb0\x5e\xc3\xac\x0c\xbb\x42\x2b\xb7\x84\x8f\x4f\x90\x76\x81\xce\x25\x6d\xeb\xf3\x56\x3d\x8e\xa9\x17\x13\x4f\xb4\x8c\x88\x8e\x6c\xb5\xc6\x65\x79\xab\x12\xed\x8a\xaf\xfb\x8e\x1a\x65\x8b\x29\xca\x1b\xad\xa6\xb3\xa6\xb6\x27\xf1\xae\xa6\xca\x93\xc2\x1c\x41\xa4\xe1\x52\xb1\x96\x75\xc0\xba\xf6\x5f\x5a\x99\x53\xda\x44\xd2\x64\xfd\x73\xcf\x3a\xc3\xcb\x2d\xdb\xc7\x83\x38\x48\x1c\x10\x38\x90\x96\x81\x22\x58\xa4\x9b\xee\xfa\xd6\x20\x31\x0b\xb9\xa2\x55\x5c\x59\x0b\x0c\x51\x3a\xfc\x47\x27\x46\x46\xdb\xbc\xea\x84\xfe\x30\xda\xc6\xec\xb1\xd1\x26\x06\x4d\x83\xf2\x80\xe9\x79\xab\x58\xb7\xa2\x15\x0b\x4e\xee\x8b\x6c\x2f\x10\xa0\x1c\xe1\xae\xb1\xe1\x31\x63\xf5\x49\x2d\x3c\x40\xb5\x24\x5b\xa6\x36\xc2\x5b\x89\x01\x18\xd3\xde\x0f\xb0\xed\xa5\x22\x97\x6c\x30\x53\x07\xe9\xe2\x14\x52\xd3\x43\xeb\xf1\x94\xb7\x76\x1b\x80\xc1\xa9\x84\xee\x99\x0a\x6a\x54\x7a\x2d\xfc\x80\x4f\x5a\x6d\x52\x6c\x44\x07\x5a\x50\xe5\x15\x6a\xcf\x16\x7e\x58\x2e\x9d\x5d\x67\xd9\x72\x30\xe8\x62\x25\x66\x11\xed\xbf\xc8\xa0\xf6\xda\xb5\x31\xc3\xc0\x32\x8f\x86\xb4\xd8\xa7\xf2\xd3\x0c\xa8\x4d\x32\xec\x88\xa7\x5d\xc7\xaf\x99\x5c\x64\x8b\x3c\xe0\xee\x97\x27\x5f\xc1\x25\x09\xbd\x13\x0b\xf7\x1f\xce\x0e\x4a\x61\x5e\x73\xb6\xd7\xc6\x0a\x59\x33\xa5\x3b\xca\xd9\x7c\x49\xbe\xd3\x22\xf1\xfb\x40\x43\xd6\x7f\x1d\x88\x66\xf2\xdd\xf7\xfe\xd7\xf7\x38\x48\x0d\xad\x33\xc3\x6a\x88\xb3\x3f\xc1\x20\x4b\xa2\x81\xce\x97\xe4\x49\x7b\x78\xa3\xba\xbe\x52\x8f\xf1\x01\x9c\xf4\x4a\x46\x80\xdd\xe6\x4c\x6a\x4d\xcf\x90\xa7\x42\xda\x02\xf7\x84\xdd\x22\x10\xbf\xdd\xd1\x8e\x6e\xe1\x60\xd2\xcb\xc9\x6b\x27\x82\xf0\x63\x71\x66\x17\xb5\xd5\xbc\xd8\x4b\xb6\xea\x1b\xd0\xb3\x68\x7b\x30\xab\x60\xbc\x1e\xb4\xba\xe2\xed\x7a\x8e\x8d\xa4\x2d\x47\x33\x96\xfe\xaf\x41\x66\xef\xa8\x94\x8e\xf5\x32\xf6\xa0\x92\x88\x8e\xaf\xb5\x3a\xdf\x1c\x12\x15\xda\xc1\x07\x48\x5b\x7a\x48\x30\xd3\xb0\x06\x07\x40\x7e\x76\x27\xf4\xb1\x0b\x67\x29\x6b\x16\x2f\xdf\xd6\xb3\xe0\x20\xb7\x33\x1a\x96\x71\x9e\xdb\x60\xfa\xf7\x40\xce\x78\x1d\xff\x22\xd6\x38\x72\x39\xa0\x7f\xe9\x25\xd8\xab\x15\xd3\xbb\xc0\xba\x45\x8e\x6f\xce\x73\xe5\x1c\x29\x6a\xc3\xb6\x7a\xf3\xad\x99\x81\x67\x6c\x21\x4b\x0a\xde\x45\xc4\xd0\xa7\x84\x5d\x5d\xbb\x20\x97\xb4\xba\xf2\x40\x41\x6a\xb0\x60\xa3\x7b\x7f\x83\x12\x56\x5f\xca\xe8\xcb\x57\x5a\x2b\xdf\xd8\x63\xf9\xc0\xb4\x00\x64\x9e\xa8\xf5\x82\x94\xf7\x35\x4a\x27\xdc\x7a\xd6\x66\xfb\xb0\x28\xc5\x26\x99\x75\x74\x44\x0a\x18\x5a\x69\x19\x60\x8c\xe5\xc2\x1e\x2d\x79\x5b\x16\x89\x4f\x63\x71\x29\xba\x4e\xec\x67\xf3\x7b\x8b\x35\x53\x06\x24\xf0\x92\x64\xcd\x6a\xc1\xeb\x39\xb6\xd3\x79\xcb\xd5\x2c\x1a\x35\xe4\xbe\xe8\x43\x3e\x3d\xf7\x65\x9e\x20\x6e\x07\x24\x67\x84\xd7\xf9\x87\x41\xf8\x9e\x0d\x30\x71\x29\x64\x35\x02\x16\x6a\x34\x11\x1f\x73\x49\x6a\x26\x55\x27\x0e\x05\xe3\xda\x00\x78\x6d\xdb\x3f\x73\x6d\x83\x3d\x46\xce\x1c\xbe\x27\xf9\x14\xdd\x47\xff\x21\xdb\x7f\xcf\xa5\xe2\xe0\x54\x43\xf9\xc9\x1f\xb5\x20\x8f\xc0\x68\x34\xed\xf5\xe6\x42\x8e\x37\xde\xae\xf3\xa3\x48\xc2\x16\x3f\x32\x52\xec\x61\x59\x19\xff\xba\xdb\xf7\xcc\x75\x05\x07\x2e\x37\x3c\xe5\x25\x58\x88\x87\x51\x04\x72\x21\x98\xf2\xba\x1d\xc0\xd1\xe9\x71\x2c\x2d\x43\x0b\x7a\x18\x7b\xf8\xd9\x8b\x9f\x48\x10\xf3\xa6\x89\xb4\x10\xaa\xa6\x6f\xb5\x18\x01\xd6\x75\xc2\xa9\x57\x62\x67\x5c\x83\xf6\xc7\x2d\x93\x92\xae\x99\xd5\x45\x23\x04\x2a\xda\x6a\x29\x32\x69\xfe\x00\xcc\x99\x2f\x8f\xb3\x8d\xee\x44\x97\xdd\xed\xb0\xcb\x52\x92\x21\xec\xf6\xf8\x24\x01\x8c\xee\x2c\xb7\xb8\x67\x6e\x15\x6e\xbb\xc7\x7c\x33\x43\x92\x33\x33\x68\xb0\x05\x13\x1e\xbf\x48\x9c\xb3\x40\x59\xd2\xb1\x5d\xc7\x24\x6b\x15\x75\xa7\x5f\xc1\xde\x0d\x8f\x0d\xcb\x90\x76\xfb\xea\x63\xa2\xeb\xad\x37\x15\x54\xe1\x9a\x5f\xf3\xba\x37\xe7\x7c\x74\x70\x80\xd3\x18\x3a\x7b\x70\xa9\xc6\xc9\x8c\xeb\x10\x1c\xfb\x05\x35\x17\x14\x82\x94\xcf\xac\xb6\x9b\x9d\x74\xc8\x1e\x0c\x28\xf1\x4c\x13\xe2\x83\xce\x8b\xc1\x38\x8f\x5c\xbc\x28\xbb\xe1\x9e\x0d\xfc\x7c\xa1\x9d\x3d\x5a\xdc\xc1\x12\x2b\x76\x9a\x75\xe8\x56\xf4\x2d\x1c\xac\x3b\x7a\xc0\x04\x41\x79\xe3\x07\xce\xa6\x18\xee\x85\xbd\x4d\x19\xd9\xe2\xa1\x8b\x52\x8f\x1a\xe3\x05\xbb\x33\xbe\x0d\x0a\xfd\xbd\x27\xfa\xa8\xb7\x3a\xd8\x70\x55\xa5\x36\xd4\x9d\x09\x7f\xee\x99\x8c\xe4\x4c\x06\xbe\x09\xef\x8c\x32\xd8\x5e\x49\xca\x00\x9d\x44\x90\x2e\x7b\xe5\xaf\x8e\xcc\x64\xf7\x1b\xd6\xe5\x86\x87\xde\x25\x95\xea\x41\xad\xf4\xcc\x96\x4e\xa0\xbc\x84\x5e\xca\x97\xd5\x0a\x8d\xcd\xd3\x6c\x17\x04\xbc\x8e\xca\x58\x16\x98\xc7\xa8\xcc\xd2\xeb\xbc\x71\x16\x4e\x7a\x51\xe2\xb5\xd7\xcf\xde\xe5\x06\xd1\xfb\x47\x09\x4f\x1c\x76\x5a\xef\x77\xfe\x1e\x4c\x45\xb6\x03\x15\x19\x6e\x73\xd4\x71\x34\xd2\xcb\x7a\xa4\xbc\x6b\x2a\xc6\xee\x5b\x77\x34\x0c\xd6\x42\xac\x9f\xc6\x62\x65\x9c\x60\xa9\xa6\x3e\x72\x26\x8c\x2a\x5d\xd1\xef\x77\x5d\x85\x18\x4a\x99\x95\xe2\x76\xe9\x14\xe2\xaf\xb9\xb8\x8a\xbf\x1f\xf5\xbe\x92\xa2\xaf\xfa\x76\x0a\xa4\x93\xf2\x67\xd9\xc2\xf8\x26\xb0\xa0\x67\xc3\x4d\x62\xf4\xd1\x4b\x80\x33\x3f\x27\xe4\x68\x8c\x67\xa3\x0f\xc9\xf8\x17\xe4\x5c\x66\x4c\xea\x43\x99\x05\x57\x41\xfe\xa3\x35\x8c\xce\xac\x48\x5e\xe4\x97\x4a\xfa\x2f\x60\xdd\xd7\x6c\x35\xcc\xd0\xeb\xf6\x51\x6b\xfd\xf7\xf8\x31\xd9\xd1\x96\x57\xb3\x4f\xcf\xdb\x6b\xda\xf0\x1a\xdb\x5c\x4b\xf2\x54\xf4\x4d\x0d\x46\x92\x81\x04\xe7\x37\x48\x20\x6d\x0d\x8a\xd2\xae\xfc\x74\x5e\x24\xbf\xdd\x51\x01\x8e\xd4\xee\xb1\x52\x8f\x78\x0b\x0f\x1d\x5f\xb3\x95\xb6\x58\xf4\xe7\xd9\x7c\x31\x48\x0b\x84\x88\x19\x23\x6b\x05\x3d\xfb\xb1\xe4\xd2\x90\xce\x2c\xb2\x2e\x4e\x99\x9b\xac\xb9\x16\x40\x06\xe5\x05\x08\x2d\x31\xd5\xd1\xc2\xd0\x12\xbf\xb1\x17\x44\xee\x7a\x70\x51\x96\x03\x60\x04\x7a\x53\xad\x65\xfb\x37\xd1\xb1\x9d\xee\x8a\x5d\xc7\x92\x5f\xf4\x9f\xef\x46\xee\x79\xe6\xb2\xb7\x9d\x4b\xe2\x99\xc2\x29\x04\xdf\xb0\xbd\x43\x76\x50\x77\x6d\xf3\x4f\x33\xd8\x21\xe7\x0e\xd0\xdd\x2d\x0d\xf9\xec\xb3\x42\x0b\x77\x39\xb1\xcc\x20\xea\xbf\x0c\xa9\x8b\xe8\x84\x52\x1b\xc2\x6b\xf2\xc7\x99\x33\x5b\x51\xaa\xe6\xb8\x0e\x74\x38\xcb\x31\x7d\x1c\x6f\xc2\x7c\x17\x92\xa5\xd6\x44\xd9\xc7\x41\x58\x1f\x22\xa2\x6d\xe0\xa0\x97\x4c\x11\x2a\xfd\xcd\x96\xf5\x58\x70\x39\xf8\x1f\xa6\x4d\xc5\x91\xf4\xaf\x3f\x15\x8f\xc9\xb1\xa9\x04\xbb\x2f\x65\xa6\xb3\x61\x8e\x63\x9b\x35\xdf\xee\xd1\xc6\x45\xfc\xb9\x7f\xc5\x5d\x9c\x21\xab\x77\x74\x76\xe2\x4e\xdb\xd4\x7f\x2f\x1b\xef\xfd\x44\x19\x1d\x52\xa2\xb4\xe0\x3b\x7a\x78\xd2\xd6\xaf\xd9\xaa\x6f\xeb\x17\xcc\x46\xbc\xd5\x1d\xdd\x4b\x38\x52\xc9\xaa\x13\xdb\x6c\xc9\x4c\xd4\x92\x70\x26\x80\xee\x1b\x04\xa8\x65\x6b\x5f\xb3\x9d\x90\x5c\x49\xf0\x29\x37\x6c\xa5\xc4\x35\xeb\x0c\x78\x7b\x08\xba\xc8\x44\x72\x4d\xfb\x46\x59\x7f\x88\x8b\x5c\xd2\xc6\x52\x2b\x6a\x46\xc4\x8e\x75\x70\x5f\xdb\xb1\x3d\xed\x6a\x19\x8d\x03\x41\x58\x7a\x00\x73\x7f\x18\xa2\x6b\x11\x05\xf7\x8b\x8d\x0b\x3b\xc2\x59\x29\x55\x66\x66\x92\x5f\xfb\x39\x7a\xc6\x5a\x92\xdf\xfa\x48\xcb\xc5\x1f\x00\xfb\x29\xac\x96\xc2\x23\x8f\xce\xc8\xe9\xe2\x54\xf3\x58\xf6\xe9\xe1\x19\xf9\x62\x71\x7a\x84\xb9\xb2\x55\x30\x1e\xf9\xe1\xdf\xfe\xa6\xea\x92\xa9\x3d\x63\x2d\x0c\xa7\x6d\xfc\x2f\x16\xa7\x60\x5c\xad\x85\x22\x7f\xcc\x26\x3a\x1f\x63\x3d\xbe\xca\xb1\x3d\x33\x13\xc9\xa7\xec\xd6\x78\x61\xd9\x61\xa6\x59\x6b\x49\x1e\xde\x2f\xba\x5a\x1d\x2b\xc2\x0a\x18\xe3\x79\x39\x28\x7d\xf3\x5c\x2d\xb3\xbe\x5b\x0b\x12\x96\x04\xae\xf8\xd9\xf3\xed\x4e\x1d\x60\x75\x66\xc0\x61\x5a\xeb\x31\xd7\x35\x0f\xd3\xe5\x7b\x34\x4b\x00\xbf\x27\xac\x91\xd8\x1a\x6a\xb5\xd1\x60\x75\x21\xcc\xad\xbe\x73\x5c\x02\x6b\xff\x32\xa3\xcd\x28\x84\x7f\x67\x6c\x17\xf5\xbf\x9f\x00\x47\x7b\xeb\x96\x7e\xf4\x87\xf7\xcb\x6e\x6b\x94\x96\xf1\x00\x39\x3d\x3f\xd2\x92\x85\x53\x1c\x5b\xb5\x70\x32\x05\xae\x4b\xa4\xd7\x9a\x29\xf0\x08\x55\x62\xc7\x6d\xb0\xac\x81\x66\xce\x2a\xe3\xff\xe5\xac\xc9\x5c\x8a\x89\xab\xd0\x5e\x0f\x6a\x58\xb3\x09\x17\x78\xde\xda\x29\x7b\xef\x4c\xff\xe0\x1e\xd3\x3b\xee\xe0\x86\xa7\x31\xb7\x2a\x5a\x90\x16\x42\x03\x6c\x70\xf4\x9b\xec\x62\x66\xb8\xba\xd1\xa6\x33\x97\x43\x0c\xdf\x5a\xcb\xd5\x16\x9c\xdc\x1b\x46\x76\x9d\x50\xa2\x12\xcd\xe0\x50\xdc\x70\x99\xdf\x7e\x0b\x73\xa9\xe4\xdd\x51\x38\x36\x56\x22\x9b\xf0\x80\x38\x70\xbb\xe4\xb5\x1b\xc6\xf0\x73\x30\x37\xf6\xe1\x45\x2d\x5c\xa1\xd3\x1b\xbe\xed\xb7\x2e\x94\x37\xf4\x08\xf8\xa9\x69\xc1\x7e\xcc\x51\x76\x4d\x3b\x07\xeb\xdc\xbb\x34\x13\xd7\x5d\x3c\x30\x6f\xcd\xc0\x69\x34\xb1\xf5\x49\xf9\xef\x39\x62\x11\x9c\xdb\x63\x69\x00\x3f\x2f\xf8\x17\x63\x8d\xac\x11\xfa\x40\x54\xb4\x89\x62\x9d\x3d\x8e\x65\xe2\x45\x60\xaa\x7e\xdb\x37\x54\xf1\x6b\xd6\x98\x78\xec\xca\xdc\x0e\x08\x08\x56\x01\x55\x4e\x0f\x74\x09\x1f\x7d\xdc\x7a\x21\xbc\x12\x3c\x65\x8d\x50\x17\x1a\x2d\x24\x8e\x06\x99\x81\xb9\x36\x9b\x32\x85\xf8\x52\x23\x98\x4f\x84\xf5\x86\xaf\x37\xb0\xdf\x53\xe7\x65\xdc\x3d\x8c\x5c\xad\xc4\xf6\x12\x42\xfb\x7d\x1c\x3a\xef\x08\xbb\xa9\x9a\x5e\xf2\x6b\xe6\x86\xd7\x9b\xb4\xbb\x66\x92\x6c\xe8\x35\x33\x17\x9b\x2b\xde\x94\x6e\x25\x1c\x25\x4c\xfc\xf2\x51\x52\x0c\xa1\xf3\xd1\x60\x8e\x12\xd6\x41\x2c\x56\xd1\x72\x72\x19\x4f\xca\x76\xaa\x07\xdc\x1b\x1b\x1a\x49\xab\x4d\xee\x5c\x49\xd1\x75\x0d\x0c\xb2\xaf\x0d\xb0\x25\x79\x17\xc7\x34\xff\xeb\xbf\xa4\x8a\x62\x82\x3a\xba\x84\x03\x97\xb9\x66\x3b\x36\x8c\xa8\xe5\x06\xf5\xbc\x36\x11\x41\x4b\xcd\x63\xe8\x6d\xe9\x8d\x11\xf7\x92\xff\xc8\x52\xb4\x86\x0f\x21\x3f\xc1\xe5\x86\xdd\xb8\x53\x85\x8b\x3e\x21\xde\xf0\x1f\xd9\xd7\x5f\xe1\x7e\x61\x3f\xd5\xe4\xcd\x06\x84\x78\x5d\xd3\xa6\xd7\x1a\x36\xc8\x35\x73\xbf\xde\x54\x9a\x5e\xc6\x8b\x4d\xeb\x9a\xd5\x24\x01\x07\xf1\x52\x5a\xa4\x6b\x80\xb7\x5f\xe4\x17\x8c\x7d\x1d\xbe\x1c\x09\xc9\x08\xe8\x27\x64\xcc\xd4\x48\x47\xca\x9d\xe8\xc2\x70\x0b\xa3\xbc\x6b\x62\xea\x89\x99\x5e\x3e\x74\x30\x96\x82\x43\xe0\xe5\xd8\x26\x2a\x29\xd8\x31\x7a\x2e\x80\x33\x8b\xc9\x4b\x57\xbc\xed\xb7\x97\xc6\xf3\xed\x63\x3e\x43\x59\x10\x0b\x09\x41\xae\xb4\xf2\x65\x4f\x35\x6c\x0c\x42\xbb\x8e\x96\xa9\x5d\x44\xcb\x30\x6b\x32\x07\x2c\x02\x71\x82\x38\x1f\x4e\x99\xa6\x89\x05\x1b\x8f\xc3\x35\xcb\x68\x8e\xc5\x3e\x96\x90\xbc\x05\xa9\x23\xa4\x22\xc7\xbe\x61\x63\xa3\x39\xdc\x12\x55\x3c\xfc\x12\x0f\xf2\xc8\x5d\xfc\x47\xf4\x81\xd8\x4d\x3e\x7e\x2c\x27\xde\xfd\x31\xa1\x8f\xbb\xf0\x8f\x0a\xdc\xb1\x6e\x45\x31\x78\x92\xce\x37\x17\x51\x38\xdc\xe3\xa2\xe1\x24\xd1\x7d\xf1\x1d\x1a\xb7\x3a\xb2\x15\x92\xc6\x63\x0c\x59\x6a\x5a\x60\x08\xd7\x70\x9a\xab\xe7\xef\xd5\xfe\x2e\x2f\xe0\x77\x6e\xf9\x16\x2f\xc5\xfe\xfb\x7b\x7a\x42\xc7\xb1\x2e\x1c\x57\xcb\xf8\x9d\x1f\x32\x89\x35\x98\xd5\x9d\xb9\x08\xd6\xa7\xd2\x9f\x21\x7c\x40\x24\xb3\x99\x84\xea\x1d\xa6\x68\x9e\x4d\xe9\x59\x4e\xa3\xc6\x5d\xc9\x90\xbe\x93\xbc\x0d\x25\xa6\xce\xfe\x16\xe4\x72\xd3\xbe\x03\xc5\x7e\xcf\xd7\x9b\x49\xf4\x72\x63\xdc\x95\x64\xf1\x93\xd4\x8f\x4b\x30\x3f\xff\x5b\xd0\xcc\x4c\x7c\x84\x62\x81\xe8\xc9\xc9\x75\x86\x4b\xef\xb4\xe1\x54\x62\x85\xba\x73\x4a\xaa\x48\xaf\x3e\x4a\x2c\x63\xe1\xe3\xd6\x84\x58\x05\x74\x19\xc5\xfb\xb6\x64\x19\xf6\xdd\x51\xc2\xdc\x96\x8f\x62\xd2\xa4\x1b\xef\x2f\x4b\x9c\x09\xfb\x0c\x25\x8f\x97\xbc\x47\xe0\xdf\x4a\x26\xc5\x84\x89\x1f\x60\xff\x45\xa9\x52\x12\xd6\x63\xba\xa2\x3e\x56\x8f\x4c\x34\x78\x67\x14\x29\x90\x76\xc2\x4f\xc7\x3e\x1f\x9f\x74\x78\x1a\x8d\x20\x8a\x4d\xab\x68\x6b\xe8\xa3\xf5\xd8\xa4\x30\xab\xc3\x4f\xa9\xfc\x71\xc2\x01\x1b\x4e\xa8\x84\xe2\xa8\xd7\x7e\x27\x64\x7a\x49\x41\xdc\x3d\x12\x6e\x9c\x3c\xb2\x97\x4c\x98\xcb\x67\xf2\xe2\xc6\x7c\xfc\x14\xff\x80\xcf\xdf\xde\x8e\x61\xe3\x87\x47\x41\x79\x06\x45\x7a\x64\x7e\xdb\xa7\xa2\xad\x3a\xa6\x82\xc7\x17\x34\xb4\x7b\x53\x57\xa6\x77\x72\xc6\x5e\x56\xe7\x02\x95\xc9\xf3\xfb\xb2\x83\x75\xdc\xdd\x8b\xb8\x57\x0d\x02\x4b\xc4\xb9\xea\xe6\x76\x5b\xdf\x68\xb1\xdf\xb8\xb7\xb2\xd4\x6d\xd4\x41\x38\xd6\xa9\xec\x4b\x2b\xf5\x9a\xee\xd2\x9a\x06\xa1\xec\x73\x1a\xa1\x2d\xe2\x1a\x3a\x36\xda\x04\xef\x4c\x09\x44\xd1\x5f\x52\xea\x70\xcc\x47\x51\xec\x37\xea\x34\x38\xde\xeb\xd6\xf6\x3b\x21\xe4\x9f\x26\xfc\x3f\x4d\xf8\x70\xa1\xb4\x5c\x2f\xb0\x01\x39\x2b\x31\x08\x02\x02\x65\x0e\x0d\x01\xfd\x90\x03\xc0\x44\x1a\x39\xc3\x19\x89\x7c\x3e\xcd\x74\x38\xde\xce\x69\xa3\x38\x3e\xf9\xc0\x05\x84\xf2\xee\xe8\xb8\xa4\xa0\xbd\x1e\xeb\xee\xc6\x46\x7e\x45\x17\x73\xe0\x71\xb3\x84\xc3\xbf\xcb\x23\xc5\xfc\x1e\x0c\x16\x7f\xc8\x01\xe4\x51\x0a\xe3\x97\xf3\x46\x93\x28\x2a\x80\x67\xe5\x3d\x82\x80\x41\x55\xaa\x33\x7c\xe7\x8c\x75\x47\xf1\x28\x7f\xcd\x75\x9c\xe1\x72\x5a\x74\x2a\x08\x15\x92\x64\x4b\xb9\x7b\xb6\x31\xfc\x28\xa1\x15\xb8\x6c\x65\x65\xb2\x6a\x10\xd1\xd5\xac\x33\xf7\x10\xab\x15\xaf\x38\x6b\x55\x70\x49\xe1\x07\x38\x57\x84\xb5\x15\xdd\x49\xb8\xdd\x90\xe0\xb2\x36\xd1\x3b\xa0\xea\x76\xac\x71\xf7\x78\x6e\x64\xb8\x15\x77\x0f\xda\xf5\x3f\xec\xe8\x03\x3e\x25\x45\x28\x9b\x4c\xfc\x28\xeb\xdc\xbd\x61\xb5\x00\xc1\x93\x0f\xea\x5c\x0c\x99\x60\x09\x8c\x86\x36\x4b\xf2\x9d\x91\x95\xdf\x8f\x1c\x5d\xa8\xe0\x0a\x28\x7a\x56\x78\x5b\x0c\xef\xba\xeb\xda\x5d\x8e\x99\xa7\x1c\xf6\x61\x66\x88\x75\x48\x2c\xfb\x01\x16\x04\xc5\x68\xd5\xb7\x84\xd6\xf5\x2c\x7b\xef\x34\x0f\x2f\xe0\xf5\x9f\x9e\x29\x6f\x25\xeb\xd4\x79\x5b\xb3\x1b\x72\x46\x4e\xa3\xef\x7a\xb9\xf9\x09\x51\xa0\xa5\xa6\x73\xca\x0d\x09\x1e\xd0\x96\x3c\xd4\xdd\xf2\x36\xd0\x2e\x1a\x92\xa3\x6d\x2e\x3b\x46\xaf\xb2\x2f\xef\xf3\x31\x63\x58\xe4\x73\xf2\xc5\x88\x05\x94\xcc\x61\x61\x7a\xcf\xa8\x5a\x86\x80\x82\xa7\x62\xe8\x2b\x4e\xbd\x6a\xaf\xd9\x56\x5c\xb3\x68\xe1\x7c\xc4\x5c\xb8\x74\xc5\x15\xea\x00\xc0\x84\x45\x82\xe7\x4d\x76\x7e\x29\xfe\x90\xed\x0d\x70\x9e\x89\xd5\x12\x43\xdb\xae\x8b\x01\x70\xef\x8c\xb4\xbc\x29\x99\x80\x01\x5c\x8b\x9c\xa1\x4b\xcd\x6e\xee\xcd\x8b\x66\x54\x44\x95\xdf\x31\x65\x6e\xa9\x06\x36\xf1\x77\x85\xd6\xd0\xd9\x51\xa9\xc8\xac\x61\x52\xe6\x26\x6e\xd5\x77\xe6\x95\x51\x3e\x8f\x94\x7c\x6b\xa6\xbe\x62\x2b\xd1\xb1\x99\xed\x14\x04\xe6\xb9\x0d\x9b\x4c\x14\x1e\x81\x51\xa9\x2e\x90\xbd\x1d\xef\x50\x62\x79\x3f\x78\x59\x79\x7b\xfe\x3f\xf3\xd3\xc1\x77\x41\x8c\xca\x82\xee\x76\xac\x0d\x36\x6d\x1e\x2e\x55\x8c\x47\x23\x6e\xbf\xc0\x23\xde\x6f\x84\xcb\xf8\x41\xaa\x0d\xab\xae\xc8\xaa\xef\x20\x32\x52\xf2\xb6\x62\x56\xa0\x70\x27\xe5\x8f\x6c\xb1\xf7\x89\x1a\x09\x51\x50\x31\xe6\x25\x5e\x78\x0a\x83\x9b\xb8\xdf\x8e\x01\x0b\xc0\x05\x71\xc2\x1a\x80\x6b\x72\x92\x10\xbf\xc9\x6c\x48\x57\xd7\xc3\x13\xd2\xe0\x56\x9c\x4b\xe8\xc9\xea\x13\xb2\xa2\x9a\x2c\xe6\x8a\xbc\x83\xc7\x5f\x1c\xb7\x6a\x34\xdf\x6c\xa8\x2c\xf2\xcd\x57\x42\xa4\x9b\x23\x8c\xfb\x0a\xf6\x47\xc3\xda\xb5\xda\x90\x47\xe4\xd4\x07\x07\x0f\x5f\xbf\x3b\xfd\x3e\x58\xfd\xb1\xad\xa2\xf7\xc3\x7e\x23\x1a\x36\xe5\x70\x0a\x59\xff\x49\xd3\xcc\xca\x8c\x8e\x23\x5d\x76\x7d\xb8\xf7\xda\x61\x5a\x03\x13\xb5\x33\x64\x07\xb0\x6f\x50\xc3\x84\x06\xce\xc9\x41\x87\xec\x29\x6a\x48\xee\x89\x24\x16\x80\x8c\x04\xee\x99\xa8\x1f\xca\x85\xc4\x45\x69\x05\xc3\x1c\xa2\x27\x6e\xdd\xc3\xf4\x9d\x49\xca\x4d\x49\xf6\xac\x69\xf4\xff\x87\xfc\x19\xfe\xe8\x57\x54\xb1\xd1\xb4\x04\xf1\xa3\xfe\x44\x85\x68\xd9\x8d\x3a\x7f\x16\x3f\x6d\xd5\xbf\x45\x51\x0e\xe7\xcf\x6c\x90\x1c\x95\x92\xaf\xdb\x24\x95\x05\x78\x85\x74\xbf\xf3\x67\x9a\x60\x5b\xd1\x0a\x25\x5a\x9b\x2c\x93\xb7\x55\xc7\xa8\x74\x2a\x50\xe0\x35\xb2\xcf\x72\x0e\x26\xea\x63\x24\x46\x25\x88\x67\xa4\x9d\x45\x18\xbf\xd9\x8f\x23\x07\xf4\x9a\x6d\xe9\x2e\xb9\xbd\x27\xe7\xcf\x20\xe4\x2f\x7d\x78\x2b\x6d\xda\x8b\xd1\xc1\xc3\x01\x96\xe4\x9d\xc1\x61\x99\xc2\x4a\xdf\x1d\x34\x42\x69\xdd\xaf\x67\x31\x4e\x81\x94\x10\xee\x05\x1c\xb7\x71\xe3\x09\xbe\x90\x53\xd3\xc6\x74\xc5\xf1\x7c\x47\x10\xd6\x63\xff\x2f\x3d\xb4\xc6\x16\x76\x52\x64\x49\xfb\x19\x58\x6b\xfd\x3d\x86\x3a\x2c\xd8\x10\x3d\x88\x4d\xc0\xfe\x32\x84\xd6\x01\xc6\x11\x28\x8b\xae\xd9\x57\x1b\x2a\x4d\xf8\x99\x0f\xfc\xf0\xcf\x5f\x91\xe8\xa9\x7c\x4a\x6f\xa5\x33\xff\xf0\x79\xb9\xe9\x24\xb3\x49\xd5\x6e\x9b\x50\xf5\x88\xd2\x5f\xc6\x24\xd1\xce\x97\x99\xbe\x0e\xfd\x23\x1c\x70\xe7\xf9\x15\x63\x3b\x23\x7d\x2a\xd1\xd5\xa5\xd0\x1e\x60\x85\x1e\xd4\x67\x3a\xc1\x4a\x43\x71\xc6\xba\x69\x29\x0b\x04\xfb\x3e\xa6\x97\x8d\xf3\x8d\xdf\xbe\x3b\x59\x56\x48\xfa\x85\x64\x80\x18\xc4\x64\x14\xb6\x4b\xfc\x73\xe3\x36\x8c\xbf\xb5\x6f\xe7\xc5\xbe\x1d\x5e\xf7\x46\xfe\xe2\xf2\xd4\xac\xd7\xf8\x5d\xe2\x36\x2e\x24\x3a\x2a\x5b\x35\x56\x26\x9e\x25\x7a\x76\xd1\x70\xd6\x9a\xd5\xa9\x16\xcc\x8e\x8a\x61\x2f\x44\x39\x8f\xbb\xbe\xc3\x9e\xbc\x44\x3c\x3e\xd2\x08\xf6\x76\xe9\x7b\x6a\x3c\x9e\x65\xfc\x99\x3c\xff\x8c\xfe\xf1\xe0\x97\xe4\x19\x5b\xc1\xab\x0f\x10\x03\x6e\x03\xeb\x9d\x6d\x53\x12\x37\x42\x5c\x99\xc7\x29\x6a\xc3\xe5\xf2\x93\x4c\xd3\x1a\x5e\xec\xbc\xd1\x20\x66\xbf\xfe\xf2\x8a\xb1\x5c\xed\xfb\x9f\xff\xfe\xbf\xff\xf3\xdf\xff\xe7\xe3\xfd\xdf\x7f\x21\x23\xfc\xe7\xad\x46\xf9\xaf\xa8\x67\x01\xdc\x7f\x9a\x5b\xee\x6f\xdb\xe6\x60\x7f\x0b\xbf\xeb\x6f\x4b\xf2\xeb\xd3\x2b\x06\xf1\x64\x45\x18\x84\xfc\x0a\xda\x10\x04\xc6\xec\x57\xa7\x41\x14\xef\xe7\xe4\x8b\x53\x1b\x6c\x8c\xd1\x50\x83\xfb\xef\xc9\x33\xfc\x7f\x61\xcf\x0c\xda\x4f\x77\x58\x13\x47\xb3\x9f\x50\xdc\x7e\x22\x4e\xe3\x7a\xa5\x75\xd0\x60\xaa\x79\xfb\x9f\xcc\xe4\x35\x05\x3f\x37\x1e\xc2\xf9\x84\xf6\xfa\xef\x0b\x84\x94\x78\xfb\xe9\x94\x8a\xe9\x85\xcf\xee\xee\xbc\x65\xe6\xb7\x24\x5f\x7c\x69\x19\x85\x94\xd9\xcd\x46\x0e\x00\xc3\x65\xac\xf2\xe5\xed\x38\x45\xf7\xfe\xd2\x11\x2b\x85\xf6\x33\x73\xd7\x6d\x29\x56\xa6\xa4\x86\xf4\x52\xec\x97\xe4\xcb\x63\xdb\xec\xa5\xd8\x93\x19\x5f\x11\xb9\xa3\x15\x83\x97\x7a\x73\xff\x6d\x36\x68\x55\x90\x8d\x5d\xb4\xcd\x61\x8c\x6e\x24\xa2\x5d\xf0\xed\x83\xe9\x56\xa6\x27\x0e\xfd\xc3\x21\x47\xa3\x44\x23\xfc\xf2\x41\xee\xa5\x91\xa5\x3b\x25\x7d\x5a\x9e\xfe\xe9\xf4\xf4\x34\xeb\xb2\xe1\xeb\xcd\x2b\xfc\x8e\xc9\x77\xfd\x15\xde\xd5\xbc\x7f\x38\xd6\xf9\x4b\xe8\x8b\x79\x97\xe1\xd2\xf8\xcc\x5e\x27\xcf\x32\xf2\x15\x6f\xdf\x7e\xf3\x9b\xdf\xfc\xe6\x24\x6f\x5e\xb8\x7f\xfb\xe2\x34\x6f\x5b\xb8\x7f\xcb\xc8\x97\xf7\x2c\x5d\xc7\xa1\x2e\x91\xe8\xbe\x65\x59\x26\x75\x3e\x4c\xd4\xdb\xc9\xa0\x11\x7a\x1f\x81\x00\x7b\xf0\x34\xf7\xb4\x1c\x9b\x9f\xbb\x37\xfc\xa0\xd9\x91\xcf\xa7\x10\xf6\xb6\x33\xbe\x03\x54\x23\x89\x32\x56\x2e\x50\x22\xb9\x0c\xfd\xf5\x02\xe1\xa3\xe2\x6d\xe8\x14\x82\x7d\x71\x8a\x81\x44\xe9\xf0\xe5\xd1\x96\x30\xb7\x5f\x2d\x26\xcd\x2c\xbf\x8b\x3d\x5d\x7c\x99\x37\x1b\xb9\x8c\xfd\xe2\xf4\x14\x41\xa8\x70\x21\xfb\xe5\x29\x88\x8f\x13\xf2\xe0\x01\xf9\x3a\x7e\x64\x70\xab\x37\x05\xf9\x30\x18\x66\x5f\x9e\x86\xe3\x14\x5e\x08\x8c\x0d\x51\x74\xb8\xff\x8e\x69\xf5\x9a\x54\x62\x77\xf0\x79\x4d\x8d\x09\x66\xad\xaf\xf0\x79\x25\x6a\x7f\x45\xe0\xd2\xb0\x9e\xb8\x8a\x04\x39\xf6\x60\xd4\x4a\xcd\x39\x62\x50\x8d\x38\xe3\x0c\x5a\xa5\x19\x4a\x98\xe1\x24\x0b\xf2\x38\xda\x61\xa6\x64\x9f\x34\xc1\x62\xdd\xb2\xfd\xd3\x92\x39\x88\xda\x7c\xfe\xb0\xf0\x3d\xa3\x36\x6c\xcb\xf3\x3c\xd2\x85\x49\xae\x99\x0a\xd3\x20\xb8\x47\xbb\xc9\xc2\xee\x58\xc5\x57\x1c\xc9\x6b\x77\x74\x61\xf0\xcc\xae\xf3\xcc\x0d\x35\xf6\xc0\x37\x64\xd6\xef\x78\x5d\xbc\xb9\x33\xb9\x7d\xc2\xe9\x98\x5f\x24\x96\xee\xe7\xae\x73\xca\x06\x89\xa7\xf5\xd9\xb4\x79\x7d\x76\xab\x89\x69\x06\xc7\x4c\x79\x7c\xb5\x70\xaf\x0d\x7a\xfb\x55\xd8\x4c\xc8\x58\xc6\xbd\x6d\x5c\x06\x63\x3b\x0a\xe9\x3a\x8d\xf5\xe4\x0b\xd1\x69\x0b\x7c\xd5\xd1\x2d\x0b\x66\x56\x73\xe3\x85\xee\x0e\x99\xdc\x1a\x32\xa0\xec\xb9\xda\x80\x14\x0b\x56\x55\xeb\xc6\x1d\x6d\xd7\x2c\x4e\x5f\x27\xba\x35\x6d\x21\x65\xf7\xe5\x21\xcc\x84\xdd\x06\x91\xbe\x90\x0c\x04\x08\x26\x11\x87\x6c\x9c\x56\xe3\x3f\x9e\xbc\xfe\xe6\xfc\x9b\xdf\x2d\xc9\xf9\x8a\x1c\x44\xef\x32\x7d\xdb\x9b\x48\x83\x81\xf7\xcf\x2b\x21\x48\x43\xbb\x35\x3b\x89\x5c\xec\x26\x31\x5d\xc3\xaf\xe0\x01\x29\xe5\xe6\xf2\x4d\x6c\x77\x0d\x0b\x12\xd5\x01\x8b\xb3\x8a\xc2\x9b\xc5\xac\x77\xd7\xb7\x44\xf4\xf0\x66\x75\x4d\xe5\x82\x40\x1a\x03\x5f\xe2\xc9\xa0\x21\xb7\xb4\x69\x22\xf4\x23\xe0\x36\x8d\xb4\x54\xb4\x53\x41\xe6\x96\x0b\x93\x25\xaa\x0b\xee\x01\xc9\x8c\xb7\xd6\x7c\x9b\x47\x1e\x51\x33\x10\x06\x95\xb5\x75\x02\x93\xb5\xf5\x1d\x21\x5a\x8e\xc3\x9c\xa9\x8e\x47\xdf\xbf\x5f\x92\x27\x21\xf3\x6c\xe9\x6e\x07\x2f\xf2\x23\x4f\xf6\x2e\xf2\x64\x17\x97\xbc\xbc\x6f\x72\x31\x17\x31\xf2\x2c\x25\xa6\x8d\xf3\x4a\xc8\xe1\xaf\xbc\x86\x29\x41\xc5\x8a\x70\x3e\xc9\xae\x4b\x3d\xfc\xe7\xad\x1f\x74\x1c\x4c\xe6\x7f\x8b\x1d\x69\x0f\xc8\x1f\x68\xc3\xf5\xa9\x41\x78\xbb\xeb\x15\x81\xe5\x63\x2a\x0d\xe7\xd1\xd6\x69\x34\x37\xf2\x28\x9a\x14\xfa\xd6\x0b\x96\xad\x80\x75\xd4\x7c\x1c\xc3\xd2\xb5\xf6\x4a\xff\x68\x65\x41\x2c\xe3\x63\x26\x22\x2e\xe5\x47\xd3\x0c\xee\x45\x73\x0d\xf9\xbc\xad\xdd\xbd\x7e\xea\x92\x5c\x20\x77\xdc\xe1\x8c\x47\xdc\x93\xd9\xe5\x75\x61\xe4\x9c\x66\xf1\xc5\x2d\x97\x61\x7c\x03\x6d\x1a\xe9\xa6\x2b\xfa\x0e\x99\x24\xc9\xa3\x40\x92\x45\x7b\x07\xea\x1a\x6f\x7b\x86\x04\x73\x64\x3f\x40\xf2\xe1\x61\xf9\x82\x7b\xa0\xb3\xc4\xcd\xfb\x9d\x1f\xf3\x7b\xf2\xf8\x71\xca\x72\x28\xf0\x28\xce\xe7\x22\xbf\xbc\x0a\xd9\x38\xe7\x62\x14\xa4\xa6\x7b\xf8\xe8\x1d\xc5\x7d\x71\xc5\x0e\xa5\xd0\x98\x64\xc2\xe7\xcf\xf4\x4c\x51\x28\xdf\xb9\x71\x4a\xf3\x75\x53\x74\xed\xf0\x4b\x8d\x3c\xf0\x61\x74\x82\x6e\x92\xbc\x4e\xa6\xa7\xcf\xa9\x91\x79\x91\xc0\x5c\x0b\x11\x71\x61\x0f\x1c\x71\xc5\x11\x34\xe0\x67\x14\x35\xbe\xc2\x47\x09\xee\xeb\xcb\xf8\xa1\xbc\xe0\xc9\xbc\xe8\xe8\xfe\x0f\xb4\xe9\xd9\xf7\x41\xf8\x21\xaa\x76\x8c\xe3\x3f\x81\x8b\xc2\x1d\x14\x4d\x43\x13\xf8\xf8\x5c\x0a\xf2\x2e\xdc\x21\x67\xf8\x00\xb7\x45\x76\x44\x6a\x4e\x94\xbd\xef\xd3\x67\xfe\x2e\x2f\xc2\x8a\x31\xad\x30\x55\xa2\xbd\x66\x1d\xa4\xce\xc9\x92\xb5\xc0\x4d\x5f\x98\x61\x5d\x89\x2b\xd6\x26\xea\x92\xd3\x06\x52\xbf\xd4\x45\x54\x4b\xc2\x42\x2c\x94\x83\x4a\x60\x0d\x99\x59\x2f\xc2\x87\x55\xd3\x3a\xd7\x81\x53\x03\x14\x1d\xfe\xa3\x2f\x15\xf4\x91\xab\x68\x38\xb5\xc5\x9d\xcd\x17\x26\x7d\x43\x42\x2e\xaf\x2b\x76\xec\xcf\x3d\xef\x86\xcc\x6b\x13\xd2\x54\xc7\x6a\x89\x5f\xbc\x17\x8c\xcd\x4a\xe9\x69\xb1\xbc\xb6\x11\x51\xbc\x6a\x62\x4b\x02\xbc\x4b\x0f\xe3\xb7\x56\x1d\x15\x70\x25\x4d\x9b\x21\x87\x9c\x43\x20\xf5\x29\x68\xa1\x7a\x49\x25\x33\x59\xdc\x7d\x6e\x2b\xad\xf0\xf6\x80\xad\x74\xca\x60\xe0\xb7\x5c\x9c\x9e\x20\x39\x76\x01\xa7\x74\x72\xf3\xb1\x8b\xc2\x07\xe4\x4d\x45\x1b\x96\x14\x2f\xb1\xec\xad\xe2\x97\xe2\x8e\xe4\x68\x9e\x5c\xf0\x30\x6b\x50\xb5\x77\xb2\x9a\x09\xb9\xa9\xfd\x32\x34\xd6\x0b\xa1\xd3\xc3\xa9\x71\xef\x93\x14\xcf\xa7\x51\x52\x92\x17\x2f\xbf\xfd\x0f\x94\x27\x5c\x5d\x4e\x24\xb9\x74\x96\x00\x38\xa8\xc0\x39\x10\x3f\xa8\x3b\xbc\xb0\x1f\x9f\xda\x82\xb1\x17\x42\x37\x98\x0d\xfc\x30\x42\x59\x67\x06\xe6\x24\xf9\x3c\x18\x73\xc4\x18\xfc\x06\x6e\xb2\x9f\xb4\xf5\x79\x5b\x75\xa6\xbe\x54\x98\x43\x0c\x02\x7d\xce\x9f\x99\xc8\x1c\xd7\xc2\xc7\xf2\x54\xa2\x6f\x55\x1e\x80\x6b\x22\x88\xad\x92\x9e\x0f\xa0\xad\x5a\xeb\x9a\xcf\x63\x13\xfd\xcd\x7a\x70\xcf\x9e\xfb\x62\xb0\x56\x59\xd4\xab\xab\x37\x14\xc3\xc8\x49\x90\x64\xe3\x2d\xd7\x13\x20\x78\x8d\xa1\xf3\x67\x18\x1b\x60\x05\x6a\x50\xc9\xe4\x12\xf0\x5e\x8c\xe5\x05\x3e\xc1\x72\x87\x72\x53\x82\x66\x25\xfa\xb6\x76\x09\x75\x8d\x10\x33\x45\xf6\x46\xd2\x3c\x86\x9e\x87\xa0\x6c\x8b\xf7\xa8\xe0\xd5\x61\x7c\x3d\xb5\x34\xf6\x8b\xcb\xf8\xc9\x62\xc0\x3a\x2e\xcd\xbd\xc6\x74\x20\xed\x81\x99\x48\x38\x28\xa3\xc3\xae\x59\x47\xd8\x0d\x97\x69\x28\x26\x5f\x69\x1d\xeb\xec\x8c\x04\xb1\x13\xe4\xa7\x9f\xf4\x8f\x8f\xe2\xb5\x2f\xda\x3d\x61\xb5\x29\x92\x27\x88\xf5\x4f\x16\x37\x90\xac\x9a\x36\x7b\x6d\x8b\xba\x95\xf1\xe8\x8a\x2e\xaf\xa7\x6a\x11\x04\x65\xd5\x87\x25\xe3\x8e\x2a\x5e\xa7\x1e\xc5\x00\x43\x75\xb3\x48\xaa\xc1\xe2\x78\x22\x94\xd7\x27\xa0\x77\x3c\x0d\xe5\x42\xa5\xe2\x4d\x03\x04\xdf\x75\x7d\xcb\x6a\x13\x94\x9d\xc2\x6b\xb8\x74\x7b\x7d\x00\x82\x60\xa2\x6d\xce\x92\x97\x69\xe1\x82\x7e\x66\xa3\x53\x4c\x32\xc5\x4e\x98\x68\xc6\x5e\x26\x6b\x19\x84\x7a\x0f\xd8\xea\x4f\xc3\xa3\x59\x5f\xef\x20\x05\x08\x39\x51\xf7\x5c\x9a\xa2\xdb\xb0\xd0\x43\x7a\xb3\x88\x7e\x3b\xea\x14\x20\x2e\x81\x40\x99\x7c\x02\x0c\xdc\x44\x06\x11\x84\x11\xe7\xbb\xd3\xef\x11\x6e\x7e\x94\x81\x38\x46\x36\x94\xf3\x72\xb2\x65\x75\xc0\xf4\xfa\x82\x0e\x65\x98\xc0\x46\x08\x62\xd9\x87\xb7\x7c\xbd\x51\x51\xd2\x3c\x0b\x93\x71\x08\x9a\xf6\x34\xf2\x15\x68\x19\x91\x82\xec\x9d\xcb\xd0\x55\x57\xc6\xc4\x6f\x9c\x1e\xbc\xe8\xf6\x77\xa5\xf2\x5d\xc2\xad\x8e\x6f\x69\x77\x20\xac\x55\xdd\x81\xec\x04\x6f\xcd\x4d\x4d\x54\x27\xac\x65\xfb\xa4\xd2\xc4\xe0\x84\xc8\x02\x6f\x17\x71\x94\xdd\xf9\x2a\x84\x55\x90\xac\x3b\x21\x25\xbf\x6c\x98\xa3\x43\xdd\x83\x27\x9b\xdb\xe7\xdd\xb4\x5b\xf7\xe6\x3c\x14\xfe\x5b\x34\x48\xdf\xd2\x6b\xca\x1b\x53\xf1\xb9\x11\x4a\x26\x1e\x48\x93\x16\x3a\xc2\x2c\xea\x7f\x11\xcc\x64\xe8\xa5\x85\xf9\xce\x1e\xc2\x2b\xe1\x8a\xfd\x7b\x64\x96\xc8\x59\xb5\x0c\x67\xb7\x24\x4f\x92\x3a\x36\x34\x2c\x3d\xe8\x75\x1b\xa3\x13\xbb\x87\xe0\xb2\x94\xaf\x3f\x9e\x32\xbc\x46\xb1\xaf\xc2\x17\x46\xb6\xba\x76\xae\x08\x0e\x6f\xaf\xc5\x15\xd4\x5a\x22\x49\x54\x85\x66\x51\xe3\x57\x35\xd5\xe1\x12\x7f\x12\x98\x06\x3b\x7a\x68\x04\xad\x31\x03\x67\x19\x56\x37\x7a\x63\xbb\xd9\x6a\x54\xb4\x6b\x38\xd3\x72\xa2\x11\xd5\x55\xe8\x82\x56\x64\xbf\xe1\xd5\x06\x63\x01\xd6\xf0\x35\x2c\x7f\x54\x79\x39\x9b\xef\xec\x6d\xcb\x6f\x02\x90\x52\x90\x55\x47\x6d\x18\x37\x91\xac\x12\x6d\x2d\x5d\xfa\x3b\x78\x04\xb2\x6e\x45\xc7\xea\xf9\x82\x9c\x0f\xd2\x4b\xc2\x0b\x97\x20\xb3\x28\x3e\xc3\xc1\x72\x78\xd2\x9a\xaa\xe7\x00\x98\xcc\x7e\xf8\x3d\x5f\x6f\x7e\x38\x21\x3f\x98\x0b\xdb\x1f\x4e\x34\x53\xfe\xf0\x52\xec\x7f\x98\xdb\x95\x6c\x57\x4d\xcf\xda\x2a\xce\x64\xae\x59\xe7\x92\x6d\xe8\x35\x87\x0c\x9e\x35\xa9\x99\x62\xdd\x16\xca\x81\xa6\x13\xdd\x88\x3d\x91\x42\x73\xa0\x4b\x21\x19\x15\xdf\x19\x2f\xad\x85\x4f\x27\x33\x2e\x9e\xd9\x52\xa4\x51\x5e\x45\xb0\x51\xa8\x25\xa8\x63\x55\x19\xa7\xc4\x4c\x53\xb0\x1b\xde\xa3\x8d\x14\x63\x53\xb2\xd9\xfc\x48\xb5\xa1\xdd\x9a\xd5\x0b\xf2\xb6\x35\xc1\xcc\x48\x52\x54\x53\x85\xd7\xe4\xfa\xc3\x67\x63\x2a\x8d\x3c\x21\x26\x13\xb6\xdf\x53\xc1\xdd\xac\xec\x7d\x0c\xb1\x06\x24\xcd\x9d\xc3\xb5\xa5\xa6\xb7\x34\xd2\xe1\x8f\xa5\x82\xb7\x32\x22\x0e\x60\xb1\xfb\xee\x29\xdd\x7d\x60\x2d\x97\xf1\x1a\x2d\x23\x05\xda\xc9\xc7\x2d\xe1\x92\x26\xab\xf6\x4d\xe6\x4b\xf2\xdb\x42\x85\xba\x92\xe1\xec\x4a\xc4\x0d\x62\x55\x09\x72\x1d\x39\xe1\x65\x76\xf8\xfb\x4e\xf6\xd4\x77\xff\xce\x03\x87\x0c\xc9\xf4\xff\xe6\x31\x0a\x01\xc1\x90\x6a\x4f\x39\xdd\x76\x28\xdd\x50\xda\x8d\xd5\x8b\x99\x67\xb4\x70\xd5\xfd\x86\x8b\xbf\xd6\x56\xac\x5b\x8d\x15\xae\x4a\xc1\xc8\xf4\xad\x95\x2f\x03\xe5\x6b\xe2\xe9\x3d\x9d\x76\x73\xb7\x6a\xc5\x71\xcc\x6b\x29\x7d\xbe\x99\x77\xb8\x8e\xcb\x53\xa5\xca\xad\x82\x2d\x2d\x67\xdf\xf7\x7d\xf6\xd9\xf0\x21\x28\x4d\x57\x7a\xfc\x67\x0a\xda\xc4\xa0\xb2\x07\x7f\xd1\x3f\xa9\x94\xac\x53\x24\x5f\x7b\xcd\xac\x8b\x4b\xda\x68\xa5\x49\xdb\x29\x1e\xa8\x2d\x9d\x77\x0f\x09\xf4\x31\x15\x02\xa1\x78\x4a\x28\x22\x80\xed\xb5\x16\xa0\x2d\x7a\x07\x12\xb2\x15\x85\x83\xcc\xbd\x7d\x35\x74\xb5\xbe\x8a\x48\xaa\x0c\x09\x76\xff\x38\xcb\x90\x9a\x27\xa7\x1c\x52\xd5\xe2\xd3\x31\x7e\xca\x9c\xf6\x6e\x93\x14\x7c\x00\x63\x9d\x9f\x99\x52\x4a\xc9\xad\x7e\x4e\x69\x6d\x5b\x45\x63\xe6\x94\xf5\xd5\x88\x06\x69\x88\xc4\xe2\x21\xc5\xaa\x72\xe6\x41\xd6\x6d\x6c\x9b\x7f\x8c\x0d\x9c\xf7\x30\x2c\x11\xae\xfe\xc9\x91\x5d\xfe\xcc\x64\xaf\x0f\x12\xd7\xda\x58\x0c\xd6\x5d\xf3\x8a\xe9\x13\x45\xb3\xc5\x2f\x6c\xf9\x89\xa8\x7b\x31\xd3\xbd\x4d\x89\x0f\x6e\x43\x97\x16\x1f\xca\x12\xc4\xc3\x43\x50\x8c\x97\xcc\x47\x17\x50\xaf\xf2\x82\xd7\x63\xb4\x4c\x5b\x67\x37\x13\xe3\xf2\x36\xe9\x9d\x2f\xfc\x84\x35\x4a\x81\x4c\x5c\xb3\xb4\x9b\xfe\x15\x41\x36\x3b\x8d\xbf\xdd\xb7\x9a\x7f\xd3\xee\x49\x05\xac\x29\x90\xd2\x7a\x76\x05\x90\x71\xb3\x23\xdc\xf5\xa4\xce\xad\x4a\xc7\x60\xc3\xab\x36\xad\x58\x9a\xe7\x3b\xc8\xd3\xc4\xdc\xbd\x47\xeb\xf0\x14\x9f\x69\x40\xf8\x86\x24\x0a\x02\x24\xb3\xa9\x1c\xf7\x98\x3e\xbc\x6f\x6a\x63\xa0\x35\x99\xa7\x48\x9a\xfc\xc6\x4a\x8d\x0a\x8f\x84\x8e\xee\xbf\xde\xe7\x05\x2d\x73\xd5\xc4\x5f\x2a\xc8\x58\xa0\x87\x17\x19\xe6\x59\xe8\x8e\x55\x2a\xd2\x1f\x83\x9b\x6b\x91\x98\x6a\x74\xac\xaa\x4d\x5e\x8f\x72\x10\x63\xc1\x13\xd4\x40\x45\x2d\x5a\xb1\xe7\x2b\x57\x91\xc1\x54\xe3\x1f\xcc\x66\xf3\x22\xde\x18\xd3\xc8\xb3\x30\xa4\x38\x2e\x99\xb1\xc5\x7a\x71\x82\x5a\xdb\x3c\x3c\x3a\x03\x9b\xc1\x5f\x6c\x75\x91\x41\x0e\x16\x27\x58\xe5\x73\x5c\x23\x8c\x80\x07\x2a\xd2\x78\x51\x64\x1b\x8f\x69\xa2\x99\x48\x2b\xda\xfb\x5a\xe1\x88\x0a\x01\x2f\x52\x2b\x84\xa4\x6f\x00\x8d\xdd\xcc\x9a\x9d\x24\x35\xbb\x66\x8d\xd8\xb1\x4e\x12\xd6\xca\xbe\x63\xa9\x0d\xe1\x1e\xce\xee\x3a\x06\x5e\x5d\x73\xc7\x62\x19\x21\xb0\xf2\xf6\xbc\xad\xc5\xfe\x24\xcd\xa6\x5f\xf7\x95\xf3\x80\x74\x5c\x5e\xe9\x73\xbf\x6f\x5b\xa6\xad\x0c\xda\x1d\x5c\xee\x72\x93\xba\xe4\x68\x14\xd3\xcf\x56\x0c\xdf\xc2\x57\x71\x30\x13\xc2\xa6\xa3\x37\x76\x1f\xeb\xfe\xf2\xe3\x5c\xa4\x5a\x49\x34\xca\x4e\xda\x9a\xcc\x23\x7c\x55\x5a\x5f\xfb\x24\xdc\xa7\xb0\x3b\x43\x7e\x1b\x37\x1e\x71\x23\xe6\xaf\x61\xf3\x85\xf6\xdc\xd4\xca\xe3\x86\x9a\x2e\x13\x49\xe0\x77\xb1\xfe\x96\xa1\x82\x17\x5a\x92\x1a\xee\xe6\x68\xcb\x15\xff\x31\xae\x1e\x66\x2f\x39\x0d\x62\x41\x42\x8a\xe4\x04\xe4\x2b\xac\xfb\xc3\x33\x88\xe8\x34\xf1\x4a\x5f\x35\xa2\xba\x9a\xcd\x03\x23\xa4\xe8\xf0\x1d\x9d\x74\x7e\x28\x85\x7f\xbe\xd2\x77\xcb\x1b\x3c\x4e\x1f\x59\xbb\xa3\x6d\x6d\x65\xf0\xa1\xce\xe7\xd0\xf7\x8f\xb3\x7c\xe2\x60\x88\x04\x29\x4e\x4e\xf2\x64\x26\xba\xe3\x08\x6d\x90\x4c\xa4\xee\x6f\xd4\x18\xd3\x66\x60\x92\xd8\xec\x51\x74\x13\x5c\x4a\xa0\xf6\x31\xd7\xe2\xf8\x1a\x4c\xa1\x7d\x4a\xf3\x54\xae\x68\x0a\xa6\x77\xef\xe8\x05\x9c\x73\x9f\x85\xc2\x76\x10\x4d\x3e\x61\xe8\x18\x79\x90\xe5\xf8\xb0\x65\xc0\x12\x08\x0f\xb7\xf1\x7f\xc7\x3b\xe3\xce\xab\xe4\x66\xff\x0b\x09\x4f\x3b\x4b\x0b\x34\x4e\xb8\x8f\xb8\x6d\x1e\xc6\xdb\x06\x4f\x1a\xf8\x8f\xbf\x4e\x43\x6e\xa6\xa8\x16\x16\x72\xc6\x27\x1b\x09\x25\xd8\x5d\xd7\xc7\x15\xf9\xf6\xa9\x02\x8b\x06\xf9\x9a\x29\xdd\xe8\xdb\x15\x78\x4a\xea\xcc\x06\xe2\xab\x10\x50\x26\x1b\x83\x7c\x84\x7f\xfb\x12\xd1\x17\x34\xd2\x8b\x17\x84\xc9\x8c\x4a\xc1\xa1\x0a\x12\x26\xfc\x86\xf9\xcf\xbf\xfe\xea\x96\x42\xcf\x56\x22\x1c\xae\x82\xc7\x22\xc0\x52\x67\x01\xe6\x26\x8a\x42\xc1\xc2\x30\xa0\x5c\x75\x41\x8b\x53\x47\x58\x20\x35\x62\xc7\x2c\xd7\xfc\x50\x47\x2c\x5d\x0c\xe7\x8f\xea\x9c\xe6\x2b\x74\x6a\x25\xe7\xed\x3f\x9a\xf0\x19\x3b\x24\x06\x03\x36\x78\xc0\x58\xb0\xd9\x17\x77\x3f\x16\x86\x82\xf5\x67\xd1\x0b\xcf\x9f\x97\xfa\xda\x94\x99\x4a\xfd\x29\xbe\xbb\xb1\xc5\x18\x9e\xaf\x3c\x35\x7e\x86\xc1\x01\x20\x3a\x48\x06\xf0\x0a\xbb\x95\x58\x68\x63\xef\x10\x5c\x66\x57\x4d\x5f\x07\x55\x21\x21\x42\xc5\xdc\x32\x1b\x1f\xc0\x10\x01\x00\x79\x05\xc2\xf2\x7b\x1f\x71\xc9\x26\x2d\x42\x44\xe7\x23\xb4\x74\xf4\x6a\x79\x53\xf4\x56\x8d\x08\x99\xd4\x67\x85\xdc\xb8\xc7\xfe\xa7\x04\x70\x1b\xb9\x7d\xe0\xa6\x5c\xd1\x2b\xa6\xcd\x0b\x25\x9c\xcf\x3a\x2e\xea\x80\x04\xe1\x65\x39\xa6\x14\x62\xa8\xc7\xee\x98\xfb\xce\x5f\x95\x04\x03\x6c\xc2\x72\x25\x10\xd4\x16\xc6\x49\x06\xef\x4c\x5c\xae\x3f\x2e\x09\x6b\x45\xbf\xde\x64\x97\xce\x86\x11\x44\x07\xd2\x2c\x6c\xdf\x8a\x20\xf9\xc4\x34\xb4\x6c\x01\xc8\xf4\xbe\xce\x06\xfb\x18\xb0\x03\x4c\xc7\xa5\x98\x7f\x2f\xc1\x32\x99\x20\xc6\xaa\x16\x25\x87\xbb\x72\xf3\x85\xf1\x80\x44\x2b\x0e\x77\xdc\x3e\x63\x9c\xa7\x12\x6c\x0d\x68\x77\xd4\xa7\xf4\x8f\xe8\xf3\x31\xde\x85\xc7\x06\xc8\x84\x60\x94\x74\x3f\x9c\x1c\xe5\x1e\x5b\xd8\x31\xe2\xda\x5b\x3e\xba\x9d\xac\x42\xe4\xde\x20\x72\xcc\x1d\x44\x6e\xeb\x0f\xb2\x14\xc3\xf2\xc2\x42\xc0\xc6\x19\x96\x16\x2b\x78\xed\x91\x3a\x8c\xf8\x4a\x73\xec\xc6\x66\xd1\x1c\xfc\xcb\x70\x73\x1d\xbe\xf8\x3a\x21\x7b\x78\xdd\x3b\x04\x62\x51\x35\xf8\xb2\x71\xaf\x12\x5f\x59\xa4\xac\xc2\x92\x2b\x47\x2e\xf6\x13\xed\x3e\xf2\xa2\x04\x1e\xd0\xf9\x13\x65\xb8\x61\x7d\xd3\x08\xf5\xc4\xfd\x6e\x26\x3f\x43\xe3\x0c\x10\xdd\x6d\x8e\xd0\x06\x98\x4a\x26\x1b\xda\x12\x42\x99\xb2\x20\x50\x78\xf5\x76\x44\xc9\x6c\xcd\xb3\x60\x32\xe5\x00\xd9\xdb\x12\xa9\xa4\xbe\x40\x2e\x2e\xf4\xb5\x5f\xbc\x4d\x6a\xb6\xa5\x5a\x6e\x85\xc1\x86\x8a\xb0\x1b\x5a\x85\x22\x4c\x74\xf0\x6a\x38\xcc\x01\x98\x20\x7e\x3c\xf6\x78\x7c\xfb\x16\x64\xfb\x9e\x11\xc9\x68\x57\x6d\xa0\x11\x08\xd6\xf8\x56\x23\x27\x16\xd4\xf9\xac\xc5\xd2\x06\x68\x6c\xc4\x9e\x5c\xf2\xb5\x7d\xb8\xde\x34\x52\xd1\xea\x0a\xd6\x76\xdd\xd9\xab\x24\xbe\x82\x71\x6c\x58\xf4\xb5\x80\x22\x7f\x55\xdf\xc9\xf4\x5d\x89\x07\x3d\x34\xef\xd8\x8a\x56\x0a\x64\x32\xb7\x07\x76\x23\xc4\x4e\x9e\xf8\x98\x0f\xcd\x49\xd0\xd4\x05\x8e\x18\xd8\x8c\x7c\x71\x7a\x2a\x7d\xe6\x48\x4c\xc1\xf9\x20\xe3\x66\x58\xbc\xcf\xcd\xdb\x96\xbf\x88\x65\x83\x2c\xbf\xcf\x9c\x99\x69\xf3\xe1\x99\x5b\x2c\x88\x3c\xf4\x32\x52\x7e\xcd\xaf\x59\x5b\x78\x57\x3f\xf5\x11\xc0\xb8\x00\x71\x72\x3d\x17\xe5\xe1\x63\x8e\xbf\x15\xaf\x7c\x90\x59\x58\x6d\x98\xe8\x98\xe2\x15\x6d\xbc\x2b\xc0\xc5\x14\xa5\x2f\x8d\xac\x32\x0f\x71\x7a\x90\xd7\x27\x43\xca\xb5\xf4\xa5\x26\x26\x7b\xe8\xca\xd2\xca\xdc\x90\xba\xc3\xc8\xe7\x3d\xad\x1a\xca\xb7\x01\x92\xa3\x2a\x9b\x85\xe3\x04\x26\xc4\x90\x36\x8d\x65\xa0\x54\x36\xde\x43\x4e\x4a\x1f\xc8\xff\xef\xec\x80\x3a\xf6\x8b\xd2\x39\x22\xc9\x11\x71\xe7\x16\xc5\xa5\x05\x10\x2b\x10\x45\xdb\xbe\xda\x38\x16\x8f\xf2\xbe\xa6\xfd\xb3\x0a\xd0\x71\x62\x58\x9c\x8f\x1a\xa1\xe2\xec\x4d\xf2\x6d\x59\x61\xc8\xa7\x8e\xbc\x11\x73\xd3\x18\xb2\xe9\xf9\xb2\xe9\xe5\x1a\xd5\x24\x48\x76\x36\x14\x1b\x29\x33\x50\xa1\x60\x4a\x06\xcf\x1c\x12\x77\x82\xe8\x4b\xab\x60\x13\x1c\x5d\x98\x89\xf3\x74\x84\xc6\x97\x20\x99\x1a\x79\xfc\x98\x94\x12\xbc\x4d\x05\x64\x67\x64\x40\x21\xbb\xcc\xbc\x8f\x09\x4f\xd3\x13\xc7\xc7\xfb\x0d\x55\xe6\x21\x92\x0f\xf8\xed\xd8\xd6\x5c\xb8\xa6\x90\xfa\xb6\x66\x1d\xf9\x12\x32\x4a\xc9\xfe\x12\xc4\xa9\xbb\x97\xb5\x37\x5e\xcd\x21\xca\x8a\x9c\x06\x54\x7e\x80\xbb\xc5\x67\xcc\x6b\x7a\xf9\x75\x48\x1d\x4f\xf1\xcf\x03\xaa\xa1\xdd\xd5\x50\xc5\xe7\xb5\x9b\x63\xc2\x3a\x58\xb1\x9f\x85\xa4\x0a\x92\x31\xb5\xeb\x37\x76\xd6\xb3\x1c\x93\xfc\x0d\xbb\x1e\xb2\x11\xfb\x7c\x40\x14\x8f\x87\x89\x94\x7d\x8c\x37\x5b\x8e\x48\x9e\x60\xd0\xa9\x9c\xf3\x52\xec\x11\x0e\x24\x83\x9c\xcb\x27\x80\x91\xc3\x8e\x58\xaa\x14\x41\x0a\x79\x35\xfc\x66\x33\xe7\xce\x5d\xf6\xdc\x83\x07\xe4\xb9\x89\x0f\x31\xa7\x85\xec\x1b\xe5\x42\x68\xe1\x51\xdb\x8f\xac\x13\x5a\x97\x84\xc0\x3d\x7e\x9d\x27\xe6\xd0\x4b\x69\x32\x12\xea\x29\x04\xe9\x13\x1d\x63\x95\xd6\xdf\x0a\x96\x3c\xa4\xd3\xb0\x21\x0a\x73\xe0\x50\x0c\x6a\x24\xd4\xa6\x1d\xee\xc0\x24\x8e\x7e\x56\x73\x72\xc5\xa6\x87\x84\x33\x19\x8a\xd0\xcd\xa6\x9d\x3d\x23\xb3\xbb\x6e\x01\x87\xea\xfc\x03\x66\x33\xa8\x7b\x31\x17\x0c\x12\xc5\xeb\x7d\xe8\xda\x0d\xdb\x70\xa0\xb8\x5d\xbd\xe0\x87\xcf\xb3\x55\x49\xf1\xd9\x75\xec\x9a\xb5\xca\x48\xb9\x55\x23\xf6\xf9\x99\x0a\x7d\x9f\x04\x76\x68\x40\xc6\xe3\x52\x62\x18\x3a\x27\x06\xd8\x98\xee\x09\xf6\xa0\xe7\x5e\x1e\x86\x87\xed\xda\x1c\x1b\x9c\xaa\x11\xa9\x22\x7f\x9f\x85\x48\x6b\x1b\x22\x75\x20\xbd\x79\xdc\x11\x9d\xd6\xa0\x53\x17\x4f\xb1\xee\x16\xe7\x6a\x41\xd9\x0b\x5d\x14\x05\x29\x14\x65\x31\xc9\xcf\x40\x83\x76\x9e\xd6\xd4\x22\x87\x11\xbc\xcf\x84\x50\xe6\x39\x48\xd6\xf0\xf3\x78\x98\xb2\xc8\xb2\xf2\x30\xe7\xc5\x50\xdf\x7b\x60\x08\x8f\x85\x85\xa6\x11\xa1\x43\xba\xbf\x38\x2c\x34\xac\x67\x01\x71\xc4\xb4\x25\xc0\x98\xa9\x41\x33\x3c\x37\x47\xe3\x46\x9d\xe9\xe2\x42\x45\x93\xa8\xf2\xac\xd4\x50\xac\x8f\x0f\x01\x2d\x06\xef\x95\x33\x6b\x35\xf0\x13\x48\x11\xcf\x69\xc3\x7f\x64\x3e\xe4\x35\xbb\xc8\x8a\x53\xf4\xe8\xff\xfa\xbe\x7c\x95\x85\xb7\x26\xef\xde\xe7\xa9\xd3\x5d\x9c\x20\xbc\x71\xda\x32\xea\xd2\x58\x68\x44\x42\xdd\xc3\x96\x0c\x88\x30\x37\x0f\xaf\x21\xb8\x92\xb5\xc1\x2c\x72\x7d\x01\xd5\x92\x1d\x56\xe8\x5d\x45\x92\x63\x74\x6a\x82\xd1\x49\xe9\x45\x91\xe4\xa2\x39\x61\xf0\x44\x52\x49\x35\x30\x3d\x87\xd1\x1b\x15\x1f\xdc\xcc\x65\xec\x74\xaf\xc3\x00\x67\xd4\xde\x70\x39\xf7\xb1\xc5\xbc\x97\xf2\x47\x68\x57\xfa\x8e\x43\x46\xa7\x9b\x28\xcc\x3d\x4d\x03\x48\x02\x9f\x45\xd4\x81\xd7\x90\xe0\xe6\x06\x8b\x50\xcf\x09\x56\x1e\xee\x2c\x06\x1f\x13\xac\x54\x8b\x69\x14\x5e\x21\x5f\x8f\x43\x7b\x39\x15\xe9\xb4\x46\x53\xf4\xcf\xc2\x36\xf2\xbf\x14\xe3\xd8\x33\x8f\xbe\xdf\x36\x88\x28\x33\x3a\x87\xb3\x41\x35\xf0\x5f\xc8\x91\xbc\x25\x8d\x50\x56\xea\x97\xac\xcf\x9c\x41\x4c\x41\x9b\x7d\x7c\x6a\xd8\x99\x58\x60\x19\x91\xef\x91\xcf\xa7\x10\x71\x0c\x84\x49\x73\x1a\x8f\x8a\xe1\x15\xe8\x47\xc1\xc1\x94\x17\xd0\x0b\xf3\x81\x05\xe3\x96\xb2\x65\xc5\x90\x0d\x32\xc1\x0f\xc1\x89\xf7\xa4\xae\x67\xe1\x44\x82\x98\xa8\x11\x1d\x7c\x4c\xa8\x05\xd0\x46\xf5\xf6\x6f\xac\xeb\x72\x27\x14\x6b\xb5\xf8\x6c\x0e\xfa\x44\x76\x0e\xf1\xf2\xb3\x36\xa8\xfb\x78\xc5\x48\x27\xc4\xd6\x33\x4f\xf2\x96\x3d\x3b\x91\x14\xeb\xcc\xeb\x89\x0e\x3c\xf2\x6a\xc3\xb6\x70\x86\x5a\xe1\x6e\xae\x8d\x44\x6b\x9e\xf7\x04\x68\xf4\xad\xe2\x4d\xc0\xac\x83\x75\x1b\x47\x38\x35\x99\x11\x65\x0d\xa8\x30\xa3\xc1\x85\x78\xed\x21\x8f\x65\x4f\xe3\xab\x74\x05\x1f\x1d\x35\x2e\x0b\x96\x6e\x23\x3c\x17\x26\x05\x55\x86\xdd\x1d\xd7\xe8\xcf\xc0\x0c\xa9\xda\x0a\xc0\xc6\x72\xb6\xe5\x53\x79\x78\xdc\x50\x1e\xc9\xaf\x86\x97\x74\x24\xc5\x2c\x6f\x23\x2b\x70\x2c\x6d\xdc\xf4\x4d\x14\x9a\xaf\x18\x81\xbe\xe3\x75\xba\x9f\x72\x8c\xf3\xe3\xf3\x8d\xaf\xfa\x1e\x9d\x9f\xd9\x13\x00\xa8\x0e\x95\xef\xcf\x28\x51\x2f\x72\xac\x21\xee\xe6\x09\xbb\x0f\x16\x94\xd5\x89\xa6\x63\xeb\xe4\xba\xfe\x2f\x71\x3a\x58\x8d\xd2\xa8\x7e\x71\xa5\xaf\x91\x75\x2a\xde\x00\x1c\x1d\x2f\x68\x21\x6f\x23\x50\xb2\xd4\x18\xd1\xb0\x2e\xe3\x2c\xcc\xe5\xc2\x3d\xd4\xf2\xaa\x63\xf6\x04\x77\xb0\x3f\xc3\x6b\x52\x0c\x64\x4c\x92\x8b\x14\x58\x24\x99\xca\x5a\xfc\xd4\x65\xf0\x8a\x3d\x9a\xd3\x31\x75\x59\xa3\x09\x1b\xb1\x5d\x3f\x31\xa1\x0f\xba\xe5\x1e\x3f\xb6\x0f\x89\x7d\x94\xd1\xf9\xb3\x25\xf9\x23\x64\xc7\x09\xf7\x80\x4f\xdb\xf4\xe9\x5c\x33\x6e\xd5\x71\xe3\xc4\xb8\xec\xd7\xb9\x3a\x5b\x7c\x68\x4c\x40\x6f\x5a\x94\x7c\x87\xb8\x3e\x1d\x3e\x35\x2e\x04\x42\x05\xc7\x47\x9a\x5e\x45\x93\xd0\x4c\xc7\x5d\xe5\x0d\xd9\x9d\x42\x06\xc5\x42\x28\x6f\x3d\x31\x3c\x04\x10\x76\xdf\xc4\xa9\x05\xef\x79\x3f\x6c\x6e\x49\x80\x00\x23\x92\xda\xd7\x63\xae\xdc\x62\xb2\xe3\x8e\xc5\x90\x92\x52\xa6\x57\x2d\xa4\x3f\x28\x98\x93\x24\x61\x72\x1a\x47\x73\xdd\x89\x36\xcd\x6f\xf4\xca\xbc\x93\x3f\x85\xbd\x39\xaa\xa6\xcf\xef\xe5\x0b\x0f\xb9\x14\xdc\xa9\x84\xc0\xc0\xf7\x64\xf6\x3e\xdc\x0a\xed\xad\xb8\x66\xe1\x06\xf5\x6f\x42\x6f\x10\x9e\xd3\xc7\x92\x3d\xed\x6e\xa1\xef\x0f\x55\x8d\x47\x74\x7c\xf2\x21\x7a\x3e\x49\x14\xf2\xd8\x31\x7d\x56\xfe\x76\x0f\x3b\xc7\xcd\x5c\x72\x8e\x9b\xaa\xf7\x62\x64\x7b\x3b\xbc\xdf\x0d\x48\xf3\x8b\x30\x78\x26\xbe\x81\xa6\x35\x24\x24\xbb\xa4\xd5\x55\xfe\x24\x38\x1b\x21\x7b\x9a\xcd\x14\xc2\xed\xe1\xee\x58\x46\x7b\xa5\x30\x59\xd4\x25\x14\xf6\x9b\xf8\x86\xb8\x58\xed\xd9\xf0\x5f\xa6\xe5\x44\x1c\x63\xa6\x9c\xdd\xc4\x87\x47\x5e\x89\x89\xd3\xd2\x06\x79\x11\x07\x2c\x24\x2a\x4d\xc4\xe0\xb5\x27\xd4\x28\x1d\x1a\xe4\x12\x77\x0c\xb4\x8f\x8f\xf5\xfd\xfd\xbe\x48\x55\x33\x47\xa5\x80\x42\xe2\xf2\x7f\xb3\x2a\x37\x39\x82\x26\xdf\x42\x0b\x5f\xf1\x3b\xd4\xd8\x6d\x6d\xee\x2b\x76\x48\xde\x65\xcf\xc7\x6f\xda\xd7\xb4\xbb\xa4\x6b\xe6\x0a\xaf\x98\xf7\xbf\x59\xf4\x50\x82\xc7\x98\x3b\x27\xa5\x3e\x29\x3b\x75\x52\x88\xdf\x21\xa4\xc4\xfc\x3b\x24\xf7\xf1\x84\x33\x06\x5b\x3d\x89\x34\x0a\x30\x89\x7a\x46\xc9\x93\x21\xaf\xe2\x48\x26\xe8\x04\xdd\x12\xcd\x5f\xa1\x61\x64\xee\x6f\xb4\x5e\x37\x36\x0c\x4e\x95\x31\x37\x94\x1f\x2a\x5f\x09\x52\x76\x05\xa5\xe3\x4e\x71\x2c\x0e\x59\x18\x61\xdb\x80\x6e\xb0\x27\x6c\xbb\x53\x07\xc7\xe1\x5c\x0d\x5b\x7f\x4b\x77\x79\x36\xe9\x38\xbb\xe1\xad\x56\x25\x9e\x49\xb4\x1e\xb9\x37\x33\xeb\x14\x04\x7b\xe4\x3d\x47\xba\xa6\x7e\xd4\xbc\x66\x3f\x3e\xf8\xa8\x75\x98\x67\xc6\xfe\x36\x16\x07\x89\x94\xd5\x86\x2e\x6f\xd7\x66\x2b\x99\xcc\x0d\x92\x50\x93\xe3\x30\xad\x50\xe2\x8b\xed\x77\x8c\xd6\x87\x38\xad\x4d\x1c\x54\xfd\x42\x74\xa9\x5b\xef\x12\xed\x16\xa6\x99\x1c\x82\xd2\x43\x58\x11\xdc\x0b\x7f\x5d\xe0\x4b\xcc\xe7\x85\x4f\xd4\x86\xb5\xfa\x57\xaf\xbe\xc3\x2d\xd9\x89\xbd\x9e\x3b\xd1\xea\xf4\x7c\x51\x00\x0b\xaf\x0f\x6c\xc8\x4e\x3c\x79\x60\x3e\xac\x4c\x83\xc9\xb5\xe0\x9f\xe6\xc6\x90\x5f\x16\x6d\x4b\x18\x49\xb4\xcd\x01\x8a\x7b\xd7\xf0\xd2\x21\x8c\x70\xb7\xf7\x6e\xfe\x1a\xc9\xe5\x5f\x6c\x84\x5a\x64\x49\x0d\x7c\xbe\x48\x93\xb3\xce\x46\x35\x9b\xfd\x13\xd5\xc8\x6f\x45\x8c\xc5\xe8\x4a\xda\xd3\xf4\x95\xa9\xc9\x6c\x0e\xd4\x90\x5f\xa0\x8a\x4e\x7a\x8e\xa6\x82\x56\x0b\x6c\x6b\xe8\x86\xea\xf7\xc8\x53\xe5\xcc\x1d\x6a\xc7\x4c\x4a\x0c\xe4\x03\x83\xbb\x2c\x3d\x98\x22\xef\x1c\xad\x3a\x21\x25\xa9\xf9\x0a\xea\x27\xa9\x70\x31\xd7\x3d\xed\x6a\x19\x54\x0e\x23\x97\x0c\x62\xa9\x5c\x12\x39\x0b\x23\x77\xe8\x99\x0a\xc8\xae\x5b\x12\xec\x97\xdc\x70\xa2\x75\xd4\x32\x68\xe1\x1a\x79\x78\x4f\xe1\x16\xbb\x04\x2e\x2f\x46\x9d\x52\xe2\xa9\x3d\x9a\x35\x97\x86\x13\xf7\xd5\xb7\x9b\x83\xe1\x72\xbb\xb1\xe2\x1a\x4b\x6e\x2d\x75\xef\xa8\xb0\xf1\xe4\xea\x22\x29\x17\x24\xc2\x31\xab\x2a\x92\x8c\x54\x70\x28\x64\x87\xda\xdd\xea\x77\x68\xaa\x6f\xe0\x5a\xad\xc4\x58\x58\x8f\xad\xbd\x62\xbb\x4d\x9f\x46\xec\x27\x72\x2f\xf9\x1b\xac\xf9\x71\xd7\xf2\x1c\x1f\xe2\xfc\x71\x7f\xb7\x76\x02\x91\xba\xef\xe0\xae\xd9\x5c\xc3\x06\xd5\xe5\xa7\xb8\x87\xdc\xdf\x83\x07\xa6\xec\xaf\x36\xbb\xd0\x1c\xe6\x32\xba\x81\x2f\xc2\xd1\x82\xd8\xa5\xa4\x26\xf7\xce\x5c\x02\xdf\x21\x19\x76\x99\x7a\x04\x4a\x23\x9a\xca\x36\xc5\x46\x05\x35\x8d\xb8\x2c\xc6\x5c\xc2\xa9\x49\x57\x0c\x44\x9d\x29\x18\x65\x22\x52\x02\xa1\xb7\xee\x4c\xda\x5b\x5f\xdc\x4b\xaf\x75\x45\x25\x3c\xef\x35\xcf\xef\x76\x9d\xa8\x7b\x9b\x94\xa7\x11\xfb\x3a\x4d\x50\x9c\x4f\x3a\xcb\x5d\x70\x36\x22\x30\x7f\xfa\x69\x54\xfe\x8d\x2b\xd7\x64\xa8\x18\xe8\xe0\x83\x34\x7c\xcd\xa8\xa6\xf3\xf8\x73\x49\x52\x2e\x74\x79\x0c\xa3\xc7\x10\x76\xb0\x3c\x2e\xeb\xc7\xdf\x52\x92\x63\x35\x30\x8f\xe3\x31\xf1\x78\x20\xcb\xa2\x71\xe3\xfe\xc6\x77\x63\xf9\xc2\x85\x8c\x33\xe3\xd8\x51\x59\xfc\x86\x39\x63\x72\xc6\x2a\x63\x3c\x7a\xa2\x8e\x7c\xbc\x9f\xd4\x3e\x70\x7f\xc5\x81\xe4\x9e\xab\x6a\x13\xb9\x8f\x8f\xec\x6b\xbd\xb7\xe2\xd0\x8e\xa3\x2c\xa2\x4f\x2a\x77\x4b\xa5\x6e\xc6\xd7\x29\x86\x6f\x83\x42\x8e\x8e\x60\x4e\xb6\xbb\x8d\xf1\x52\xec\x8f\x0f\xd0\x88\xfd\x14\xe8\xf8\x29\x84\x15\x3e\xca\x7e\x42\xd4\x46\x6d\xee\xe6\xbf\xa2\x43\xe8\x2d\x54\x51\x13\x61\x87\xa3\xe7\x5a\x18\x52\x8d\xb7\xd1\x36\xc7\x04\xb3\x6d\x0c\x39\xd4\x3d\xe6\x52\xd8\x27\x97\x5b\xfa\x93\xcc\xab\xef\x7a\x7b\x65\x4b\x3b\x48\x14\x2e\x91\x2c\xd2\x05\x1f\x1a\x36\xd2\xec\x4f\x99\x52\xe7\x4b\xec\x20\x66\xc0\x3f\xa8\xea\xf8\x4f\x9d\x6d\xe4\xef\xaf\xac\xb3\x59\xe7\x91\xaf\x60\x51\x4c\xb7\x1c\xfe\x15\x14\x35\xb7\x03\x7e\x5e\x3d\xcd\x24\x4c\x1f\x9e\x1a\xad\x98\x8d\x8d\x0c\x93\x4d\xb9\x53\xaf\x08\xa8\x66\x52\x75\xe2\x00\xc7\x10\x3d\x3c\x69\xeb\xd7\x90\x5f\x1d\xd2\xca\x62\x25\xc2\x4f\x0b\x9e\x2a\x32\x5c\xe1\x8f\xdd\x06\xe1\xd3\x1c\xff\xa5\xe8\xf8\xb7\x2b\x5e\xd2\xb5\x6d\x4a\xc6\x1d\x35\x21\x10\xdb\xc4\x7b\x41\x8a\xce\xa3\x17\xbc\x93\xca\x26\x18\x30\x02\x32\x17\x8e\x50\xbe\x84\x36\xc6\x2d\x02\x21\x9c\x5e\x40\x66\x3e\x97\xd6\x54\xe0\x31\x01\x44\xd2\xf8\x09\x52\xdb\x3a\x0a\x71\x35\x98\xc3\xe4\x58\x56\xf5\x21\x90\xce\xd1\x40\x78\xad\x04\xc8\xdb\x00\xf1\xa9\x5a\xd9\x95\x3e\x84\x77\x78\xcb\x10\xb9\xdf\xec\xf3\x46\x37\xf8\xa8\x87\x8d\xcb\x21\x3f\x2a\x97\xc6\x45\x55\xd1\xa6\xb1\xae\xb6\x0d\x23\x2f\xfe\xf0\xb5\x31\x1e\xcc\x3a\x45\xf7\x07\xe3\xce\x23\xf3\x8f\x19\x76\x38\x7c\x80\x8f\xe8\xc1\x03\xf2\x9c\x76\xcd\x81\xb0\x1b\xbd\x20\x2b\xf0\x72\x0d\x6b\x00\x4f\x61\x07\x31\x92\xde\x49\xdc\xc3\x4f\xa1\x0d\x95\x47\x4f\xa1\xe2\xe3\xbd\xb1\xa3\x3e\xd8\x4e\xe8\x99\x7a\xe4\xac\x83\x83\x14\xd5\x6c\x00\x70\xec\x9f\x2b\x5f\xd9\xf0\x15\x06\xe5\x88\xaf\xfc\xf8\xe4\x40\x52\xdd\xc0\x11\x8c\xe0\x88\x3e\x11\x07\x39\x0d\x26\x1b\xb8\x50\x4d\xb7\xf0\xfa\x18\xf8\x1a\x29\xd2\xe4\xca\x9f\x04\x25\x57\xb8\xb4\x15\xcd\xb3\xb7\x1c\x24\x88\xeb\xe6\x32\xb4\x7d\x29\x91\x5c\xf5\x26\xa1\xed\x1e\x1c\xa5\xa5\x81\x6c\xc8\x02\xfe\x58\xc4\x0e\x70\x6e\x77\x9b\xd6\x88\x4f\xf0\xf2\x37\xa4\x11\xed\x9a\x75\xa6\x28\x42\x18\x12\x31\xa4\xe5\x65\x58\x65\x22\x82\xde\xa1\xd9\x14\xd4\xe6\xbe\xdf\xe5\xae\x36\x44\xc8\xf6\x99\xfb\x03\x6a\xbf\x32\x94\xf6\x09\xd5\xca\xa6\xb1\x89\x1d\x46\xf3\x87\xbb\xbf\x20\x8f\xf8\xcd\x94\xd4\xe1\x1e\x93\xe3\x81\x0f\xe5\xce\x36\xfd\xf7\x4d\x21\xe3\xb7\xfb\x2b\x67\xfe\xbe\x39\x9e\xec\xbb\x0c\x64\x24\xe9\xb7\x6d\xa1\x35\x59\xdd\x6a\x36\x5f\x70\x3c\xed\xb7\xfb\xc3\x2e\x79\x30\xee\x32\x39\x8e\x8a\x7b\xc4\xbc\xe7\xd0\x2a\xca\xde\xd4\xbd\xc9\xd2\xf6\x0c\x0a\x7f\x98\x32\x00\x1b\x0a\x6e\x65\x3a\xd6\x1c\x48\xa8\x70\x90\x56\xd4\x90\x20\x9a\x56\xaa\x87\xc8\x5c\x57\xb6\x8a\xab\x05\x79\x3e\x52\xe4\x40\x63\x87\x8d\x53\x8b\x16\x5c\x4c\x94\x48\x7d\xa6\x43\x24\x44\x7a\x74\x41\x2a\x05\x37\x52\xac\x81\xce\xfd\x61\xb5\xc0\xa0\x5b\x8c\x90\x4a\x54\x15\x35\x4a\x67\x90\x3d\x3d\x28\x12\x18\x5e\xa7\x77\xf0\xc4\x09\x6a\x9d\xb9\x57\x51\xf0\x8e\x26\x67\x96\x07\x0f\x88\xe4\x6d\x65\x2b\x3c\x81\xb3\x4c\x6a\x7d\xd0\x27\x6b\xc5\x74\x38\x14\xef\x0b\x2d\x88\xf4\xe9\xa3\x4f\x76\xb1\x53\x7c\xcb\xa5\xe2\x95\xc7\x56\x0c\xeb\xc8\x25\xd9\xd2\x9a\x11\x23\xba\x84\xcb\x29\x41\x4d\x7d\x9c\x9a\xe3\x63\x68\x05\xd7\x57\x28\x6c\xd9\xde\x15\x4b\x4c\x74\xdd\x89\xb1\x1a\x26\x99\xb5\x5e\x43\x4c\x67\xb3\xf1\xd4\xe6\x75\x13\xd9\x89\x2e\x64\x11\x53\x39\x01\xf2\x59\xeb\x09\xec\x28\x1f\xd1\x4e\xa6\x16\x88\x34\xf8\xc4\x5d\x0d\x02\xbe\x50\xad\xf4\x97\x92\xa6\xa6\xa3\xf3\xe1\x82\xaa\x93\x55\xde\x34\x55\xe5\x5c\x25\x5a\xfd\xdf\x71\x59\xc7\xb4\x82\x0e\xa2\xe0\x4c\xa9\x65\xf8\xf8\x31\x92\x39\xe3\x96\x71\x8f\x58\x31\x15\x24\x79\x87\x37\x70\xce\x72\x4f\xf4\x58\x1d\x95\x30\x5b\xb4\xbb\xb9\x35\xdb\xd7\x2f\xbd\x79\x65\xc6\xf5\xd6\xa9\x59\x67\xe9\xec\x4a\xdd\xa5\xb5\x4e\xc2\x7f\xa5\x5a\xdd\xcf\x15\x50\x36\x2d\x98\x0c\x0d\x94\x4c\xa2\xcb\xe2\xa7\x1e\xd1\x33\x8f\xd2\x27\x34\xae\xec\x98\x2b\x73\x3a\x7e\x63\x01\x67\xfe\x5d\x2e\x14\x34\x3e\x73\x47\x67\xd6\xc6\x15\xe3\x82\x66\x0f\xef\x4f\xb4\x22\x43\xc7\x73\xfa\x35\x7f\x8f\x7a\xa4\xea\xe6\x89\x8b\x72\xf3\xdb\xd2\x56\x4a\x4c\xa2\xa8\xd3\x2b\x4a\x7d\x72\x51\x6e\xee\xef\xed\x3d\xa6\xe1\xc2\xcb\x03\xe1\xad\xb4\xd5\xbe\x6d\xac\x69\x25\xba\x0e\x6e\x44\xe1\xe5\x76\x62\x4e\x5f\xd3\xce\xf6\x38\x6f\x6b\x76\x83\xbe\xbe\xe1\x27\x1e\xb1\xf3\x67\xf0\x04\xa7\x54\xb3\x12\xd1\xc4\x4c\xd9\xca\x87\x21\x84\xc2\x53\x89\x08\x0b\x8e\xb6\xc1\xbd\xf1\xb9\x0d\x9e\xc0\xca\x6a\xfb\x22\xcf\x79\xd0\xfa\xa4\x06\xce\x8c\xaa\x65\x08\xf2\x24\xf3\x07\xa5\x8b\x73\xc5\x98\x29\x69\x07\x4b\x67\x13\x3e\xe0\xef\x64\xf8\x0a\xe4\xeb\xac\x8c\x84\xb1\x56\xe6\xc9\x23\x18\xac\x69\xe9\xf5\x48\x19\xb6\x8d\xc6\xd1\x13\x3c\x1d\x75\xdd\x9a\xdb\x26\x0b\xa2\x50\xe0\x04\x57\x9e\x6f\xab\x34\xeb\xbd\xfa\xda\x1e\x57\xcb\x68\x93\xe2\x25\x8b\x5c\x9f\x67\xac\xee\x2b\xa5\xfb\x0c\x9b\xff\xfe\xc4\xfe\x1f\xa4\x3c\x4f\x50\x9a\x6f\x6e\x5f\x1c\xe7\x96\xfe\x28\xcc\xcf\xfe\xf0\x7e\x38\xfb\x92\x56\xe3\x54\xdb\x44\x8b\xa5\x44\x1e\xa4\x62\xdb\xa0\xc2\x9d\xf5\xaf\x0c\x6e\x12\xeb\x22\x71\x10\x92\x8a\x30\x07\x72\xfe\x2c\x8f\x40\x52\xc8\xc9\x6a\x5c\xa2\xa6\x48\xb8\x17\x57\xe6\x7c\xb5\xef\xdb\x92\x9a\xa7\x36\x02\xca\x58\xb9\x94\xac\x28\x44\xbf\x74\x9d\xe8\x3e\x86\xcb\x07\xa1\x48\x5c\xbb\x84\xfc\xc7\x93\xd7\xdf\x9c\x7f\xf3\xbb\xa5\xc1\xc1\x43\xb5\x09\xcc\xb4\x9a\x52\x6d\x68\xbb\x66\xa0\x53\x47\xda\x34\xd4\x10\xb6\xc9\x5f\x3b\xad\x66\x79\xbd\xb9\x39\xb8\x1a\xcc\x40\x16\x6b\x23\x83\x7a\xcd\xdb\x75\xe6\x72\xf2\x25\x18\xa1\x08\x07\x66\x34\x78\xc5\xed\xe7\x55\xd3\x2e\x8a\xef\x20\x8e\xa8\x6b\xc8\xcb\x0d\x4c\x5f\x73\x4a\xfa\x78\xd9\xbb\x01\x1f\x97\x8e\x17\x61\xeb\xe2\x33\x8d\x0d\x95\x84\xb7\x21\xe7\xf5\x92\xfc\x71\xe6\xd1\xf1\xe2\x6a\x7e\x9b\x22\x76\xa3\x4e\x8b\x6c\x36\xf9\x1d\x02\xe2\x9d\x59\x92\xa7\x9e\xc5\x0c\x24\xa8\xbe\x0b\x71\x5e\x15\x43\x0a\x99\xba\x8e\xe9\x12\x80\x3c\x77\xa4\xfd\x59\xe5\xf9\x9d\x9c\x1f\x3f\xb7\x40\xbe\x83\x17\x63\x44\xde\x22\xe0\x0a\x3b\x92\xd7\x27\xb6\x36\x8e\xba\xd1\x43\x42\xba\xfd\x79\xf8\xc4\x6f\xf8\x5f\xf8\x9f\x07\x41\x09\xbe\xa1\xfc\x1e\x97\xbe\x30\xf5\x2f\x24\x5a\x82\x0f\xad\xd5\x93\x97\xdd\x4b\x2d\xba\x50\x56\x68\x6e\x06\x80\xaf\xd9\xca\x49\x0b\x3b\xd4\xc2\x16\x79\xb6\xdc\xfc\xf0\xb3\x04\xcc\x23\x0b\xfe\x81\x6d\xf7\x60\xe5\xbe\x9b\x51\x3e\xc1\x19\xff\x6d\x6b\x92\x50\x0a\xc7\xdb\x19\x67\xd7\x6c\x05\x86\xa7\xd2\xb0\x0c\x76\x9f\x0e\xd0\x1c\xb6\xae\xbe\xe0\x50\x5b\xb0\x13\xf6\xea\xda\x1e\x7e\x20\xc4\xb9\xda\xd4\x1d\xdd\x1b\xba\x5a\x93\xea\x8e\x94\xdd\x5b\x58\x40\x5a\x93\x89\xc7\xdf\x11\x8f\xda\xcd\xb7\x20\x32\x54\xde\x7d\xd1\xb7\x70\x51\x62\xa0\xb9\x29\xcc\xc9\xdf\xc8\x0a\x44\x5b\xc3\xab\x21\x7e\x5d\x1c\x99\x3c\x89\xcc\xff\x9f\x13\x2a\xef\xe1\xf5\x79\xed\x7a\x59\xa2\xd3\xa6\x29\x95\x2c\xfe\x28\xe5\x8a\xcb\x65\xab\x46\x4a\x56\x8d\x95\xab\x3a\x5a\x9e\x78\xa4\x34\xf1\x48\x59\xe2\x8c\xc2\xc6\x72\x06\x45\x63\x28\xea\xe1\x8e\x9a\x7b\x8b\xe3\x15\x9e\x83\xfa\xa6\xb1\x6c\x0b\x6a\x94\x26\x42\x0f\xcd\x0f\x1c\x35\x39\x9a\x0e\xf5\x78\x7d\x8b\xd8\x18\x05\x62\x99\x52\xa1\xfe\xc3\x7c\x8c\x4f\xf2\xea\x64\x7f\xa9\x25\x76\x4b\x38\xb5\x12\x59\x98\xa0\xb6\xb8\x90\x11\x35\xa6\xd5\x8f\x1e\x2d\x34\x59\x5a\xb8\x49\x8b\x37\x69\x01\x91\x23\xb4\xb0\x54\xd6\xe1\x38\x38\x7b\x6e\x0a\xfc\x7f\x5c\xa0\x72\xc8\x96\x35\x00\x0a\x5f\xae\xb9\x98\x81\xe0\xf3\xad\xb7\x53\xe0\x1b\x75\x9e\x80\xe0\x5c\xd1\x9a\x44\xf2\xc6\x2e\xca\xf5\x1f\x2c\x3f\x54\x95\x09\x93\xf0\x9e\x3f\xf3\x60\x62\x83\xa5\xa2\xad\xb1\x58\xd6\xf6\xc2\x23\xe8\x8a\x5d\x82\x63\xaf\xee\x05\x72\xa9\xe2\x87\x73\xda\xf0\x8a\xb7\x26\x95\x53\x6c\xa9\x31\x45\x61\x44\xf7\xa0\x59\x89\x6e\xa8\x5a\xe1\xce\x42\x0f\x6c\xaa\x07\x3b\x9d\xcc\x00\x20\xf4\x63\xa3\x14\xd3\xdd\x22\x9a\x85\xfc\x14\xa6\x26\x4e\xcb\x40\x47\x1e\xed\xe4\xe3\xe3\xdb\x6e\xc8\x45\x3c\x00\xc6\x12\x25\xbc\x9e\x22\xfe\x18\x78\x6b\xe2\xf2\xa2\xdc\x01\x15\x1c\xe6\x14\x6c\xec\x1d\x49\x44\x1c\xf3\xdb\x9d\x68\x12\x80\x3b\xba\x43\xe4\x0b\xd1\x5d\xf0\x2d\x5b\x75\x74\xcb\xa2\xad\x72\xfe\x4c\x22\x8c\x13\xc4\x90\x0c\xbc\x9d\x66\xb2\x06\x60\x29\x3f\x4a\x45\xbb\x30\x88\xef\xc2\x5c\x87\x75\x61\x5e\xf6\x80\x2b\xf5\xf0\x11\x53\xda\x52\x0e\x6d\x9d\xc0\x60\x6d\x3d\x11\x42\xc8\xd6\xb7\x9c\xdd\xc0\xf0\xf1\xfc\x52\x39\x3a\x42\xdc\x59\x4a\x00\x97\x03\x23\x9e\x92\xd7\x5b\xdf\x99\xff\xd2\xff\x71\xde\xaa\x7f\x1b\x78\xf3\xfd\xfb\x0f\xdc\x28\xe3\x68\xc5\xff\x4e\xd1\x0b\xff\x35\x8d\xb7\x3f\x46\x72\xf2\xdb\x6f\x81\x0f\xae\xa9\x50\x38\x28\xf5\x3e\x07\x1f\xb0\x96\x16\xef\xfc\xe8\xe6\xb7\x3b\x2d\x8c\x03\x87\x19\x9f\x51\x65\x38\x5b\x44\x87\x26\x4f\xf8\xb5\x50\xf6\x1d\x5c\x7d\x66\xf0\x66\xc1\x39\x21\x21\x82\x2c\x3e\x2a\x02\xd3\xca\x5a\x28\x27\xc3\x98\x50\x66\x00\xf2\xa8\x9b\x4f\x26\x1f\xe1\xa5\xbb\x2a\xae\x5d\x15\x24\x41\x24\x63\x90\xfd\xb6\xf1\xe1\x84\xee\x94\xe2\x2d\xf9\xfa\x2b\x0f\xf1\x7c\xe5\x3f\xb4\xbc\x39\x89\x7d\x8a\x4e\xe4\x9c\x2e\x4e\x4b\x04\x0f\x8a\xe3\xfd\x29\x53\x21\x7d\x7d\x91\x80\xf6\xb6\x60\x1e\x9e\xa9\xd1\x2e\x8c\x1b\x8f\x94\x1e\x3a\x83\x3f\xe9\xb0\x63\xe4\x0c\x80\xdd\x1b\x9c\x14\xe9\x15\x82\x6e\xb5\xe0\xf2\x4d\x7f\xa9\xff\x6b\x26\x56\x4b\xa2\x1b\x3e\xfc\xa6\xdf\x5e\xb2\xee\xd1\x6c\x3e\x8f\x75\xb7\x9f\x7e\x2a\x76\xf9\x4a\x88\xe6\x56\x1d\x9e\x18\x3f\xcc\xa3\xd0\x8f\x71\xa4\xcb\xd3\x0d\xd5\x4c\x60\x30\x9b\xdc\xc9\x5b\x75\x59\xaf\x62\x7a\xf9\x90\xc4\x24\xb9\xdb\x0f\xa9\x6c\x19\xed\x15\x55\x1b\x72\x36\x18\xcd\x9a\xea\x17\x2c\x08\xc4\x0b\xda\xbe\x95\xac\x36\xb1\x73\x25\xbb\x3d\xca\x41\x8f\xb6\x90\xf4\x9a\x41\x09\xc2\x7b\x27\x44\x89\x65\x88\xc6\xbc\x34\xe6\x13\xe0\xfd\x3b\x0f\xd9\x08\x5a\x3f\xf4\xbc\xeb\xdc\x04\xd1\xc0\xa9\x00\xd1\xca\xf6\x1b\xd3\x00\xae\x51\x2a\xd1\x5e\xb3\x4e\x19\xd1\x68\x3f\x7c\x75\x50\x4c\x5e\x08\xb3\x0f\xbe\x66\x6b\x7a\xa9\x7f\x98\xa5\x78\x63\xb7\xc2\x19\x3d\xe7\x45\xf1\xc7\x5b\xae\xa2\x78\x2f\x23\xdb\xf0\xc5\x4b\x44\x5e\x4c\x4f\xf7\x2b\x79\x78\x9f\xb8\x52\xfe\x71\xfb\x59\xbc\x02\xa2\x19\x3e\xe9\x4e\x65\xe2\xfe\xf6\x49\x7b\x78\xcd\xa4\xe8\xbb\x8a\x79\xfa\x26\x78\xce\x33\x7b\x24\x84\x3f\x81\x69\x1e\xde\xf7\x53\xb0\xac\x53\x1c\x21\x21\x56\x3c\xcb\x94\x91\x7c\x98\x21\x67\xd2\x81\x8b\xad\x4e\x2e\x65\xcf\x8c\x5f\xc5\xc5\x8b\x7c\x96\x90\xee\xd1\x0c\xc7\xe6\xfd\x27\xef\xff\x7f\x00\x00\x00\xff\xff\x67\xae\x8d\xdb\x79\x0f\x01\x00" + +func flowtransactionschedulerCdcBytes() ([]byte, error) { + return bindataRead( + _flowtransactionschedulerCdc, + "FlowTransactionScheduler.cdc", + ) +} + +func flowtransactionschedulerCdc() (*asset, error) { + bytes, err := flowtransactionschedulerCdcBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "FlowTransactionScheduler.cdc", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xa4, 0xeb, 0x8, 0x55, 0xdc, 0x7, 0x91, 0xac, 0x8a, 0xc5, 0xe9, 0x82, 0x2f, 0xc8, 0xfc, 0xfd, 0xc9, 0x60, 0xf0, 0x1f, 0xdd, 0x8d, 0x37, 0x2, 0x89, 0x7d, 0xa5, 0x60, 0x72, 0x13, 0xce, 0x6f}} + return a, nil +} + var _linearcodeaddressgeneratorCdc = "\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xac\x97\xdf\x6f\xdc\xb8\x11\xc7\xdf\xf7\xaf\x98\xde\xc3\x61\x17\x70\xd6\xa4\x48\x49\x54\x9a\x4d\xd1\x04\xbd\xa4\x40\xf3\x52\x5c\xdb\x87\x20\x3e\x50\xe4\xd0\x16\x6e\x2d\x19\x92\xd6\x76\x90\xcb\xff\x5e\x70\x28\x2d\xb5\xd2\x6e\x12\x14\xf5\x8b\x47\xfc\xf1\xe1\xf0\x3b\xe4\xec\x70\x75\x7d\x7d\x0d\xff\xa8\x6a\xd4\xed\xdb\xc6\xe2\x5f\xad\x6d\xb1\xeb\xde\x61\x8d\xad\xee\x9b\x16\xf4\x7e\xdf\x3c\x75\x70\x1b\x1a\xaa\xfa\x16\x74\x6d\xe1\x51\xef\x2b\x1b\x3e\x7f\xd9\x37\x4f\xa0\x8d\x69\x0e\x75\x0f\x3a\x4c\xc7\x6e\xbb\xd2\xc6\x60\xd7\xad\xf5\x7e\xbf\x59\x99\xa6\xee\x5b\x6d\xfa\x6f\x2d\xf4\x65\xb5\x02\x00\x98\x4e\xf3\xdf\x58\x1f\xee\xe1\xed\x9d\xae\xea\x97\xf0\xaf\xbf\xd7\xbd\x82\x2f\xd4\x7e\x6e\xac\xff\x33\xba\x43\xf8\xa0\xab\xba\xc6\x7e\xf5\xfd\x91\xbf\x62\xd7\xff\xe0\xc8\x56\xd7\x5d\x85\x75\x4f\xcd\x5f\xc3\x0c\x2f\xde\x3f\xbd\x3e\x8d\x83\xfe\x0e\x47\x99\x9a\x16\xee\x75\xdf\x56\xcf\xf0\x6e\xec\xf9\x98\xc9\x2b\x99\x7e\x7a\x61\x1a\x8b\x70\xe8\xd0\x82\x6b\xda\x41\xbc\x28\xda\xc8\x7c\x07\x55\x07\x1a\xd6\xbf\xc3\x33\xd4\x9b\x11\xf6\x54\xf5\x77\x60\x1a\x74\xae\x32\xde\x93\x0e\xaa\x1a\xde\xfd\xb2\x4e\x36\x57\x80\xda\xdc\x41\xdb\x3c\xf9\x89\xa6\xa9\x1f\xb1\xed\xd1\x42\x55\xf7\xcd\x11\xaa\xa1\xac\x6e\x01\x6b\x5b\xe9\xda\xf7\xe0\x2d\xb6\xd0\xe2\x43\x8b\x1d\xd6\xbd\xee\xab\xa6\x1e\xbd\x25\x28\xb4\xfa\x09\x1e\xd1\xf4\x4d\x3b\xf3\x8c\xfc\xef\x9b\x71\xbb\x48\x73\x16\x67\x60\x1a\xcf\x0e\xf7\x2e\x08\xba\xc7\x3e\xca\xf4\x81\x36\xe6\x15\x7c\x09\x1f\x7d\x78\x33\xf9\x67\x90\xe9\xa7\xa8\xee\xdb\x66\x7f\xb8\xaf\x8f\x02\x3f\xe8\xb6\xea\x3f\xbf\x30\x77\x68\x7e\x1f\x65\x79\xff\xbf\x69\xfc\x7e\xd0\xb8\x86\x67\x78\xf8\x71\x8d\x0d\x39\xf4\xff\x94\x79\x20\xce\x95\x7e\x3f\x55\xfa\x11\xdb\xca\x7d\x06\x0d\xb4\xb7\xa7\xa6\xb5\xc1\x7b\xba\x88\x73\xe9\xb7\x97\x95\x0f\xfa\xbd\xf5\xf2\x05\xed\x07\x7d\x27\xf2\x67\x72\x90\xbf\xaa\xab\x7e\xbd\x99\xdc\x37\x8f\xda\x9e\x89\x1d\xec\xe0\xe3\x71\x90\xff\x63\xcf\x28\xb3\xbc\x2c\xac\xe5\xdc\x69\xc6\xac\xbb\x02\xf6\xec\x12\x21\xac\x41\x54\xca\x21\xd3\x25\x52\x5b\xc1\x0b\xc4\x3c\x97\x32\x2f\x73\x59\xe4\xd4\x66\x94\x71\xb9\x28\x75\x22\x74\x92\x31\x7b\x35\x63\xbb\x08\x47\x4c\x34\xa7\x39\x11\xae\xac\x62\x81\x33\x81\x67\x06\x33\xdf\x96\x4f\xe0\xdc\x72\x36\x67\x8b\x09\xbc\xe4\x4a\xf8\x39\x3c\xc2\x5d\x91\x59\xe2\xa8\x08\xcf\xd3\xbc\xd4\xbe\x4d\x4e\xe0\xa5\x10\x7c\xce\x4e\x22\x3c\xc9\x5d\x66\x88\x1d\xe1\xa8\x50\x25\xc4\x8e\xf0\xd4\x5a\x45\xda\xc9\x08\x2f\x58\x8a\x72\xce\xd6\x11\x8e\xcc\x06\xbf\x6d\x84\x2b\x9b\x6a\xd2\x04\x23\x5c\x18\xa1\xc8\xef\x3c\xc2\x1d\xcf\xb9\x9b\xb3\xcb\x09\xdc\x94\x49\x49\xec\x08\x2f\x99\x29\x25\xb1\x23\x3c\xc9\x4c\x6a\x89\x1d\xe1\x7e\x33\x62\xa1\xf7\x04\x5e\xa6\x21\x96\x45\x84\x17\x9c\xe7\xe4\xa3\x89\x70\xa7\x33\xc9\x68\xbd\x08\x17\x98\x14\xf9\x9c\x9d\x47\xb8\xd3\xa5\x25\x6d\xcb\x08\x77\x25\x0f\x31\xb0\x11\xae\xad\xc5\xa0\x53\x84\x63\xc9\x8b\x6c\x71\x06\x23\x3c\xe1\xc6\x92\x3f\x79\x84\xe7\x85\x36\x14\x03\x11\xe1\xd6\xc9\xb0\x5e\x11\xe1\x0a\x73\x96\xcc\xd9\x26\xc2\xb9\xe0\x25\x9d\xb7\x2c\xc2\x25\x73\x05\x69\x22\x22\x9c\xb9\x02\xc9\x07\x1e\xe1\xce\x49\x5c\xe8\xad\x22\x3c\x93\xac\x20\xbd\xe3\x55\x75\x9c\xa7\x86\xf6\x1f\xaf\xaa\xb3\x65\x2e\x52\xf2\x3b\xc2\x31\x11\xac\x58\xf8\x1d\xe1\xd6\xe4\x22\x3b\x76\x7f\x5a\x9d\xa6\x90\x4b\x49\xe8\x4c\x1e\x61\x8c\x31\x72\xd2\x1b\xc9\x68\xc8\xd1\x50\x83\xc1\xd9\x60\x24\xa3\x21\x47\x43\x2d\xee\xb8\x1f\x3e\xf4\x26\xa3\x21\x47\x43\x0d\x06\x67\x83\x91\x8c\x86\x1c\x0d\xe5\x8d\x19\xd3\x0f\xa7\xde\x64\x34\xe4\x68\xe4\x22\x51\x74\x17\xb2\x4c\x85\xc0\x65\x9c\x27\x74\xab\x33\xa6\x24\x5d\x27\x29\x84\x5b\xe4\x39\x99\x68\x1d\x7a\x79\x91\xf2\x21\x2a\x86\xd2\x66\x92\x68\x15\x5a\x78\x21\x49\x04\x8e\x2e\x0b\x27\xc0\xa2\xa1\x55\xb8\xc9\xc4\x22\x46\xbc\xb4\x36\x8c\xd7\x69\x88\x2a\x2f\xa4\x0e\xa9\x48\x19\x49\x67\x8d\x67\x22\x5c\x72\x9e\x26\x45\x30\xa4\x96\x21\x15\x0a\xae\x16\xb9\x87\x27\x85\x4c\x42\x32\x53\x26\x04\xcb\x29\x1e\x82\x85\x2c\xa1\xf3\xc4\x2c\x63\xe4\x39\x33\x4a\xd0\x72\xac\x64\x9c\x64\x61\x5a\x2d\x73\x25\x2b\x54\xf0\x81\xe5\x4c\x84\x70\x67\x2a\xa1\x7d\xb1\x54\xf1\x82\x0c\x31\x24\x7a\xc6\x72\x3b\x9c\x8d\x7c\x58\x8e\x65\x0a\x97\x71\xcf\xf2\xb0\x34\x4b\x0b\x3b\xc4\x1d\xc3\x2a\x4c\x94\xc3\xa1\x12\x99\x1e\xce\x86\x0d\xab\x30\x6e\x06\x26\x13\x6e\x72\xa6\x21\x96\x81\x8b\x9f\x5a\x77\xf0\x3f\xfd\xf4\xe3\xec\x8b\xdd\xff\x34\xad\x5d\xbb\xa6\xa5\x3a\x16\x4c\xa8\x66\xe9\x63\x13\xaa\xda\x4c\x4e\x7f\x66\x9f\xaa\xde\x17\x1a\x34\xf8\xcb\x69\x15\x4a\x93\xb6\x43\x7d\xfb\xf2\x64\x83\x2d\xf6\x87\xb6\x06\x76\x6e\xc2\x50\xe6\x9e\x9f\xf0\x9c\x29\x21\x4b\x2d\xf2\x52\x14\x8a\x25\xac\x38\x4b\x18\xcb\xdf\x0b\x0c\x6e\x4a\x9e\x16\x2a\xcd\xb5\x63\x09\xe3\xea\x38\xca\xa2\xd3\x87\xfd\x6c\xda\x83\xae\x2b\xb3\xfe\xe9\x50\x77\x87\x87\x87\x86\x6a\x28\xda\xee\x4f\xb1\xe8\xfe\xfa\x5d\x81\xb1\x36\xa3\xb6\xbf\x51\x49\x34\x6a\x39\x15\xf5\xc8\xbb\xbe\x86\x0f\x87\x7d\x5f\x3d\xec\x3f\x53\xed\x55\xd5\x16\x9f\x87\x0a\x2c\x94\x5e\x50\x86\x1e\x2a\xb1\xe6\x95\x7c\x04\x3d\xea\x16\xc6\x85\x8f\x0b\xed\x26\xba\xfb\x01\x54\xa1\xed\xe8\x5f\x9c\xe9\xab\xd1\x65\xf9\xe4\x0b\xcc\x8b\x95\xd5\x97\x13\xd9\x2a\x17\xc0\x3f\x03\x87\xdd\x0e\xf8\xac\x9b\x42\x36\x78\x06\xbb\x68\xde\x9c\x59\xf5\x64\xe2\xd7\x93\xaf\x89\xef\xf0\xfa\x35\xf0\x49\x48\x56\xb3\xb8\x8f\x4b\x2c\xde\x44\xd4\xdd\x85\x77\x41\x28\x4a\x41\xf7\xe1\x89\x54\x3d\x62\x1d\xd4\xbf\x22\x45\x62\x23\x1d\x81\xed\xd9\x67\xa0\x8f\xf7\x00\x5a\xeb\x3e\x4c\x1f\xc5\xbf\x9a\xdf\xa8\xe1\x6d\xf9\x97\x89\x3c\xd7\xd7\xf0\xeb\x31\xe8\xf7\x87\xae\x87\xd2\x7f\xd1\xe2\xad\xae\x6f\x11\x3e\x72\xd8\x6e\x21\xb9\x91\x29\xbc\x00\xfe\x69\x35\xd1\x3c\xcc\x7a\x05\x1c\xfe\xf8\x63\xf8\x78\x0d\xeb\x04\x5e\xbd\x02\x29\x37\x7e\xf8\x2c\x10\x83\x3a\x75\xb5\x5f\x2d\x25\x1e\x3a\x07\x27\xe9\x4c\x6f\x27\x47\x99\xf8\x1b\xb8\x09\x67\xe2\x52\x12\x79\x19\xf6\xbc\xd9\x5c\x54\xbe\x3d\xa0\xf7\x3d\xaa\x3b\xc6\xa1\xea\xc2\xab\xe1\xac\xfa\xf1\x7d\x71\x39\x0e\x55\xf7\x6f\x3f\x7f\xdc\xc0\x6f\x23\xf9\x28\xfc\x22\x20\x6f\x9a\x66\x3f\xbd\x8b\xfe\x25\x32\xba\xb3\x1b\xa2\xb8\x75\x6d\x73\xff\xa6\xba\xfd\x1b\x3d\x9c\xde\x7c\xee\xb1\x5b\x8f\xef\x99\xbe\x09\xdf\x9b\xcd\x9f\xce\x5e\x43\xd8\xfd\x98\x5a\x70\x33\x2e\xbb\x9a\xc6\x37\x62\x76\xc0\xce\x87\xd2\xe9\x7d\x87\xe7\x2e\xc2\x3c\xad\xc4\xf7\x19\xa5\x96\x17\xa7\xa9\xe5\xcc\xf3\xf5\x34\xb1\x84\x01\x27\x69\xe5\x24\x7d\x5c\x28\x9d\x8e\x39\xe4\x62\x69\xb5\x48\x24\xc7\x4d\x7f\x23\x99\x04\x1a\xec\x46\xe3\xe6\xd2\xfa\xdf\xc8\x26\xe7\x12\xd2\x77\xb2\xca\xb8\xac\x8f\xc6\xcf\x3f\x9f\x86\x67\x38\xef\x5f\x57\xff\x0d\x00\x00\xff\xff\xb2\x90\x98\x61\xb9\x12\x00\x00" func linearcodeaddressgeneratorCdcBytes() ([]byte, error) { @@ -425,6 +447,26 @@ func testcontractsTestflowidtablestakingCdc() (*asset, error) { return a, nil } +var _testcontractsTestflowscheduledtransactionhandlerCdc = "\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xec\x58\x4f\x6e\xe3\x36\x17\xdf\xfb\x14\x2f\x5e\xcc\x27\xe1\x9b\x91\x33\x40\xd1\x85\x11\x4f\xc6\x75\x9c\x89\x81\x44\x0e\x6c\x65\x06\xc1\xcc\x2c\x18\xf1\xc9\x26\x22\x53\x02\x49\xc5\x31\x02\x9f\xa1\xfb\xae\x7a\x8c\x9e\xa7\x17\xe8\x15\x0a\x52\x92\x2d\x4b\x54\xea\x59\x74\x57\x6d\xa2\x50\xef\x3f\x7f\xfc\xbd\x47\xb3\x55\x9a\x08\x05\xdd\xcb\x38\x59\x07\x82\x70\x49\x42\xc5\x12\x3e\x0f\x97\x48\xb3\x18\x45\xb7\x73\x20\x91\x3c\x22\xaf\x2c\x65\x7c\xc1\x1e\x62\x2c\x96\x3b\xbd\x1e\xfc\xf9\xdb\xef\x7f\xfd\xf1\x2b\xc0\x97\xe1\xcc\x9f\xf8\x9f\xfa\x70\xe7\xcf\x87\x97\x63\xb8\x9c\xce\xe0\x76\x36\xbd\xb8\x1b\x05\x93\xa9\x5f\x88\x69\x85\x60\xc9\x24\x30\x09\x04\x82\xf1\x3c\x80\xd1\xd4\x0f\x66\xc3\x51\x00\x53\xff\xfa\x1e\x08\xa7\x20\x97\x49\x16\x53\xf0\xc7\x9f\xc7\x33\x78\x40\xc8\x24\x52\x60\x1c\x52\x91\xd0\xcc\x04\x7b\xb2\xb3\x13\x26\x5c\x09\x12\x2a\x6d\x90\xa2\x64\x0b\x8e\x14\x64\x12\x63\xbc\x81\x28\x11\xa0\x50\x2a\xc6\x17\xd0\x96\x2d\x44\x19\x37\x2b\x24\x66\x6a\xa3\xcd\xea\x08\xb4\x55\xc2\xb8\x84\x8c\x4b\x12\x21\xb0\x55\x1a\xe3\x0a\xb9\x22\x5a\x54\x82\x5a\x12\x05\xa1\x89\x32\x46\x42\x41\x25\x10\x27\x52\x42\x12\x69\x7b\x54\x42\x22\x40\x62\x98\x09\xa6\x36\xf0\x94\xc5\x1c\x05\x79\x60\x31\x53\x0c\xa5\xd7\xe9\xf5\xb4\x9f\x8b\x29\xf8\xd3\x00\x2e\xc6\xb7\xd7\xd3\x7b\x08\xae\x26\xf3\x4a\x29\x66\x30\x84\xf9\xe4\x66\x72\x3d\x9c\xed\x57\x83\x29\xdc\x0c\x27\xbe\x3f\xce\x05\xfc\xfb\x6a\x7d\xc7\xfe\xe7\xc9\x6c\xea\xdf\x8c\xfd\x40\x5b\xbf\xf3\xaf\xc7\xf3\x39\xdc\x4f\xef\x60\x38\x1b\xc3\xfc\x6e\x36\x86\x2f\x57\xc3\x60\xb7\x72\x31\x9d\xf8\x9f\x4e\x8a\x58\x02\x94\x4a\x57\xa8\x2c\x0b\xad\x94\xea\x8a\x70\xaa\x0b\x65\x76\x4c\xea\x4a\xb0\x88\x21\x35\x95\xdd\x97\xff\x98\x5a\x77\x48\x18\xa2\x94\x0e\x89\x63\x77\xaf\x79\x8c\xef\x97\x0e\x00\x40\x55\xfd\x89\x08\x90\x16\x0d\xd9\x87\x8f\x2f\x77\x13\xae\x7e\xfe\xa9\xdf\x1a\x88\x67\xf3\xb5\xb5\xfb\xc8\xc2\x10\x91\xd6\x7d\x7c\xcd\x5d\x7c\xef\x34\x94\x62\x54\x50\x84\x3d\x57\x89\x20\x0b\xbc\x25\x6a\xd9\x87\xca\x3f\xaf\xe9\xdc\x66\x0f\x31\x0b\x73\x95\xfd\xbb\xd1\x68\xa8\x09\x94\x49\x26\x42\x2c\x75\x5f\x49\xd8\x5a\x53\x63\xd0\x16\x0b\x27\x2b\xd4\x11\x0b\xc6\x17\xad\x42\x14\x65\x28\x58\xaa\x4d\xee\x64\x77\xc2\x8c\x33\xe5\x54\xcd\xbc\xb5\xc9\xbb\xc5\xc6\x96\x8f\xc4\x38\xf2\xb4\x16\x0c\x4c\x0c\xcd\x8f\x15\x23\x30\xa8\x9a\xdc\x89\x6e\x77\x6f\xf5\xc8\x5b\x8b\x33\x7e\xc6\x30\x53\xe8\xee\x35\xa2\x8c\x03\xe6\xab\x15\x0d\x87\xd1\x3e\xe4\x1b\xff\x16\x28\x51\xa4\x0f\x43\xbe\x99\x2b\x91\x85\xea\xbc\x9e\x4b\xaf\x07\x37\x89\x54\xa0\x2a\xb8\x81\x35\x8b\x63\x58\x92\x27\x04\x69\x0a\x60\xac\x1c\xa8\xb1\x28\x2f\x2e\x51\x24\xaf\x91\x4e\x93\x28\x02\x44\x9e\x17\x55\xab\x39\x2a\x9c\x31\xae\x90\xe7\x44\x06\x11\x61\x71\x26\xb0\x38\xa2\x44\x62\x43\x81\x45\x07\x2e\x06\xd0\xd5\x3a\x5d\x8b\x69\xfd\xa4\x84\xb3\xd0\xe9\x56\x4a\x01\xdf\x1c\x46\x5d\xe3\x08\x69\xd7\x6d\x68\x6d\x01\x63\x89\x16\x37\x21\xe1\x21\xb6\x3a\x2a\x59\xbd\xe8\x00\x24\x5e\x93\x8d\x34\x5e\xe0\x01\x43\x92\x49\x04\xb5\xc4\x6a\x4d\x21\x24\xfc\x7f\x3a\x49\x6d\x16\x98\xd2\x28\x01\x9a\x19\x7f\xf9\x0e\x56\xc1\x51\x7d\x28\x4a\x25\x92\x0d\x9c\xbd\x3b\x82\x81\xbc\xdc\x41\x1d\x0c\x8c\xb6\xa6\xde\x9a\xe0\x30\x8e\x21\x51\x4b\x14\x20\x70\x91\xc5\x44\xec\xb7\x69\x97\x78\xc1\x3a\x56\x13\xc7\x44\x6b\x65\x2d\x8f\xa4\x29\x72\xea\x58\x83\xee\xd8\x77\xaf\xc4\xe2\x88\xa4\x55\x20\x8e\x48\x9a\xf7\xb3\xcd\x19\xc9\xd4\xf2\x88\xa3\xf5\xe6\xe5\x07\xb8\x69\xfb\xc1\x8e\xf1\xa0\x68\x30\x05\xf1\xeb\x57\x72\x00\x86\x35\x53\xcb\xc3\xa5\x86\x19\x9d\x91\xad\x71\xc0\xd9\xbb\x76\xfa\x2c\x15\x1c\xeb\x8e\x2c\xf3\xa8\x47\x24\xed\x97\xc5\x7a\x6b\x87\x9c\xe1\x8c\xae\xd9\x6f\xfd\xde\xb5\x8b\x29\xb6\x42\xa9\xc8\x2a\xed\xc3\x02\xd5\x28\x13\x02\xb9\xfa\x25\x4e\xc2\x47\xc7\xf5\x76\x1f\xe1\xff\xf0\xfe\xd4\x3b\xb5\x9b\x48\x05\x4b\xf4\xf0\xf1\x4a\x4b\xb8\x2d\x44\xbc\x2b\xb6\x58\xda\xad\xec\x0e\xd0\x38\x8a\x12\xa1\x4a\xf2\x73\xde\x9f\x9e\x9e\xba\x76\x95\x08\x51\xf6\x8f\x3c\x53\x0b\x54\x97\x88\x97\x22\x59\x7d\x26\x59\xac\x1c\xb2\x4a\x32\xae\xfa\xf0\xde\x3b\x6d\x22\xb4\xb9\x72\x8c\x0b\x42\xa9\xed\xb3\xb3\x47\xc0\xb3\x8e\xd6\x06\x08\xd7\x76\x24\x9a\xb0\x2c\xb9\xf1\x88\x60\x9a\x1d\xa5\x0f\x13\xfe\x44\x62\x46\xf3\xa3\xa5\x36\x29\xe6\x93\x54\x1d\xd3\x8c\xe6\x8c\xeb\x41\xa0\x65\x98\x84\x6f\x8e\x56\xd1\x35\xd4\x2b\x8e\xeb\x31\xaa\xf9\x3f\x62\x28\xdc\x1a\x21\x6f\x6b\xcd\x71\xdb\x9c\x5a\x74\xc3\x0b\x05\x12\x85\x45\xb0\x8e\xdb\x87\x8f\x87\xe3\x97\x7e\x04\xaa\x4c\x98\xb3\x92\x4b\x97\xa3\x47\xd1\xeb\x4d\x19\xea\x90\x2b\xad\xcc\x8a\x71\xa5\x5b\x9b\x05\xba\x05\x49\xe8\xf9\xf2\x89\x08\x86\x6a\xa3\x07\xe9\x83\xc6\xa9\x8b\x42\x59\x14\xa1\x3e\x0a\x15\xc2\x2c\x32\x2d\x32\xfa\xe1\xdb\x08\x54\x7a\x4e\x79\x11\xd0\xc5\x4d\x89\x50\x3a\x86\xfa\x15\xe5\xd8\xdb\x49\x61\x77\xa2\xfe\xe5\x9b\x84\x6d\x1b\x8f\x82\xfc\xc7\x1f\x1a\x8d\xab\xb3\x8d\xe1\x4f\x45\x54\x26\x61\x50\x21\xd2\x67\x2f\x5f\x74\xf6\xd0\x63\xd1\x4e\x70\x00\x9c\xc5\xb5\xc3\x53\x1c\x9c\xf2\x00\x14\xa2\xed\xe8\xaf\xfa\x62\xb4\x8a\xf1\x3d\xbe\xcd\x8c\x68\xbd\x16\x7c\x3d\x54\xff\x0e\x67\xef\x4e\xaa\xe1\xff\x07\xa3\x3a\x1b\x58\x07\x9e\xbc\x01\xb8\x25\x80\x92\x47\xe4\x9e\x21\xef\x3a\x42\xf6\x95\xd5\x64\xd1\xbe\x2f\x9e\xc0\x55\xf2\x84\xce\x23\x6e\x9a\xe3\xd4\xf9\x79\x1d\x25\x93\x8b\x7e\x31\x7a\x56\x41\xc2\x13\x7d\x01\xcd\x78\x75\x12\xdd\x31\x55\x2b\xd2\xf3\x0c\xdb\x5b\xc1\xf3\x89\xfb\x1a\x5d\x2e\x50\xcd\x6d\x63\x96\x66\xce\xf2\x7a\xd8\x64\xce\xbc\x12\x36\x3d\x8b\xaf\xf2\x8e\xbc\x73\x68\x6d\x97\x77\x97\xec\xf9\x9f\xf6\xa4\xd7\x83\x87\x44\x88\x64\x0d\x04\x04\x1a\x1a\x0d\x51\xa3\x44\x8f\xd3\x4f\x46\xd8\x40\xc8\x5c\x50\x4a\x34\xea\xb3\xa8\xfb\xf9\xc1\xce\xe6\xc2\x83\x3c\x11\x12\x86\x3a\x06\x4f\xe6\x97\x5b\x2f\xf7\x51\xcc\x84\xd5\x9f\x8a\xbc\x2f\x4c\x2d\xa9\x20\x6b\x17\xde\xd4\xa2\xfc\xe0\x44\x22\x59\xf5\xa1\x57\x18\xe9\x45\xe5\x77\xf3\xb9\x0d\x11\x23\x03\x76\xbd\xf3\x45\x62\x3b\xb3\x79\x88\x15\x28\x58\xba\x97\x11\xf1\xd6\x45\x50\xbb\x52\xe6\x7f\x5d\x20\xf2\xa4\x51\xcd\x36\x2c\x98\xab\x6e\x95\x21\xdb\xc1\xae\x3d\xbf\xd4\xd9\xca\x86\x05\x18\xc0\xd7\xef\x9d\x43\xc1\xe6\x8f\x0a\x30\xd8\x17\x4d\xb7\xc4\x66\xcf\xb5\x5a\xd8\xff\xac\xa0\x0d\xa4\xe6\xbf\xd7\xf4\xb7\x9d\x2d\xfc\x1d\x00\x00\xff\xff\x6f\xe6\xed\x50\x35\x14\x00\x00" + +func testcontractsTestflowscheduledtransactionhandlerCdcBytes() ([]byte, error) { + return bindataRead( + _testcontractsTestflowscheduledtransactionhandlerCdc, + "testContracts/TestFlowScheduledTransactionHandler.cdc", + ) +} + +func testcontractsTestflowscheduledtransactionhandlerCdc() (*asset, error) { + bytes, err := testcontractsTestflowscheduledtransactionhandlerCdcBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "testContracts/TestFlowScheduledTransactionHandler.cdc", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xb2, 0x6, 0xba, 0x6d, 0x46, 0xfc, 0x3d, 0xf, 0x7a, 0xa7, 0x84, 0x25, 0xb7, 0x49, 0xbe, 0x25, 0xd2, 0x60, 0xab, 0x97, 0x85, 0x5a, 0x63, 0xc6, 0x6f, 0x3c, 0x15, 0xfe, 0x88, 0xc, 0xbb, 0xd5}} + return a, nil +} + // Asset loads and returns the asset for the given name. // It returns an error if the asset could not be found or // could not be loaded. @@ -516,23 +558,25 @@ func AssetNames() []string { // _bindata is a table, holding each asset generator, mapped to its name. var _bindata = map[string]func() (*asset, error){ - "Crypto.cdc": cryptoCdc, - "FlowExecutionParameters.cdc": flowexecutionparametersCdc, - "FlowFees.cdc": flowfeesCdc, - "FlowIDTableStaking.cdc": flowidtablestakingCdc, - "FlowServiceAccount.cdc": flowserviceaccountCdc, - "FlowStakingCollection.cdc": flowstakingcollectionCdc, - "FlowStorageFees.cdc": flowstoragefeesCdc, - "FlowToken.cdc": flowtokenCdc, - "LinearCodeAddressGenerator.cdc": linearcodeaddressgeneratorCdc, - "LockedTokens.cdc": lockedtokensCdc, - "NodeVersionBeacon.cdc": nodeversionbeaconCdc, - "RandomBeaconHistory.cdc": randombeaconhistoryCdc, - "StakingProxy.cdc": stakingproxyCdc, - "epochs/FlowClusterQC.cdc": epochsFlowclusterqcCdc, - "epochs/FlowDKG.cdc": epochsFlowdkgCdc, - "epochs/FlowEpoch.cdc": epochsFlowepochCdc, - "testContracts/TestFlowIDTableStaking.cdc": testcontractsTestflowidtablestakingCdc, + "Crypto.cdc": cryptoCdc, + "FlowExecutionParameters.cdc": flowexecutionparametersCdc, + "FlowFees.cdc": flowfeesCdc, + "FlowIDTableStaking.cdc": flowidtablestakingCdc, + "FlowServiceAccount.cdc": flowserviceaccountCdc, + "FlowStakingCollection.cdc": flowstakingcollectionCdc, + "FlowStorageFees.cdc": flowstoragefeesCdc, + "FlowToken.cdc": flowtokenCdc, + "FlowTransactionScheduler.cdc": flowtransactionschedulerCdc, + "LinearCodeAddressGenerator.cdc": linearcodeaddressgeneratorCdc, + "LockedTokens.cdc": lockedtokensCdc, + "NodeVersionBeacon.cdc": nodeversionbeaconCdc, + "RandomBeaconHistory.cdc": randombeaconhistoryCdc, + "StakingProxy.cdc": stakingproxyCdc, + "epochs/FlowClusterQC.cdc": epochsFlowclusterqcCdc, + "epochs/FlowDKG.cdc": epochsFlowdkgCdc, + "epochs/FlowEpoch.cdc": epochsFlowepochCdc, + "testContracts/TestFlowIDTableStaking.cdc": testcontractsTestflowidtablestakingCdc, + "testContracts/TestFlowScheduledTransactionHandler.cdc": testcontractsTestflowscheduledtransactionhandlerCdc, } // AssetDebug is true if the assets were built with the debug flag enabled. @@ -589,6 +633,7 @@ var _bintree = &bintree{nil, map[string]*bintree{ "FlowStakingCollection.cdc": {flowstakingcollectionCdc, map[string]*bintree{}}, "FlowStorageFees.cdc": {flowstoragefeesCdc, map[string]*bintree{}}, "FlowToken.cdc": {flowtokenCdc, map[string]*bintree{}}, + "FlowTransactionScheduler.cdc": {flowtransactionschedulerCdc, map[string]*bintree{}}, "LinearCodeAddressGenerator.cdc": {linearcodeaddressgeneratorCdc, map[string]*bintree{}}, "LockedTokens.cdc": {lockedtokensCdc, map[string]*bintree{}}, "NodeVersionBeacon.cdc": {nodeversionbeaconCdc, map[string]*bintree{}}, @@ -601,6 +646,7 @@ var _bintree = &bintree{nil, map[string]*bintree{ }}, "testContracts": {nil, map[string]*bintree{ "TestFlowIDTableStaking.cdc": {testcontractsTestflowidtablestakingCdc, map[string]*bintree{}}, + "TestFlowScheduledTransactionHandler.cdc": {testcontractsTestflowscheduledtransactionhandlerCdc, map[string]*bintree{}}, }}, }} diff --git a/lib/go/templates/internal/assets/assets.go b/lib/go/templates/internal/assets/assets.go index 88813cfa0..20da170f4 100644 --- a/lib/go/templates/internal/assets/assets.go +++ b/lib/go/templates/internal/assets/assets.go @@ -301,6 +301,18 @@ // storageFees/scripts/get_storage_capacity.cdc (153B) // storageFees/scripts/get_storage_fee_conversion.cdc (121B) // storageFees/scripts/get_storage_fee_min.cdc (115B) +// transactionScheduler/admin/execute_transaction.cdc (579B) +// transactionScheduler/admin/process_scheduled_transactions.cdc (612B) +// transactionScheduler/admin/set_config_details.cdc (5.041kB) +// transactionScheduler/cancel_transaction.cdc (951B) +// transactionScheduler/schedule_transaction.cdc (4.05kB) +// transactionScheduler/scripts/get_canceled_transactions.cdc (134B) +// transactionScheduler/scripts/get_config.cdc (154B) +// transactionScheduler/scripts/get_estimate.cdc (868B) +// transactionScheduler/scripts/get_slot_available_effort.cdc (285B) +// transactionScheduler/scripts/get_status.cdc (235B) +// transactionScheduler/scripts/get_transaction_data.cdc (178B) +// transactionScheduler/scripts/get_transactions_for_timeframe.cdc (259B) package assets @@ -6389,6 +6401,246 @@ func storagefeesScriptsGet_storage_fee_minCdc() (*asset, error) { return a, nil } +var _transactionschedulerAdminExecute_transactionCdc = "\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x74\x90\x4f\x4b\xc3\x40\x10\xc5\xef\xf9\x14\x8f\x1c\x4a\x72\x49\x2f\xe2\xa1\xa8\xc5\xbf\xd0\x83\x20\xb4\xf6\x3e\xdd\x1d\xcd\xc2\x76\x37\x4c\x26\x56\x91\x7e\x77\x49\xf3\xc7\x2a\x64\x4e\xbb\xcc\x9b\xdf\xbc\x79\x6e\x5f\x45\x51\xa4\x4f\x3e\x1e\x36\x42\xa1\x26\xa3\x2e\x86\xb5\x29\xd9\x36\x9e\x25\x4d\x92\xf9\x1c\x8f\x9f\x6c\x1a\x65\x10\xea\xbe\x61\xa1\xbf\x6a\xec\xbe\xa0\x25\x63\x0a\x02\x13\x83\x0a\x19\x2d\x5a\xd8\xa6\x74\x35\x0e\xce\x7b\xec\x18\x86\x7c\x0b\x1b\x00\xdb\x67\x50\xb0\xa7\xf7\x39\x7f\x50\x73\xe7\x63\xd0\x3b\xc1\xea\xa1\x48\xce\x94\x99\xb3\x0b\xbc\xae\x82\x5e\x5e\xe4\xf8\x4e\x00\xa0\x12\xae\x48\x38\xab\x59\x3e\x9c\xe1\x5b\x63\x62\x13\x74\x01\x6a\xb4\xcc\xee\xa2\x48\x3c\x6c\xc9\x37\x9c\x63\xd6\xf7\x86\xc9\xb6\x3c\xeb\x78\xb3\xe0\x1a\x7f\x29\x45\xad\x51\xe8\x9d\x8b\xdd\x89\x73\x75\x62\x4e\xa5\x50\xf4\x29\xe6\x98\x4d\x4a\xd6\x25\x09\xdb\xf1\x7f\x93\xbd\x49\xdc\x2f\x26\x83\x1d\xf6\xbf\x90\x96\xf9\xe8\xb9\xad\xe5\x12\x15\x05\x67\xb2\xf4\x3e\x36\xde\x22\x44\x45\x67\x72\x12\x96\xe6\xc9\x88\x18\x4f\x2e\xfa\xc8\x37\xff\x32\x76\xb6\xdb\x77\x4c\x8e\x3f\x01\x00\x00\xff\xff\x49\x42\x5e\xf8\x43\x02\x00\x00" + +func transactionschedulerAdminExecute_transactionCdcBytes() ([]byte, error) { + return bindataRead( + _transactionschedulerAdminExecute_transactionCdc, + "transactionScheduler/admin/execute_transaction.cdc", + ) +} + +func transactionschedulerAdminExecute_transactionCdc() (*asset, error) { + bytes, err := transactionschedulerAdminExecute_transactionCdcBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "transactionScheduler/admin/execute_transaction.cdc", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x75, 0xd1, 0x2c, 0xc4, 0x3b, 0x54, 0x38, 0xa, 0xd6, 0x8e, 0xce, 0xc5, 0x77, 0xa6, 0xd6, 0x8c, 0xaf, 0x49, 0x28, 0xf9, 0x9b, 0x22, 0xf0, 0xfe, 0x88, 0xae, 0x7b, 0x9e, 0xf2, 0x2a, 0x7f, 0xaa}} + return a, nil +} + +var _transactionschedulerAdminProcess_scheduled_transactionsCdc = "\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x74\x91\x41\x6f\xe2\x30\x10\x85\xef\xf9\x15\x4f\x39\xa0\xe4\x12\xee\x68\x77\x11\xbb\xd2\xde\x2a\x21\x81\xb8\x0f\xf6\x50\x5b\x32\x76\x34\x9e\x40\xab\x8a\xff\x5e\x05\x82\xdb\x1e\x32\x37\xdb\x6f\xbe\x79\x7e\xe3\xcf\x7d\x12\x45\xfd\x3f\xa4\xeb\x5e\x28\x66\x32\xea\x53\xdc\x19\xc7\x76\x08\x2c\x75\x55\x2d\x97\xd8\x4a\x32\x9c\x33\xf2\x74\x6d\xa1\x5f\xda\x8c\xe3\x3b\xd4\x31\xe6\x18\x30\x29\xaa\x90\xd1\x6e\x64\xed\x9d\xcf\xb8\xfa\x10\x70\x64\x18\x0a\x23\xed\x09\x38\xbc\x80\xa2\x05\x85\x30\x37\x4a\x1d\x29\xb2\x4b\x43\xb0\x63\xff\x08\xe4\x37\x36\x83\xb2\x2d\xd0\xfe\xe1\x96\x6d\x87\x4d\x04\x5f\x38\x2a\x4e\x49\xc0\x64\x5c\x11\xf1\xd9\xab\xb2\xed\xaa\x6f\x78\x7c\x54\x00\xd0\x0b\xf7\x24\xdc\x64\x96\x8b\x37\xbc\x31\x26\x0d\x51\x57\xa0\x41\x5d\xf3\x37\x89\xa4\xeb\x81\xc2\xc0\x2d\x16\xd3\x5b\x3b\x75\x8e\x15\x58\x8b\x79\xc1\x6f\xfc\xa4\x74\x59\x93\xd0\x2b\x77\xc7\x3b\xe7\xd7\x9d\x39\x17\x5c\x37\xe5\xde\x62\x31\x2b\xd9\x39\x12\xb6\xe5\xfc\xa7\x39\x49\x3a\xaf\x66\x77\xf1\x9c\xbf\x25\x75\x6d\xf1\x3c\xd6\x7a\x8d\x9e\xa2\x37\x4d\xfd\xef\x9e\x6e\x4c\x8a\x87\xc9\x59\x58\xdd\x56\x05\x51\xbe\xdc\x4d\xf1\x37\x0f\xfc\xad\xba\x7d\x06\x00\x00\xff\xff\xe6\x23\x98\xe1\x64\x02\x00\x00" + +func transactionschedulerAdminProcess_scheduled_transactionsCdcBytes() ([]byte, error) { + return bindataRead( + _transactionschedulerAdminProcess_scheduled_transactionsCdc, + "transactionScheduler/admin/process_scheduled_transactions.cdc", + ) +} + +func transactionschedulerAdminProcess_scheduled_transactionsCdc() (*asset, error) { + bytes, err := transactionschedulerAdminProcess_scheduled_transactionsCdcBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "transactionScheduler/admin/process_scheduled_transactions.cdc", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xd3, 0x88, 0xa6, 0xbb, 0x78, 0x1a, 0xe, 0xdb, 0xa5, 0x14, 0x78, 0xc5, 0x38, 0x2, 0x48, 0xbd, 0xc6, 0x5c, 0x6a, 0x8b, 0x5a, 0x66, 0xeb, 0xa5, 0x58, 0xf5, 0xb9, 0xe0, 0x5e, 0x98, 0x35, 0x39}} + return a, nil +} + +var _transactionschedulerAdminSet_config_detailsCdc = "\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xcc\x58\x4d\x6f\xe3\x36\x10\xbd\xfb\x57\xcc\xe6\xb0\xb0\x01\xd7\xb9\x14\x45\x61\x34\x0d\xba\xe9\xa6\x0d\xe0\x00\x8b\xb8\xe9\x65\xb1\x07\x46\x1a\x49\x04\x28\x52\xe0\x87\x95\x74\xe1\xff\x5e\x48\x94\x25\x52\x5f\x91\x02\x2f\x76\x7d\x92\xc9\xc7\x37\xc3\x37\xe4\x90\x43\x9a\x66\x42\x6a\xb8\xb8\x65\x22\xff\x47\x12\xae\x48\xa0\xa9\xe0\xfb\x20\xc1\xd0\x30\x94\x17\x8b\x85\x6e\x9a\x97\x0b\x70\x7e\x29\x79\xa6\xa9\x49\xef\x78\x48\x0f\x34\x34\x84\x7d\x8c\x22\x21\xf5\x16\x1e\xef\xb8\xfe\xe5\xe7\xeb\xb5\x8f\xa6\xbc\x40\x7f\x7c\xc6\xc0\x14\x5c\xa3\x60\xc5\x84\xde\x27\x44\x62\x68\x61\x3b\x9a\xd2\x21\x6c\x26\xa9\x90\x54\xbf\x58\xe4\x03\x2a\x94\x07\xdc\xc2\xd7\x02\xfc\xeb\x69\xcc\x71\x74\x50\x45\x3f\x3e\x24\x25\xcf\x7f\x12\x4d\xf6\xf4\x3f\xbc\xff\xb0\x85\xc7\x5b\xfa\x3c\xe8\xcb\x2d\xe2\xbd\x61\x9a\x66\x8c\xa2\x54\x0e\x73\x39\xa8\xcd\x2c\x31\x32\x3c\x6c\x06\x0c\x90\x07\x84\x07\xc8\x30\x74\xe2\xa4\x1c\x61\xda\x68\xc1\x18\x06\x8d\xd2\x63\x12\x36\xd8\x1e\xee\x82\x7a\x05\x5f\x17\x76\x7e\x98\x11\x89\x4b\x12\x04\xc2\x70\xbd\x05\x62\x74\xb2\xfc\x20\xa4\x14\xf9\xbf\x84\x19\x5c\xc3\x9e\x1c\xb0\xfa\xbc\x53\xca\xe0\x5e\x0b\x49\x62\xbc\x21\x19\x79\xa2\x8c\xea\x97\x1b\xc1\xb5\x2c\x0c\xca\x35\x7c\x32\x4f\x8c\xaa\xa4\xe9\x5c\xc3\x5f\xa8\x47\x86\xac\xe0\xfd\x1f\xd6\xf6\xc9\xa5\xe2\x77\x79\x09\x4f\xa5\x0f\x40\x38\x20\xd7\x54\x33\x0c\x0b\x59\x51\x22\x0f\x10\xb4\x00\x9d\x20\xd8\x15\x55\xaf\x6d\x90\xa8\x84\x91\x01\xd6\x3c\x0c\x35\xa8\x53\xf7\x03\x46\x70\x05\xd5\x4c\x37\xca\xfa\xb4\xb1\x76\x7e\x2b\xe7\x3d\xb4\x69\x36\x8f\x59\x48\x34\xde\x08\x1e\xd1\x78\x05\xef\x07\x71\x2d\x87\x7e\x5f\x46\x52\xa4\x5b\xb8\xac\x8c\x5d\x2a\xbf\x7f\xe5\x05\xed\xfa\x1a\x32\xc2\x69\xb0\xbc\xb8\x11\x86\x85\xc0\x85\x3e\xa9\xe0\xcd\x7c\x68\xd6\x17\xab\x85\x2b\x60\x8c\xba\x14\x29\x30\x52\x22\xd7\x10\x94\xde\x7b\xd2\x54\x5d\x76\x5e\x70\x05\x83\xf3\x8a\xb1\x02\x2d\x1d\x1b\x05\x43\x42\xe3\xe4\x81\xd8\xa5\x32\x46\xf0\xa9\xda\x47\x9b\xbf\x69\x9c\x6c\x64\x35\xc2\xa3\x4a\x31\xa4\x26\x9d\x45\x76\x5f\x0e\xe9\xa7\x63\x22\x9f\xc5\xb5\x13\x79\x43\x54\x33\x1d\x88\x04\x8e\x79\x95\x84\x8a\x8d\xff\x2a\x53\x9d\x6e\xe0\xca\x59\xd1\xc5\x6f\x9a\x3a\x5b\x3f\x2c\x9b\xde\x74\xf8\x79\x1a\xd7\x97\x77\xeb\x99\x1e\x58\x49\xcf\xe5\x83\x65\x9b\xef\xc5\x4e\xe4\xe7\x72\x61\x27\xf2\x2f\xef\x6a\xf3\xc7\x76\x64\xcb\x9c\xf8\x03\xc4\xb5\xf4\xe3\xbb\x46\x75\xaa\x07\xdf\x2c\xa6\x53\x1d\x78\x25\xa2\xfe\x39\x3d\x25\xac\xf6\x0c\x3f\x73\x58\xfd\x1b\xc3\x77\x8a\xec\x6c\x27\xbe\x41\x70\x67\xfb\xd0\x8e\x6f\xfd\x49\xa3\x32\xb3\xcb\x2a\x19\xc3\x55\xff\x55\xb1\x15\x46\x27\x7d\x77\x42\x3c\x27\xcc\x27\xb3\x9f\xdd\x33\xaf\xad\xd4\xbc\xa0\xd5\x94\xfe\xd9\xf7\x36\xd2\x32\x04\x35\xa3\x73\xfc\x39\x62\xfa\x1b\xe6\xd8\x56\x96\x95\xc9\xb0\xa3\x6b\xb9\x31\xbb\xaa\xee\x4e\xe8\xb7\x6b\x6a\x0d\x9e\x51\xd1\x8a\xf0\x6c\x7a\x56\x7c\x6f\x52\x33\x6d\x56\xbd\x23\xa9\xbf\x1d\xba\xaa\xde\x7b\xa3\xde\x2e\xad\x63\xfd\x8c\xfa\xba\xac\x67\x13\xd9\x25\x9d\xa6\xb4\x7b\xcf\x0d\x24\x12\x8d\x40\x0a\xf1\xaa\x4b\xee\x1a\x04\x67\x2f\x60\x8a\x5b\x3b\xe5\x71\x79\x0d\x8e\x28\xb2\x50\x81\x4e\x88\x06\x22\x11\x32\x29\x0e\x34\xc4\x10\x88\x02\x2e\xf8\x4f\x9c\x32\x20\x32\x36\x29\x72\xad\x6c\x81\x41\x15\x38\xb5\xb2\x77\xbb\xe4\x98\xdb\x34\xb7\x1d\x9e\xe4\xeb\xd7\xea\xea\x4e\x3d\xad\x08\x1f\xe8\x28\xca\x06\x3f\xf1\x0e\x00\xa7\x55\xef\xfd\xed\x3d\x46\x7a\x71\x93\x8a\xfe\xde\xe6\xae\x85\x5e\xd8\xa4\x97\x02\x27\xe3\x4f\x78\x24\xa8\x33\xd9\xe8\xeb\x80\xf7\xb7\x57\xf3\xa6\x7b\xda\x13\x82\xbf\xd7\x5f\x7b\x40\x68\xb7\x74\x5d\x68\x23\x26\xbf\x35\x0c\x76\x75\x6d\x0c\x42\x27\x3d\x55\xf4\x36\xf7\x18\xe9\x83\xcd\x78\xdf\x18\xe9\x1c\x33\xd6\x01\xd7\x16\xfd\xba\x5a\x55\x75\x75\x93\x6e\xea\x5e\xf7\xa9\x61\xa3\xea\x9a\xd9\x49\x16\xf5\xa7\x2d\xfd\x8f\x8b\xe3\xff\x01\x00\x00\xff\xff\x26\xc5\x10\x4a\xb1\x13\x00\x00" + +func transactionschedulerAdminSet_config_detailsCdcBytes() ([]byte, error) { + return bindataRead( + _transactionschedulerAdminSet_config_detailsCdc, + "transactionScheduler/admin/set_config_details.cdc", + ) +} + +func transactionschedulerAdminSet_config_detailsCdc() (*asset, error) { + bytes, err := transactionschedulerAdminSet_config_detailsCdcBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "transactionScheduler/admin/set_config_details.cdc", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x9e, 0x5a, 0xca, 0x67, 0x33, 0xc, 0x17, 0xe7, 0x73, 0x8b, 0x3f, 0x41, 0x64, 0xa5, 0x5c, 0x62, 0xeb, 0x35, 0xb, 0xe, 0x6, 0x4d, 0xf9, 0xd7, 0x60, 0xd, 0xc4, 0xc1, 0xd5, 0x2d, 0x7a, 0x23}} + return a, nil +} + +var _transactionschedulerCancel_transactionCdc = "\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x8c\x93\x41\x6e\xdb\x3c\x10\x85\xf7\x3a\xc5\xfb\xbd\x08\x6c\x20\xbf\xbc\x29\xba\x30\xd2\x06\xae\xe3\x24\xde\xc8\x81\x45\x27\x6b\x5a\x1c\x5b\x44\x69\x52\x20\x87\x09\x8c\x22\x67\xe8\xbe\xab\x1e\xa3\xe7\xe9\x05\x7a\x85\x82\x92\x63\x3b\x45\x5b\x94\x2b\x61\xe6\xf1\xbd\x8f\x43\x4a\x6f\x1b\xe7\x19\xbd\x6b\xe3\x9e\x84\x97\x36\xc8\x8a\xb5\xb3\x65\x55\x93\x8a\x86\x7c\x2f\x7b\x51\x08\x0a\x9c\x54\x2f\x2d\x75\x22\xbf\x95\x56\xbd\x12\xb7\x76\xee\x23\xd9\x93\x52\xb4\x1b\xbd\x32\xb4\x2f\x67\xc3\x21\xbe\x7f\xf9\xfa\xe3\xdb\x67\xe0\x61\xbc\x28\x66\xc5\xcd\x08\xcb\xa2\x1c\x5f\x4f\x71\x3d\x5f\xe0\x6e\x31\xbf\x5a\x4e\xc4\x6c\x5e\xec\x65\x69\x83\xa8\x75\x00\x1f\x73\x11\x03\x05\x48\x88\x69\x29\x30\x99\x17\x62\x31\x9e\x08\x48\xab\x10\x6a\x17\x8d\x42\x31\xbd\x9f\x2e\xb0\xa2\x24\x54\xd0\x16\x8d\x77\x2a\xb6\x7b\xff\xfb\xad\xa1\x0e\x50\x14\xf4\xc6\x92\x42\x70\x86\xcc\x0e\x6b\xe7\xc1\x14\x58\xdb\x0d\xfe\x34\x26\xac\xa3\x6d\x2b\xd2\x68\xde\x25\xe7\x04\x51\x39\xcb\x52\xdb\x80\x68\x83\x5c\x13\xf4\xb6\x31\xb4\x25\xcb\x32\x49\x03\xb8\x96\x8c\xaa\x05\x35\x24\x15\xd8\xc1\xb8\x10\xe0\xd6\xc9\x4f\x05\x38\x8f\x40\x55\xf4\x9a\x77\x78\x8c\xc6\x92\x97\x2b\x6d\x34\x6b\x0a\x79\x36\x1c\xa6\x9c\xab\x39\x8a\xb9\xc0\xb2\x9c\x42\xdc\xce\x4a\x88\xc5\xb8\x28\xc7\xdd\xe0\x66\xc5\xc9\x18\xd3\x79\xb3\x93\xa3\xf6\xb5\x1a\x61\x39\xb3\xfc\xf6\xcd\x00\x9f\xb2\x0c\x00\x1a\x4f\x8d\xf4\xd4\x97\x55\xe5\xa2\xe5\x11\x64\xe4\xba\xff\xc1\x79\xef\x9e\xee\xa5\x89\x74\x8e\x52\x3e\xd2\xfe\x73\x16\x42\xa4\x92\x9d\x97\x1b\x9a\xc8\xa6\x43\xdb\x4d\x9c\x65\xef\x8c\x21\x7f\x8e\xbb\xb8\x32\x3a\xd4\xc7\xe6\x39\x6e\x88\xff\xb2\x65\x80\xb3\x71\x97\x7d\x60\x4a\xcb\x10\xe3\x51\x46\xc3\x78\x87\x3d\x5b\x1e\x3a\x97\x7c\xd5\xd2\x5d\xb4\xa4\xaf\xde\x58\xfe\xa0\xb9\x56\x5e\x3e\x0d\x70\x76\x78\x8f\xf9\x7d\xb2\x79\xdf\x5f\x7b\xb7\x1d\x61\xb8\x37\x19\xae\x5f\xfa\x6d\x7b\x70\x08\x4e\xeb\xf2\x12\x8d\xb4\xba\xea\xf7\x26\xed\x55\x59\xc7\xe8\x42\x71\xb0\xed\xe8\x7a\x83\x23\x72\x5b\xc8\x15\x35\x2e\x68\xde\xc7\x5d\xfc\xff\x0f\x3f\x51\x5e\x49\x5b\x91\x11\xbf\xdc\x94\x56\x83\x0e\xeb\x39\x7b\x46\xf6\x33\x00\x00\xff\xff\x64\x39\xde\x99\xb7\x03\x00\x00" + +func transactionschedulerCancel_transactionCdcBytes() ([]byte, error) { + return bindataRead( + _transactionschedulerCancel_transactionCdc, + "transactionScheduler/cancel_transaction.cdc", + ) +} + +func transactionschedulerCancel_transactionCdc() (*asset, error) { + bytes, err := transactionschedulerCancel_transactionCdcBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "transactionScheduler/cancel_transaction.cdc", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xec, 0xd3, 0xe, 0xb2, 0xbd, 0x68, 0xec, 0x8c, 0x8c, 0x1e, 0x56, 0x2c, 0xd4, 0x3c, 0xfa, 0x21, 0x7b, 0xd0, 0xb0, 0xa3, 0x7c, 0x96, 0xc, 0x70, 0x2b, 0xa2, 0x30, 0xb9, 0x2d, 0x93, 0xb8, 0x4b}} + return a, nil +} + +var _transactionschedulerSchedule_transactionCdc = "\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xbc\x56\xcd\x6e\x1b\x37\x10\xbe\xef\x53\x8c\x7d\x08\x56\x80\x22\xf5\x50\x14\x85\x60\xc7\x51\x15\x39\xd1\x45\x36\x24\x39\x41\x51\xf4\x40\xed\xce\x6a\xd9\xac\xc8\x05\x39\xb4\x2c\x04\x7e\x86\xde\x7b\xea\x63\xf4\x79\xfa\x02\x7d\x85\x82\xe4\xfe\x4a\xeb\x58\x4d\xda\xee\x45\x14\x39\x9c\xbf\xef\x9b\xe1\xf0\x6d\x2e\x15\xc1\xf9\x75\x26\x77\x2b\xc5\x84\x66\x11\x71\x29\x96\x51\x8a\xb1\xc9\x50\x9d\x07\xa5\xc4\x0a\x35\x59\xa9\xf2\x28\x6e\x88\xbf\x63\x22\x6e\x09\x3b\x75\xf2\x23\x8a\xc6\x96\x11\x1b\xbe\xce\xb0\xd8\x0e\x86\x43\xf8\xf3\xb7\xdf\xff\xfa\xe3\x57\x80\x0f\xe3\xc5\x7c\x36\x7f\x3b\x82\xbb\xf9\x72\x7c\x3d\x85\xeb\x9b\x05\xdc\x2e\x6e\xde\xdc\x4d\x56\xb3\x9b\x79\x21\x66\x2f\xac\x52\xae\x81\x6a\xbb\x60\x34\x6a\x60\xb0\x9a\x2e\x57\x30\xb9\x99\xaf\x16\xe3\xc9\x0a\x98\x88\x41\xa7\xd2\x64\x31\xcc\xa7\xef\xa7\x0b\x58\xa3\x15\x8c\x81\x0b\xc8\x95\x8c\x8d\xbb\x7b\xd6\xa9\x90\x6b\x88\x51\xf3\x8d\xc0\x18\xb4\xcc\x30\xdb\x43\x22\x15\x10\x6a\xe2\x62\x03\x4f\xa5\x09\x12\x23\xdc\x0e\xcb\x38\xed\xad\x66\xeb\x44\x24\x05\x31\x2e\x34\x18\xa1\x59\x82\xc0\xb7\x79\x86\x5b\x14\xc4\xac\xa8\x06\x4a\x19\x41\xe4\x1c\xcd\x90\xc5\x40\x12\x32\xa9\x35\xc8\xc4\xea\x8b\x35\x48\x05\x1a\x23\xa3\x38\xed\xe1\xde\x64\x02\x15\x5b\xf3\x8c\x13\x47\x3d\x08\x86\x43\x6b\xe7\xcd\x0d\xcc\x6f\x56\x70\xb7\x9c\xc2\xea\xdd\x6c\x09\xab\xc5\x78\xbe\x1c\xfb\xc4\xcd\xe6\x8d\x34\x9e\xf9\x0b\x43\x28\x9d\xb6\x89\x6b\x86\xee\xe2\x4c\x11\x4e\x00\xda\x45\xa6\x58\x44\x56\xa1\x53\xea\x12\xc9\x35\xfc\x62\x34\x01\x13\x80\x0f\xcc\x06\xdb\x32\xe0\xc2\xf5\x88\xd5\x02\x4d\x4d\x30\x4b\x60\x2f\x0d\xec\x98\x20\x9b\x0c\x5d\x78\x60\x37\x15\xc8\x9d\x68\xaa\xd3\x7d\x27\x2b\x10\x5d\xe2\x62\xbc\xc7\x4c\xe6\xb5\x68\x4b\xb1\x33\x9d\x32\x1b\xb2\x42\x2d\x8d\x8a\xd0\xef\x55\x90\x68\x17\xfb\x53\xf8\x0e\x3a\x72\xc0\x05\xa1\x4a\x58\x84\xb5\x85\x0a\x70\xe7\x45\x64\x34\xc9\x2d\x44\x32\x2e\x8c\x15\xa4\x5c\x23\xe0\x03\x46\x86\x30\x86\x5d\x8a\xc2\x59\x3e\x20\x61\x19\x7a\x3c\x70\xda\x7f\xb4\xfa\x9a\x22\x3b\x9e\x65\x90\x49\xf9\x11\x34\xdf\xf2\x8c\x29\x9b\x03\xb2\x20\x48\x81\x7d\x58\x1b\xf2\x22\x46\xe3\x81\x33\x3e\x2b\x8e\x9f\xb4\xcf\x51\x3b\xfd\x5c\x68\xb2\x0c\x94\xc9\x29\xf0\x07\x41\xc3\x95\x90\xf8\x16\x35\xb1\x6d\x3e\x82\xbb\x6b\xfe\xf0\xdd\xb7\x7d\x48\x10\xc7\x5b\x69\x04\xd5\x5b\x98\x24\x52\xd9\xff\x33\x41\xf6\x7f\xae\xb8\xb4\xbc\xf6\x3b\xdf\xf7\x5d\x89\xbd\x61\xc4\x46\x30\x16\xfb\x25\x29\x13\xd1\x55\x0f\x3e\x05\x01\x00\x40\xae\x30\x67\x0a\x43\x16\x45\x5e\x2d\x33\x94\x86\x3f\x48\xa5\xe4\xee\x3d\xcb\x0c\xf6\x61\xc9\xee\xb1\x58\xce\xb4\x36\xb8\x24\xa9\xd8\x06\x27\x2c\xf7\x35\xb3\x9f\xd8\xd0\x65\x96\xa1\xea\xc3\xad\x59\x67\x5c\xa7\xf5\x61\x1f\xde\x22\x7d\xe6\x4a\x0f\x5e\x8c\xbd\x6d\xeb\x13\x14\x5f\xb5\xf0\xdc\x6d\xd7\x53\x5a\xf0\xc4\xd2\x4e\x48\x82\x35\xa2\x80\x48\x21\xb3\xb8\xfb\x62\xe3\x1a\x8a\x88\x60\x8f\xd4\x2f\x4e\x1d\x84\x4d\xd5\x9a\xa4\x42\xe0\xd4\x77\xa8\x71\x1b\x1d\x30\x88\x2a\x37\x3d\xbb\x1c\xde\x65\xab\x23\x59\x2a\x3b\x20\x57\xa5\x97\x27\x70\x56\x18\x1f\x68\x1f\xf8\x20\x4a\x31\xfa\x78\xf1\xfa\x04\x0a\x0c\x8a\xdf\x57\x61\xa2\xe4\x76\x74\x0a\x6b\xca\x2b\x45\x96\x6f\x19\xa5\xcd\x5c\xda\x2f\x43\xaa\xd2\x76\xf1\xf2\x24\xa5\x3e\xca\xe2\x5f\xd8\x3b\x86\xc6\x7e\x87\x71\x6a\x76\x8f\xe1\xc5\xcb\xc2\x54\x1f\x48\x7e\x71\x04\x9d\x76\x2a\x68\x6c\xa3\x2e\x8d\x3a\xdc\x2e\x1c\x71\x9f\x6c\x33\x53\xdf\x17\x7a\xf0\xe2\xd3\x3f\x68\x45\x8f\xaf\xc2\xaf\xf5\xfe\x31\x68\x12\xee\x2d\x92\xe3\xcd\x57\x52\xac\x01\xe7\x84\xe5\x70\xf9\xd9\xfc\xb4\x12\x79\xf8\x0d\x36\x48\x75\x31\xea\x30\x91\xca\xfa\xff\xc5\xa8\xfd\xf4\xcd\xcf\x9f\xb7\xd7\x88\x9c\xe9\x33\xa8\x5b\xc2\x7f\x04\x60\x67\x4b\x59\xbb\xfe\xe6\xde\xac\x04\x15\x0a\xfb\x68\x49\x97\xed\x7b\x66\x32\xea\xc0\xc4\xb6\x95\x04\x51\xb7\x20\xf0\xc2\x97\x47\x55\xe0\xd5\x17\x01\x35\xa7\xb3\xc1\x07\x4e\x69\xac\xd8\xae\x07\x2f\xaa\x49\x6e\xf0\xde\xaa\x29\xeb\x7d\x58\x28\x19\x26\xe5\xb9\x3b\x6e\x97\xc3\xd5\x15\xe4\x4c\xf0\x28\x3c\x9f\xb8\x87\xcf\x75\x41\x1f\x53\xa5\xd6\x7b\x77\xde\x51\xb8\xd6\x75\x1b\x8b\xed\x04\x4e\x68\xb0\x2b\xdc\x0a\x59\xf1\xb8\x54\xef\x4c\xcf\xa1\xf4\xfa\xc0\xd9\x96\xaa\xf2\xc1\x99\x0a\xb3\x85\xcb\xa7\x5f\xfa\xdb\x42\x2e\x54\xcc\x3f\x2d\xa3\xea\xea\x51\x74\xcf\x2a\x19\xbc\xe3\x9b\x34\x68\xf6\x5c\xeb\x4a\xcc\x88\x2d\x49\xd9\x81\xf2\xb2\x7a\xf7\x80\xe9\x2b\x28\x76\xdb\x5d\x91\x27\xad\x1b\x97\x70\x5e\x4e\x07\xe7\x07\x92\x05\x6f\x4a\x3f\x8e\x06\x0b\x3f\x85\xd4\xf3\x9f\x90\x94\xa2\xea\xac\xdd\x66\xea\x74\x47\x71\x59\x54\x9e\x0c\xbf\xbc\x10\x76\x16\x59\xdd\x12\x46\x8d\x75\xbf\x53\x36\x76\x13\xc1\x73\x52\x8d\x11\xa4\x5a\x76\x4b\xd6\x63\x47\x93\x0f\xdd\xb2\x7e\x48\xe3\x52\x4c\x8b\xd9\xc5\xcf\x30\xdd\xc2\x96\xa9\x23\xb8\x78\xd9\xaa\xbe\xf2\xeb\x1d\xed\x9c\xd2\xb7\x58\x1c\x77\x1d\x87\x35\x1c\x0f\xd6\x62\x17\x3a\xc7\x06\x15\x92\x51\x6d\x78\x1f\x83\xe3\xd5\x21\x7b\x14\x6e\x8c\x9b\x2e\x5b\xb3\x27\xa5\xee\x70\xcb\x78\x63\xce\x2e\x55\xfc\x8b\x8c\x39\x85\x29\x9e\x21\x65\x15\xb5\xcf\x9e\xe7\xc5\x29\x7c\x38\x89\x07\x9d\xf8\xd7\x30\xfc\x2f\x78\x3f\x06\x8f\x10\xfc\x1d\x00\x00\xff\xff\xa8\x48\xf3\x78\xd2\x0f\x00\x00" + +func transactionschedulerSchedule_transactionCdcBytes() ([]byte, error) { + return bindataRead( + _transactionschedulerSchedule_transactionCdc, + "transactionScheduler/schedule_transaction.cdc", + ) +} + +func transactionschedulerSchedule_transactionCdc() (*asset, error) { + bytes, err := transactionschedulerSchedule_transactionCdcBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "transactionScheduler/schedule_transaction.cdc", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xee, 0xed, 0xe6, 0x9c, 0x16, 0x59, 0x6e, 0xe6, 0xbf, 0x93, 0xdd, 0x7, 0xb2, 0xa1, 0x82, 0x48, 0xba, 0x38, 0x11, 0x1f, 0xe1, 0xee, 0x2c, 0x4e, 0xbc, 0x51, 0xe0, 0x63, 0x4b, 0x84, 0x24, 0x79}} + return a, nil +} + +var _transactionschedulerScriptsGet_canceled_transactionsCdc = "\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x74\xcc\xb1\x0a\x02\x31\x0c\x06\xe0\xbd\x4f\xf1\x73\x53\xbb\x38\x89\x83\xab\x20\x38\xab\x93\x38\x84\x5c\xd4\x42\x2e\x95\x34\xc5\x41\x7c\x77\x57\x17\xe7\x0f\xbe\xba\x3c\x9b\x07\xa6\xbd\xb6\xd7\xc9\xc9\x3a\x71\xd4\x66\x47\x7e\xc8\x3c\x54\x7c\x4a\x89\x98\xa5\xf7\x4c\xaa\x05\xb7\x61\x58\xa8\x5a\x2e\x5b\x5c\xce\x07\x8b\xcd\xfa\x8a\x77\x02\x00\x97\x18\x6e\xf8\x17\xad\xee\x12\x3b\x32\x16\x95\xf9\xc7\x7b\x2e\xe9\x93\xbe\x01\x00\x00\xff\xff\x9e\x4c\xe2\x31\x86\x00\x00\x00" + +func transactionschedulerScriptsGet_canceled_transactionsCdcBytes() ([]byte, error) { + return bindataRead( + _transactionschedulerScriptsGet_canceled_transactionsCdc, + "transactionScheduler/scripts/get_canceled_transactions.cdc", + ) +} + +func transactionschedulerScriptsGet_canceled_transactionsCdc() (*asset, error) { + bytes, err := transactionschedulerScriptsGet_canceled_transactionsCdcBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "transactionScheduler/scripts/get_canceled_transactions.cdc", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xfc, 0x9b, 0x9f, 0xe6, 0x50, 0x13, 0xe7, 0xe6, 0x1e, 0x8d, 0x98, 0xf7, 0xea, 0x56, 0x68, 0x19, 0xa4, 0x52, 0x5a, 0xaf, 0x34, 0xc5, 0x78, 0x70, 0xef, 0x8a, 0x98, 0xe8, 0xd0, 0xb6, 0x8e, 0xef}} + return a, nil +} + +var _transactionschedulerScriptsGet_configCdc = "\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xca\xcc\x2d\xc8\x2f\x2a\x51\x50\x72\xcb\xc9\x2f\x0f\x29\x4a\xcc\x2b\x4e\x4c\x2e\xc9\xcc\xcf\x0b\x4e\xce\x48\x4d\x29\xcd\x49\x2d\x52\xe2\xe2\x4a\x4c\x4e\x4e\x2d\x2e\xd6\x48\xcc\xc9\xd1\x54\x48\x2b\xcd\x53\xc8\x4d\xcc\xcc\xd3\xd0\xb4\x52\xa8\xc6\xa5\x47\x0f\xce\x72\xce\xcf\x4b\xcb\x4c\xaf\x55\xa8\xe6\x52\x50\x50\x50\x28\x4a\x2d\x29\x2d\xca\x53\xc0\xa9\x2d\x3d\xb5\x04\xa2\x41\x43\x93\xab\x96\x0b\x10\x00\x00\xff\xff\x07\x8b\x23\x23\x9a\x00\x00\x00" + +func transactionschedulerScriptsGet_configCdcBytes() ([]byte, error) { + return bindataRead( + _transactionschedulerScriptsGet_configCdc, + "transactionScheduler/scripts/get_config.cdc", + ) +} + +func transactionschedulerScriptsGet_configCdc() (*asset, error) { + bytes, err := transactionschedulerScriptsGet_configCdcBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "transactionScheduler/scripts/get_config.cdc", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x6e, 0x18, 0xb2, 0x51, 0x67, 0xa4, 0x59, 0x90, 0x29, 0xea, 0x3c, 0x4d, 0x90, 0x71, 0xe3, 0xf9, 0x58, 0x1, 0xce, 0x17, 0x11, 0x36, 0x48, 0x96, 0x53, 0xcc, 0x7e, 0x54, 0xe3, 0x6f, 0x89, 0x97}} + return a, nil +} + +var _transactionschedulerScriptsGet_estimateCdc = "\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xa4\x92\x4d\x6b\xfa\x40\x10\xc6\xef\xf9\x14\x43\x4e\xbb\x10\x44\x45\xe4\x4f\x40\xfe\xf4\xa0\x54\x50\x28\x58\x6f\xbd\x6c\x37\x9b\x3a\x90\xdd\x95\xdd\x59\x5f\x28\x7e\xf7\x92\x17\xd3\x54\xd1\x52\xbc\x0c\xcb\x33\xc3\xef\x99\x4c\x1e\xd4\x5b\xeb\x08\xe2\x59\x61\xf7\xaf\x4e\x18\x2f\x24\xa1\x35\x2b\xb9\x51\x59\x28\x94\x8b\xa3\x48\x48\xa9\xbc\x67\xa2\x28\x38\xe4\xc1\x80\x16\x68\x58\x04\x00\x90\x09\x12\x29\x3c\x99\xe3\x8a\x5c\x90\xf4\x3f\xa9\x54\x42\xad\x3c\x09\xbd\x4d\x61\x3d\xc3\xc3\x78\x54\xcb\x5b\x87\xd6\x21\x1d\x53\x58\xcf\x0d\xfd\xab\x45\x75\x50\x32\x94\x86\xd3\x3c\xb7\x8e\xea\xde\x78\x14\xf1\x14\x6e\x6d\xd4\x9b\x7a\x42\x2d\x48\x65\x67\x29\xeb\x8c\xc1\x67\xc5\xdd\x09\xd7\x1a\x4e\x4d\xd0\x77\x70\x2f\xcd\x18\x4c\x7e\x9f\xe9\x3d\xe3\xc7\xa6\x32\xc0\xbc\xe5\xc3\x64\x02\xfd\xc6\xb7\xfb\xa1\xa5\xef\xdf\xa0\x27\x50\x85\x57\x97\xec\xc1\x23\xec\xa5\xca\x30\xe8\x3b\xf4\xe1\x23\xf4\x85\xdd\x77\xd1\x1d\x92\x30\x28\x59\x3c\x37\x3b\x51\x60\xd6\xf9\xf7\x6f\xec\xfc\xe6\x3d\x58\x06\x4f\xf0\xae\xa0\x0f\xac\xbc\x01\x4f\x60\x00\xac\xde\x98\x27\x60\x1d\x0c\x81\x2d\xec\x9e\xc7\xbc\x76\xa9\x6a\x55\x9c\xa2\xe0\xcc\xed\x0d\x55\x93\x11\xd6\x6e\x54\x67\xb5\xac\x49\xab\x75\x92\xda\x3e\x93\xab\x6b\xa4\x3f\xee\xf2\xdd\xbf\xca\xee\x85\x50\x0d\xf2\xe8\x14\x7d\x05\x00\x00\xff\xff\xbe\x78\xf7\xa7\x64\x03\x00\x00" + +func transactionschedulerScriptsGet_estimateCdcBytes() ([]byte, error) { + return bindataRead( + _transactionschedulerScriptsGet_estimateCdc, + "transactionScheduler/scripts/get_estimate.cdc", + ) +} + +func transactionschedulerScriptsGet_estimateCdc() (*asset, error) { + bytes, err := transactionschedulerScriptsGet_estimateCdcBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "transactionScheduler/scripts/get_estimate.cdc", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xbc, 0x52, 0x3f, 0xf7, 0x87, 0x13, 0xb8, 0x34, 0xb0, 0x46, 0xad, 0xb4, 0x46, 0x6e, 0xb9, 0xc1, 0x87, 0xe4, 0xe, 0x2a, 0xc8, 0x10, 0x4, 0x4f, 0xd0, 0x7b, 0x33, 0x98, 0xbd, 0x8f, 0x9e, 0xb5}} + return a, nil +} + +var _transactionschedulerScriptsGet_slot_available_effortCdc = "\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x74\xce\x31\x4b\xc5\x40\x0c\xc0\xf1\xfd\x3e\x45\x7c\x53\x0f\xc4\xe9\xf1\x90\x82\x83\xc3\x7b\xe0\x26\xd4\xba\xc7\x33\xd5\x40\xee\xae\xe4\x72\xd6\x22\x7e\x77\xc1\x3e\x4a\x97\x4e\xc9\x10\x7e\xf9\x73\x1c\xb3\x1a\x1c\x2e\x92\xa7\x17\xc5\x54\x30\x18\xe7\xd4\x85\x4f\x7a\xaf\x42\x7a\x70\x0e\x43\xa0\x52\x1a\x14\xf1\x30\xd4\x04\x11\x39\x35\xc6\x91\x8a\x61\x1c\x5b\xe8\x2f\xfc\x7d\x3a\xde\xc2\xa8\x9c\x95\x6d\x6e\xa1\x7f\x4a\x76\xef\x97\x79\x3a\xc2\x8f\x03\x00\x10\xb2\xe5\xc4\xe6\x73\xaa\x11\x1e\x60\xef\xe7\xdd\xf3\x55\x6a\x14\xa7\x57\x94\x4a\xed\x8a\xfb\x9b\x7f\x4c\xc9\xaa\xa6\x7d\xe1\x83\xac\x93\x6c\x8f\x5f\xc8\x82\x6f\x42\xe7\x61\xc8\x6a\xdb\xea\x75\xdd\x86\x6f\xfa\xbc\xfb\x75\x7f\x01\x00\x00\xff\xff\x95\xb8\x32\x8e\x1d\x01\x00\x00" + +func transactionschedulerScriptsGet_slot_available_effortCdcBytes() ([]byte, error) { + return bindataRead( + _transactionschedulerScriptsGet_slot_available_effortCdc, + "transactionScheduler/scripts/get_slot_available_effort.cdc", + ) +} + +func transactionschedulerScriptsGet_slot_available_effortCdc() (*asset, error) { + bytes, err := transactionschedulerScriptsGet_slot_available_effortCdcBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "transactionScheduler/scripts/get_slot_available_effort.cdc", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x3, 0x11, 0xb6, 0x24, 0x4e, 0x2e, 0x53, 0x35, 0xf6, 0xa9, 0x7d, 0xfa, 0xcd, 0xd4, 0x98, 0xa0, 0x64, 0xc7, 0x8a, 0xb8, 0x6f, 0xb8, 0x9f, 0x3c, 0x19, 0x5e, 0xa, 0x39, 0x9b, 0x1a, 0xc5, 0xc5}} + return a, nil +} + +var _transactionschedulerScriptsGet_statusCdc = "\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x74\x8e\xb1\x4a\x05\x31\x10\x45\xfb\x7c\xc5\x25\x55\xd2\xbc\x4a\x44\x1e\xc8\x36\x22\x6c\xbd\x6a\x65\x33\x24\x59\x1d\xc8\x4e\x96\x64\xe2\x16\xe2\xbf\x8b\x51\xd8\xca\xa9\x4e\x31\xe7\x70\x79\xdb\x4b\x55\xd8\xc7\x5c\x8e\xa7\x4a\xd2\x28\x28\x17\x59\xc2\x7b\x8a\x3d\xa7\x6a\x8d\xa1\x10\x52\x6b\x8e\x72\xf6\x58\xbb\x60\x23\x16\xc7\xf1\x8a\xe7\x59\xf4\xf6\xc6\xff\xc2\x1d\x3e\x0d\x00\xe4\xa4\x68\x4a\xda\x1b\xee\xf1\x5f\xf5\xf2\x96\x74\x19\x4f\x23\xc4\xd1\x0f\xf7\xe7\xa6\x09\x3b\x09\x07\x67\x67\xf9\xa0\xcc\x11\xf3\xc3\x15\xaf\x8e\xa3\x87\x9e\x29\x48\x51\xac\xa5\x4b\xb4\xa7\x3b\xa0\x26\xed\x55\xfe\x36\x5c\x2a\x1d\x2f\x94\x7b\x32\x5f\xe6\x3b\x00\x00\xff\xff\x20\x9b\x62\x33\xeb\x00\x00\x00" + +func transactionschedulerScriptsGet_statusCdcBytes() ([]byte, error) { + return bindataRead( + _transactionschedulerScriptsGet_statusCdc, + "transactionScheduler/scripts/get_status.cdc", + ) +} + +func transactionschedulerScriptsGet_statusCdc() (*asset, error) { + bytes, err := transactionschedulerScriptsGet_statusCdcBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "transactionScheduler/scripts/get_status.cdc", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xc8, 0x95, 0xd, 0x46, 0xb2, 0xfc, 0xdd, 0xef, 0x2c, 0x74, 0x67, 0x7e, 0x88, 0x8d, 0x43, 0x8e, 0x27, 0xaa, 0x26, 0xb6, 0x64, 0xa, 0x3f, 0xd8, 0x35, 0xd7, 0x9, 0x83, 0xfc, 0x2b, 0x52, 0x1f}} + return a, nil +} + +var _transactionschedulerScriptsGet_transaction_dataCdc = "\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xca\xcc\x2d\xc8\x2f\x2a\x51\x50\x72\xcb\xc9\x2f\x0f\x29\x4a\xcc\x2b\x4e\x4c\x2e\xc9\xcc\xcf\x0b\x4e\xce\x48\x4d\x29\xcd\x49\x2d\x52\xe2\xe2\x4a\x4c\x4e\x4e\x2d\x2e\xd6\x48\xcc\xc9\xd1\x54\x48\x2b\xcd\x53\xc8\x4d\xcc\xcc\xd3\xc8\x4c\xb1\x52\x08\xf5\xcc\x2b\x31\x33\xd1\xb4\x52\xc0\xa5\x59\x0f\x49\xd0\x25\xb1\x24\xd1\x5e\xa1\x9a\x4b\x41\x41\x41\xa1\x28\xb5\xa4\xb4\x28\x0f\xb7\xb6\xf4\xd4\x12\x34\x9d\x60\xfb\x32\x53\x34\xb9\x6a\xb9\x00\x01\x00\x00\xff\xff\x9c\x41\x95\x03\xb2\x00\x00\x00" + +func transactionschedulerScriptsGet_transaction_dataCdcBytes() ([]byte, error) { + return bindataRead( + _transactionschedulerScriptsGet_transaction_dataCdc, + "transactionScheduler/scripts/get_transaction_data.cdc", + ) +} + +func transactionschedulerScriptsGet_transaction_dataCdc() (*asset, error) { + bytes, err := transactionschedulerScriptsGet_transaction_dataCdcBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "transactionScheduler/scripts/get_transaction_data.cdc", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x51, 0xca, 0x65, 0xf7, 0x99, 0x45, 0x15, 0x31, 0x12, 0xee, 0xd0, 0x15, 0x1c, 0x8e, 0x24, 0xe8, 0x19, 0x45, 0x2e, 0x4, 0xd6, 0x41, 0xa2, 0x25, 0x25, 0x22, 0xab, 0x8e, 0x6e, 0xc0, 0x36, 0x1e}} + return a, nil +} + +var _transactionschedulerScriptsGet_transactions_for_timeframeCdc = "\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x74\x8e\x31\xca\x83\x40\x10\x46\xfb\x3d\xc5\x60\xa5\xf0\xf3\x57\x22\xc1\x03\x08\xa9\x63\xaa\x90\x62\x58\xc7\x64\x61\x77\x56\x66\x47\x12\x10\xef\x1e\x96\x34\x26\x92\x6a\xbe\xf7\x9a\x79\x2e\x4c\x51\x14\x8a\xce\xc7\x47\x2f\xc8\x09\xad\xba\xc8\x27\x7b\xa7\x61\xf6\x24\x85\x31\x68\x2d\xa5\x54\xa2\xf7\x15\x8c\x33\x43\x40\xc7\x65\x52\x14\xed\x5d\xa0\xa4\x18\xa6\x16\xce\x9d\x7b\x36\xf5\x1f\x10\x0f\x3b\x5b\xb5\xb0\xbc\x57\x1e\x47\xd6\x43\x0b\x97\x7c\x9b\xfa\xba\xae\xb0\x18\x00\x00\x21\x9d\x85\xe1\x57\xc7\xff\x8d\x74\xe3\x53\x17\x25\xff\x19\x05\x03\xed\x62\x3e\xf9\x3b\x6a\x4b\x95\x59\xcd\x2b\x00\x00\xff\xff\x57\x6b\xec\xe8\x03\x01\x00\x00" + +func transactionschedulerScriptsGet_transactions_for_timeframeCdcBytes() ([]byte, error) { + return bindataRead( + _transactionschedulerScriptsGet_transactions_for_timeframeCdc, + "transactionScheduler/scripts/get_transactions_for_timeframe.cdc", + ) +} + +func transactionschedulerScriptsGet_transactions_for_timeframeCdc() (*asset, error) { + bytes, err := transactionschedulerScriptsGet_transactions_for_timeframeCdcBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "transactionScheduler/scripts/get_transactions_for_timeframe.cdc", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xc9, 0x1b, 0x68, 0x44, 0x86, 0x72, 0x8b, 0x9b, 0xc9, 0x56, 0x8e, 0xf3, 0xb, 0xb8, 0xe0, 0x83, 0x9a, 0xd2, 0x35, 0xb8, 0xa8, 0x9, 0xe, 0x86, 0x8c, 0x87, 0x50, 0xb3, 0xfb, 0xf6, 0xef, 0xf2}} + return a, nil +} + // Asset loads and returns the asset for the given name. // It returns an error if the asset could not be found or // could not be loaded. @@ -6781,6 +7033,18 @@ var _bindata = map[string]func() (*asset, error){ "storageFees/scripts/get_storage_capacity.cdc": storagefeesScriptsGet_storage_capacityCdc, "storageFees/scripts/get_storage_fee_conversion.cdc": storagefeesScriptsGet_storage_fee_conversionCdc, "storageFees/scripts/get_storage_fee_min.cdc": storagefeesScriptsGet_storage_fee_minCdc, + "transactionScheduler/admin/execute_transaction.cdc": transactionschedulerAdminExecute_transactionCdc, + "transactionScheduler/admin/process_scheduled_transactions.cdc": transactionschedulerAdminProcess_scheduled_transactionsCdc, + "transactionScheduler/admin/set_config_details.cdc": transactionschedulerAdminSet_config_detailsCdc, + "transactionScheduler/cancel_transaction.cdc": transactionschedulerCancel_transactionCdc, + "transactionScheduler/schedule_transaction.cdc": transactionschedulerSchedule_transactionCdc, + "transactionScheduler/scripts/get_canceled_transactions.cdc": transactionschedulerScriptsGet_canceled_transactionsCdc, + "transactionScheduler/scripts/get_config.cdc": transactionschedulerScriptsGet_configCdc, + "transactionScheduler/scripts/get_estimate.cdc": transactionschedulerScriptsGet_estimateCdc, + "transactionScheduler/scripts/get_slot_available_effort.cdc": transactionschedulerScriptsGet_slot_available_effortCdc, + "transactionScheduler/scripts/get_status.cdc": transactionschedulerScriptsGet_statusCdc, + "transactionScheduler/scripts/get_transaction_data.cdc": transactionschedulerScriptsGet_transaction_dataCdc, + "transactionScheduler/scripts/get_transactions_for_timeframe.cdc": transactionschedulerScriptsGet_transactions_for_timeframeCdc, } // AssetDebug is true if the assets were built with the debug flag enabled. @@ -7206,6 +7470,24 @@ var _bintree = &bintree{nil, map[string]*bintree{ "get_storage_fee_min.cdc": {storagefeesScriptsGet_storage_fee_minCdc, map[string]*bintree{}}, }}, }}, + "transactionScheduler": {nil, map[string]*bintree{ + "admin": {nil, map[string]*bintree{ + "execute_transaction.cdc": {transactionschedulerAdminExecute_transactionCdc, map[string]*bintree{}}, + "process_scheduled_transactions.cdc": {transactionschedulerAdminProcess_scheduled_transactionsCdc, map[string]*bintree{}}, + "set_config_details.cdc": {transactionschedulerAdminSet_config_detailsCdc, map[string]*bintree{}}, + }}, + "cancel_transaction.cdc": {transactionschedulerCancel_transactionCdc, map[string]*bintree{}}, + "schedule_transaction.cdc": {transactionschedulerSchedule_transactionCdc, map[string]*bintree{}}, + "scripts": {nil, map[string]*bintree{ + "get_canceled_transactions.cdc": {transactionschedulerScriptsGet_canceled_transactionsCdc, map[string]*bintree{}}, + "get_config.cdc": {transactionschedulerScriptsGet_configCdc, map[string]*bintree{}}, + "get_estimate.cdc": {transactionschedulerScriptsGet_estimateCdc, map[string]*bintree{}}, + "get_slot_available_effort.cdc": {transactionschedulerScriptsGet_slot_available_effortCdc, map[string]*bintree{}}, + "get_status.cdc": {transactionschedulerScriptsGet_statusCdc, map[string]*bintree{}}, + "get_transaction_data.cdc": {transactionschedulerScriptsGet_transaction_dataCdc, map[string]*bintree{}}, + "get_transactions_for_timeframe.cdc": {transactionschedulerScriptsGet_transactions_for_timeframeCdc, map[string]*bintree{}}, + }}, + }}, }} // RestoreAsset restores an asset under the given directory. diff --git a/lib/go/templates/scheduled_transaction_templates.go b/lib/go/templates/scheduled_transaction_templates.go new file mode 100644 index 000000000..6cde648eb --- /dev/null +++ b/lib/go/templates/scheduled_transaction_templates.go @@ -0,0 +1,48 @@ +package templates + +import ( + "github.com/onflow/flow-core-contracts/lib/go/templates/internal/assets" +) + +const ( + // Admin Transactions + executeTransactionFilename = "transactionScheduler/admin/execute_transaction.cdc" + processTransactionFilename = "transactionScheduler/admin/process_scheduled_transactions.cdc" + + // User Transactions + scheduleTransactionFilename = "transactionScheduler/schedule_transaction.cdc" + + // Scripts + getSlotAvailableEffortFilename = "transactionScheduler/scripts/get_slot_available_effort.cdc" + getStatusFilename = "transactionScheduler/scripts/get_status.cdc" +) + +// Admin Transactions + +func GenerateExecuteTransactionScript(env Environment) []byte { + code := assets.MustAssetString(executeTransactionFilename) + + return []byte(ReplaceAddresses(code, env)) +} + +func GenerateProcessTransactionScript(env Environment) []byte { + code := assets.MustAssetString(processTransactionFilename) + + return []byte(ReplaceAddresses(code, env)) +} + +// User Transactions + +func GenerateScheduleTransactionScript(env Environment) []byte { + code := assets.MustAssetString(scheduleTransactionFilename) + + return []byte(ReplaceAddresses(code, env)) +} + +// Scripts + +func GenerateGetTransactionStatusScript(env Environment) []byte { + code := assets.MustAssetString(getStatusFilename) + + return []byte(ReplaceAddresses(code, env)) +} diff --git a/lib/go/templates/templates.go b/lib/go/templates/templates.go index f4845cbcc..7ca1c0d63 100644 --- a/lib/go/templates/templates.go +++ b/lib/go/templates/templates.go @@ -38,6 +38,7 @@ const ( placeholderNodeVersionBeaconAddress = "\"NodeVersionBeacon\"" placeholderRandomBeaconHistoryAddress = "\"RandomBeaconHistory\"" placeholderLinearCodeAddressGeneratorAddress = "\"LinearCodeAddressGenerator\"" + placeholderFlowTransactionSchedulerAddress = "\"FlowTransactionScheduler\"" ) type Environment struct { @@ -67,6 +68,7 @@ type Environment struct { NodeVersionBeaconAddress string RandomBeaconHistoryAddress string LinearCodeAddressGeneratorAddress string + FlowTransactionSchedulerAddress string } func withHexPrefix(address string) string { @@ -248,5 +250,11 @@ func ReplaceAddresses(code string, env Environment) string { env.LinearCodeAddressGeneratorAddress, ) + code = ReplaceAddress( + code, + placeholderFlowTransactionSchedulerAddress, + env.FlowTransactionSchedulerAddress, + ) + return code } diff --git a/lib/go/test/go.mod b/lib/go/test/go.mod index 0f8469725..e1ccd0f29 100644 --- a/lib/go/test/go.mod +++ b/lib/go/test/go.mod @@ -213,7 +213,7 @@ require ( // replaced by module version in this repo - disregard pinned version github.com/onflow/flow-core-contracts/lib/go/contracts v1.5.1-preview // replaced by module version in this repo - disregard pinned version - github.com/onflow/flow-core-contracts/lib/go/templates v1.6.1-0.20250226163127-3c9723416637 + github.com/onflow/flow-core-contracts/lib/go/templates v1.7.2-0.20250910191958-e8d0be12d23a ) replace github.com/onflow/flow-core-contracts/lib/go/contracts => ../contracts diff --git a/tests/scheduled_transaction_test_helpers.cdc b/tests/scheduled_transaction_test_helpers.cdc new file mode 100644 index 000000000..77036cea3 --- /dev/null +++ b/tests/scheduled_transaction_test_helpers.cdc @@ -0,0 +1,300 @@ +import Test +import "FlowTransactionScheduler" + +// Account 7 is where new contracts are deployed by default +access(all) let admin = Test.getAccount(0x0000000000000007) + +access(all) let serviceAccount = Test.serviceAccount() + +access(all) let highPriority = UInt8(0) +access(all) let mediumPriority = UInt8(1) +access(all) let lowPriority = UInt8(2) + +access(all) let statusUnknown = UInt8(0) +access(all) let statusScheduled = UInt8(1) +access(all) let statusExecuted = UInt8(2) +access(all) let statusCanceled = UInt8(3) + +access(all) let basicEffort: UInt64 = 1000 +access(all) let mediumEffort: UInt64 = 5000 +access(all) let maxEffort: UInt64 = 9999 + +access(all) let lowPriorityMaxEffort: UInt64 = 5000 +access(all) let mediumPriorityMaxEffort: UInt64 = 15000 +access(all) let highPriorityMaxEffort: UInt64 = 30000 + +access(all) let highPriorityEffortReserve: UInt64 = 20000 +access(all) let mediumPriorityEffortReserve: UInt64 = 5000 +access(all) let sharedEffortLimit: UInt64 = 10000 + +access(all) let canceledTransactionsLimit: UInt = 1000 + +access(all) let collectionTransactionsLimit: Int = 150 +access(all) let collectionEffortLimit: UInt64 = 500000 + +access(all) let testData = "test data" +access(all) let failTestData = "fail" + +access(all) let futureDelta = 100.0 +access(all) var futureTime = 0.0 + +access(all) var feeAmount = 10.0 + +/** --------------------------------------------------------------------------------- + Test helper functions + --------------------------------------------------------------------------------- */ + +// Helper functions for scheduling a transaction +access(all) fun scheduleTransaction( + timestamp: UFix64, + fee: UFix64, + effort: UInt64, + priority: UInt8, + data: AnyStruct?, + testName: String, + failWithErr: String? +) { + var tx = Test.Transaction( + code: Test.readFile("../transactions/transactionScheduler/schedule_transaction.cdc"), + authorizers: [serviceAccount.address], + signers: [serviceAccount], + arguments: [timestamp, fee, effort, priority, data], + ) + var result = Test.executeTransaction(tx) + + if let error = failWithErr { + // log(error) + // log(result.error!.message) + Test.expect(result, Test.beFailed()) + Test.assertError( + result, + errorMessage: error + ) + + } else { + if result.error != nil { + Test.assert(result.error == nil, message: "Transaction failed with error: \(result.error!.message) for test case: \(testName)") + } + } +} + +access(all) fun cancelTransaction(id: UInt64, failWithErr: String?) { + var tx = Test.Transaction( + code: Test.readFile("../transactions/transactionScheduler/cancel_transaction.cdc"), + authorizers: [serviceAccount.address], + signers: [serviceAccount], + arguments: [id], + ) + var result = Test.executeTransaction(tx) + + if let error = failWithErr { + Test.expect(result, Test.beFailed()) + Test.assertError( + result, + errorMessage: error + ) + + } else { + Test.expect(result, Test.beSucceeded()) + } +} + +access(all) fun processTransactions(): Test.TransactionResult { + let processTransactionCode = Test.readFile("../transactions/transactionScheduler/admin/process_scheduled_transactions.cdc") + let processTx = Test.Transaction( + code: processTransactionCode, + authorizers: [serviceAccount.address], + signers: [serviceAccount], + arguments: [] + ) + let processResult = Test.executeTransaction(processTx) + Test.expect(processResult, Test.beSucceeded()) + return processResult +} + +access(all) fun executeScheduledTransaction( + id: UInt64, + testName: String, + failWithErr: String? +) { + let executeTransactionCode = Test.readFile("../transactions/transactionScheduler/admin/execute_transaction.cdc") + let executeTx = Test.Transaction( + code: executeTransactionCode, + authorizers: [serviceAccount.address], + signers: [serviceAccount], + arguments: [id] + ) + var result = Test.executeTransaction(executeTx) + if let error = failWithErr { + // log(error) + // log(result.error!.message) + Test.expect(result, Test.beFailed()) + Test.assertError( + result, + errorMessage: error + ) + + } else { + if result.error != nil { + Test.assert(result.error == nil, message: "Transaction failed with error: \(result.error!.message) for test case: \(testName)") + } + } +} + +access(all) fun setConfigDetails( + maximumIndividualEffort: UInt64?, + minimumExecutionEffort: UInt64?, + slotSharedEffortLimit: UInt64?, + priorityEffortReserve: {UInt8: UInt64}?, + priorityEffortLimit: {UInt8: UInt64}?, + maxDataSizeMB: UFix64?, + priorityFeeMultipliers: {UInt8: UFix64}?, + refundMultiplier: UFix64?, + canceledTransactionsLimit: UInt?, + collectionEffortLimit: UInt64?, + collectionTransactionsLimit: Int?, + shouldFail: String? +) { + let setConfigDetailsCode = Test.readFile("../transactions/transactionScheduler/admin/set_config_details.cdc") + let setConfigDetailsTx = Test.Transaction( + code: setConfigDetailsCode, + authorizers: [serviceAccount.address], + signers: [serviceAccount], + arguments: [maximumIndividualEffort, + minimumExecutionEffort, + slotSharedEffortLimit, + priorityEffortReserve, + priorityEffortLimit, + maxDataSizeMB, + priorityFeeMultipliers, + refundMultiplier, + canceledTransactionsLimit, + collectionEffortLimit, + collectionTransactionsLimit] + ) + let setConfigDetailsResult = Test.executeTransaction(setConfigDetailsTx) + if let error = shouldFail { + // log(error) + // log(setConfigDetailsResult.error!.message) + Test.expect(setConfigDetailsResult, Test.beFailed()) + // Check error + Test.assertError( + setConfigDetailsResult, + errorMessage: error + ) + } else { + Test.expect(setConfigDetailsResult, Test.beSucceeded()) + } +} + +access(all) fun getConfigDetails(): {FlowTransactionScheduler.SchedulerConfig} { + var config = _executeScript( + "../transactions/transactionScheduler/scripts/get_config.cdc", + [] + ).returnValue! as! {FlowTransactionScheduler.SchedulerConfig} + return config +} + +access(all) fun getEstimate( + data: AnyStruct?, + timestamp: UFix64, + priority: UInt8, + executionEffort: UInt64 +): FlowTransactionScheduler.EstimatedScheduledTransaction { + var result = _executeScript( + "../transactions/transactionScheduler/scripts/get_estimate.cdc", + [data, timestamp, priority, executionEffort] + ).returnValue! as! FlowTransactionScheduler.EstimatedScheduledTransaction + return result +} + +access(all) fun getSizeOfData(data: AnyStruct): UFix64 { + var size = _executeScript( + "./scripts/get_data_size.cdc", + [data] + ).returnValue! as! UFix64 + return size +} + +access(all) fun getStatus(id: UInt64): UInt8? { + var status = _executeScript( + "../transactions/transactionScheduler/scripts/get_status.cdc", + [id] + ).returnValue as? UInt8 + return status +} + +access(all) fun getTransactionData(id: UInt64): FlowTransactionScheduler.TransactionData? { + var data = _executeScript( + "../transactions/transactionScheduler/scripts/get_transaction_data.cdc", + [id] + ).returnValue as? FlowTransactionScheduler.TransactionData + return data +} + +access(all) fun getTransactionsForTimeframe(startTimestamp: UFix64, endTimestamp: UFix64): {UFix64: {UInt8: [UInt64]}} { + var result = _executeScript( + "../transactions/transactionScheduler/scripts/get_transactions_for_timeframe.cdc", + [startTimestamp, endTimestamp] + ) + return result.returnValue! as! {UFix64: {UInt8: [UInt64]}} +} + +access(all) fun getCanceledTransactions(): [UInt64] { + var result = _executeScript( + "../transactions/transactionScheduler/scripts/get_canceled_transactions.cdc", + [] + ) + return result.returnValue! as! [UInt64] +} + +access(all) fun getSlotAvailableEffort(timestamp: UFix64, priority: UInt8): UInt64 { + var result = _executeScript( + "../transactions/transactionScheduler/scripts/get_slot_available_effort.cdc", + [timestamp, priority] + ) + Test.expect(result, Test.beSucceeded()) + + var effort = result.returnValue! as! UInt64 + return effort +} + +access(all) fun getPendingQueue(): [UInt64] { + + var result = _executeScript( + "./scripts/get_pending_queue.cdc", + [] + ) + Test.expect(result, Test.beSucceeded()) + + return result.returnValue! as! [UInt64] +} + +access(all) fun getTimestamp(): UFix64 { + var timestamp = _executeScript( + "./scripts/get_timestamp.cdc", + [] + ).returnValue! as! UFix64 + return timestamp! +} + +access(all) fun getBalance(account: Address): UFix64 { + var balance = _executeScript( + "../transactions/flowToken/scripts/get_balance.cdc", + [account] + ).returnValue! as! UFix64 + return balance! +} + +access(all) fun getFeesBalance(): UFix64 { + var balance = _executeScript( + "../transactions/FlowServiceAccount/scripts/get_fees_balance.cdc", + [] + ).returnValue! as! UFix64 + return balance! +} + +access(all) +fun _executeScript(_ path: String, _ args: [AnyStruct]): Test.ScriptResult { + return Test.executeScript(Test.readFile(path), args) +} \ No newline at end of file diff --git a/tests/scripts/get_data_size.cdc b/tests/scripts/get_data_size.cdc new file mode 100644 index 000000000..41104319a --- /dev/null +++ b/tests/scripts/get_data_size.cdc @@ -0,0 +1,5 @@ +import "FlowTransactionScheduler" + +access(all) fun main(data: AnyStruct): UFix64 { + return FlowTransactionScheduler.getSizeOfData(data) +} diff --git a/tests/scripts/get_executed_transactions.cdc b/tests/scripts/get_executed_transactions.cdc new file mode 100644 index 000000000..f37e3bb98 --- /dev/null +++ b/tests/scripts/get_executed_transactions.cdc @@ -0,0 +1,5 @@ +import "TestFlowScheduledTransactionHandler" + +access(all) fun main(): [UInt64] { + return TestFlowScheduledTransactionHandler.getSucceededTransactions() +} diff --git a/tests/scripts/get_pending_queue.cdc b/tests/scripts/get_pending_queue.cdc new file mode 100644 index 000000000..6c36584d9 --- /dev/null +++ b/tests/scripts/get_pending_queue.cdc @@ -0,0 +1,18 @@ +import "FlowTransactionScheduler" + +access(all) fun main(): [UInt64] { + + let schedulerAccount = getAuthAccount(0x0000000000000001) + + let scheduler = schedulerAccount.storage.borrow(from: FlowTransactionScheduler.storagePath) + ?? panic("Could not borrow FlowTransactionScheduler") + + let pendingQueue = scheduler.pendingQueue() + + var ids: [UInt64] = [] + for tx in pendingQueue { + ids.append(tx.id) + } + + return ids +} diff --git a/tests/scripts/get_timestamp.cdc b/tests/scripts/get_timestamp.cdc new file mode 100644 index 000000000..3c575dd42 --- /dev/null +++ b/tests/scripts/get_timestamp.cdc @@ -0,0 +1,3 @@ +access(all) fun main(): UFix64 { + return getCurrentBlock().timestamp +} diff --git a/tests/transactionScheduler_events_test.cdc b/tests/transactionScheduler_events_test.cdc new file mode 100644 index 000000000..c1784b208 --- /dev/null +++ b/tests/transactionScheduler_events_test.cdc @@ -0,0 +1,258 @@ +import Test +import BlockchainHelpers +import "FlowTransactionScheduler" +import "FlowToken" +import "TestFlowScheduledTransactionHandler" + +import "scheduled_transaction_test_helpers.cdc" + +access(all) let transactionToFail = 6 as UInt64 +access(all) let transactionToCancel = 2 as UInt64 + +access(all) var startingHeight: UInt64 = 0 + +access(all) var feesBalanceBefore: UFix64 = 0.0 +access(all) var accountBalanceBefore: UFix64 = 0.0 + +access(all) +fun setup() { + + var err = Test.deployContract( + name: "FlowTransactionScheduler", + path: "../contracts/FlowTransactionScheduler.cdc", + arguments: [] + ) + Test.expect(err, Test.beNil()) + + err = Test.deployContract( + name: "TestFlowScheduledTransactionHandler", + path: "../contracts/testContracts/TestFlowScheduledTransactionHandler.cdc", + arguments: [] + ) + Test.expect(err, Test.beNil()) + + startingHeight = getCurrentBlockHeight() + +} + +/** --------------------------------------------------------------------------------- + Transaction handler integration tests + --------------------------------------------------------------------------------- */ + +access(all) fun testTransactionScheduleEventAndData() { + + let currentTime = getTimestamp() + let timeInFuture = currentTime + futureDelta + + accountBalanceBefore = getBalance(account: serviceAccount.address) + feesBalanceBefore = getFeesBalance() + + // Schedule high priority transaction + scheduleTransaction( + timestamp: timeInFuture, + fee: feeAmount, + effort: basicEffort, + priority: highPriority, + data: testData, + testName: "Test Transaction Scheduling: First High Scheduled", + failWithErr: nil + ) + + // Check for Scheduled event using Test.eventsOfType + var scheduledEvents = Test.eventsOfType(Type()) + Test.assert(scheduledEvents.length == 1, message: "There should be one Scheduled event but there are \(scheduledEvents.length) events") + + var scheduledEvent = scheduledEvents[0] as! FlowTransactionScheduler.Scheduled + Test.assertEqual(highPriority, scheduledEvent.priority!) + Test.assertEqual(timeInFuture, scheduledEvent.timestamp!) + Test.assert(scheduledEvent.executionEffort == basicEffort, message: "incorrect execution effort") + Test.assertEqual(feeAmount, scheduledEvent.fees!) + Test.assertEqual(serviceAccount.address, scheduledEvent.transactionHandlerOwner!) + Test.assertEqual("A.0000000000000001.TestFlowScheduledTransactionHandler.Handler", scheduledEvent.transactionHandlerTypeIdentifier!) + + let transactionID = scheduledEvent.id as UInt64 + + // Get scheduled transactions from test transaction handler + let scheduledTransactions = TestFlowScheduledTransactionHandler.scheduledTransactions.keys + Test.assert(scheduledTransactions.length == 1, message: "one scheduled transaction") + + let scheduled = TestFlowScheduledTransactionHandler.scheduledTransactions[scheduledTransactions[0]]! + Test.assert(scheduled.id == transactionID, message: "transaction ID mismatch") + Test.assert(scheduled.timestamp == timeInFuture, message: "incorrect timestamp") + + var status = getStatus(id: transactionID) + Test.assertEqual(statusScheduled, status!) + + var transactionData = getTransactionData(id: transactionID) + Test.assertEqual(transactionID, transactionData!.id) + Test.assertEqual(timeInFuture, transactionData!.scheduledTimestamp) + Test.assertEqual(highPriority, transactionData!.priority.rawValue) + Test.assertEqual(feeAmount, transactionData!.fees) + Test.assertEqual(basicEffort, transactionData!.executionEffort) + Test.assertEqual(statusScheduled, transactionData!.status.rawValue) + Test.assertEqual(serviceAccount.address, transactionData!.handlerAddress) + Test.assertEqual("A.0000000000000001.TestFlowScheduledTransactionHandler.Handler", transactionData!.handlerTypeIdentifier) + + // invalid timeframe should return empty dictionary + var transactions = getTransactionsForTimeframe(startTimestamp: timeInFuture, endTimestamp: timeInFuture - 1.0) + Test.assertEqual(0, transactions.keys.length) + + transactions = getTransactionsForTimeframe(startTimestamp: timeInFuture-10.0, endTimestamp: timeInFuture - 1.0) + Test.assertEqual(0, transactions.keys.length) + + transactions = getTransactionsForTimeframe(startTimestamp: timeInFuture-10.0, endTimestamp: timeInFuture) + Test.assertEqual(1, transactions.keys.length) + let transactionsAtFutureTime = transactions[timeInFuture]! + let highPriorityTransactions = transactionsAtFutureTime[highPriority]! + Test.assertEqual(1, highPriorityTransactions.length) + Test.assertEqual(transactionID, highPriorityTransactions[0]) + + // Try to execute the transaction, should fail because it isn't pendingExecution + executeScheduledTransaction( + id: transactionID, + testName: "Test Transaction Events Path: First High Scheduled", + failWithErr: "Invalid ID: Cannot execute transaction with id \(transactionID) because it has incorrect status \(statusScheduled)" + ) +} + + +access(all) fun testScheduledTransactionCancelationEvents() { + + var currentTime = getTimestamp() + var timeInFuture = currentTime + futureDelta + + var balanceBefore = getBalance(account: serviceAccount.address) + + // Cancel invalid transaction should fail + cancelTransaction( + id: 100, + failWithErr: "Invalid ID: 100 transaction not found" + ) + + // Schedule a medium transaction + scheduleTransaction( + timestamp: timeInFuture, + fee: feeAmount, + effort: mediumEffort, + priority: mediumPriority, + data: testData, + testName: "Test Transaction Cancelation: First Scheduled", + failWithErr: nil + ) + + // Cancel the transaction + cancelTransaction( + id: transactionToCancel, + failWithErr: nil + ) + + let canceledEvents = Test.eventsOfType(Type()) + Test.assert(canceledEvents.length == 1, message: "Should only have one Canceled event") + let canceledEvent = canceledEvents[0] as! FlowTransactionScheduler.Canceled + Test.assertEqual(transactionToCancel, canceledEvent.id) + Test.assertEqual(mediumPriority, canceledEvent.priority) + Test.assertEqual(feeAmount/UFix64(2.0), canceledEvent.feesReturned) + Test.assertEqual(feeAmount/UFix64(2.0), canceledEvent.feesDeducted) + Test.assertEqual(serviceAccount.address, canceledEvent.transactionHandlerOwner) + Test.assertEqual("A.0000000000000001.TestFlowScheduledTransactionHandler.Handler", canceledEvent.transactionHandlerTypeIdentifier!) + + // Make sure the status is canceled + var status = getStatus(id: transactionToCancel) + Test.assertEqual(statusCanceled, status!) + + // Available Effort should be completely unused + // for the slot that the canceled transaction was in + var effort = getSlotAvailableEffort(timestamp: timeInFuture, priority: mediumPriority) + Test.assertEqual(UInt64(mediumPriorityMaxEffort), effort!) + + // Assert that the new balance reflects the refunds + Test.assertEqual(balanceBefore - feeAmount/UFix64(2.0), getBalance(account: serviceAccount.address)) + Test.assertEqual(feesBalanceBefore + feeAmount/UFix64(2.0), getFeesBalance()) +} + +access(all) fun testScheduledTransactionExecution() { + + var currentTime = getTimestamp() + var timeInFuture = currentTime + futureDelta + + feesBalanceBefore = getFeesBalance() + + var scheduledIDs = TestFlowScheduledTransactionHandler.scheduledTransactions.keys + + // Simulate FVM process - should not yet process since timestamp is in the future + processTransactions() + + // Check that no PendingExecution events were emitted yet (since transaction is in the future) + let pendingExecutionEventsBeforeTime = Test.eventsOfType(Type()) + Test.assert(pendingExecutionEventsBeforeTime.length == 0, message: "PendingExecution before time") + + // move time forward to trigger execution eligibility + // Have to subtract to handle the automatic timestamp drift + // so that the medium transaction that got scheduled doesn't get marked as pendingExecution + Test.moveTime(by: Fix64(futureDelta - 6.0)) + while getTimestamp() < timeInFuture { + Test.moveTime(by: Fix64(1.0)) + } + + // process transaction scheduled in the testTransactionScheduleEventAndData + processTransactions() + + // Check for PendingExecution event after processing + // Should have one high + + let pendingExecutionEventsAfterTime = Test.eventsOfType(Type()) + Test.assertEqual(1, pendingExecutionEventsAfterTime.length) + 23 + var firstEvent: Bool = false + for event in pendingExecutionEventsAfterTime { + let pendingExecutionEvent = event as! FlowTransactionScheduler.PendingExecution + Test.assert( + pendingExecutionEvent.id != UInt64(2), + message: "ID 2 Should not have been marked as pendingExecution" + ) + + // verify that the transactions got marked as executed + var status = getStatus(id: pendingExecutionEvent.id) + Test.assertEqual(statusExecuted, status!) + + // Simulate FVM execute - should execute the transaction + if pendingExecutionEvent.id == transactionToFail { + // ID 2 should fail, so need to verify that + executeScheduledTransaction(id: pendingExecutionEvent.id, testName: "Test Transaction Execution: First High Scheduled", failWithErr: "Transaction \(transactionToFail) failed") + } else { + executeScheduledTransaction(id: pendingExecutionEvent.id, testName: "Test Transaction Execution: First High Scheduled", failWithErr: nil) + + // Verify that the first event is the high priority transaction + if !firstEvent { + let executedEvents = Test.eventsOfType(Type()) + Test.assert(executedEvents.length == 1, message: "Should only have one Executed event") + let executedEvent = executedEvents[0] as! FlowTransactionScheduler.Executed + Test.assertEqual(pendingExecutionEvent.id, executedEvent.id) + Test.assertEqual(pendingExecutionEvent.priority, executedEvent.priority) + Test.assertEqual(pendingExecutionEvent.executionEffort, executedEvent.executionEffort) + Test.assertEqual(pendingExecutionEvent.transactionHandlerOwner, executedEvent.transactionHandlerOwner) + Test.assertEqual(pendingExecutionEvent.transactionHandlerTypeIdentifier, executedEvent.transactionHandlerTypeIdentifier!) + firstEvent = true + } + } + } + + // Check that the transactions were executed + var transactionIDs = _executeScript( + "./scripts/get_executed_transactions.cdc", + [] + ).returnValue! as! [UInt64] + Test.assert(transactionIDs.length == 1, message: "Executed ids is the wrong count") + + Test.moveTime(by: Fix64(2.0)) + + // Process transactions again to remove the executed transactions and pay fees + processTransactions() + + // Check that the fees were paid + Test.assertEqual(feesBalanceBefore + feeAmount, getFeesBalance()) + + // verify that the removed transaction still counts as executed + var status = getStatus(id: 1 as UInt64) + Test.assertEqual(statusExecuted, status!) +} \ No newline at end of file diff --git a/tests/transactionScheduler_misc_test.cdc b/tests/transactionScheduler_misc_test.cdc new file mode 100644 index 000000000..64fb264cf --- /dev/null +++ b/tests/transactionScheduler_misc_test.cdc @@ -0,0 +1,303 @@ +import Test +import BlockchainHelpers +import "FlowTransactionScheduler" +import "FlowToken" +import "TestFlowScheduledTransactionHandler" + +import "scheduled_transaction_test_helpers.cdc" + +access(all) let transactionToFail = 6 as UInt64 +access(all) let transactionToCancel = 2 as UInt64 + +access(all) var startingHeight: UInt64 = 0 + +access(all) var feesBalanceBefore: UFix64 = 0.0 +access(all) var accountBalanceBefore: UFix64 = 0.0 + +access(all) +fun setup() { + + var err = Test.deployContract( + name: "FlowTransactionScheduler", + path: "../contracts/FlowTransactionScheduler.cdc", + arguments: [] + ) + Test.expect(err, Test.beNil()) + + err = Test.deployContract( + name: "TestFlowScheduledTransactionHandler", + path: "../contracts/testContracts/TestFlowScheduledTransactionHandler.cdc", + arguments: [] + ) + Test.expect(err, Test.beNil()) + + startingHeight = getCurrentBlockHeight() + +} + +access(all) fun testScheduledTransactionCancellationLimits() { + + // lower the canceled transactions limit so the test runs faster + setConfigDetails( + maximumIndividualEffort: nil, + minimumExecutionEffort: nil, + slotSharedEffortLimit: nil, + priorityEffortReserve: nil, + priorityEffortLimit: nil, + maxDataSizeMB: nil, + priorityFeeMultipliers: nil, + refundMultiplier: nil, + canceledTransactionsLimit: 10, + collectionEffortLimit: nil, + collectionTransactionsLimit: nil, + shouldFail: nil + ) + + let currentTime = getTimestamp() + var timeInFuture = currentTime + futureDelta + + let numToCancel: UInt64 = 20 + var i: UInt64 = 0 + + // Schedule numToCancel transactions + while i <= numToCancel { + + // Schedule a medium transaction + scheduleTransaction( + timestamp: timeInFuture + UFix64(i), + fee: feeAmount, + effort: mediumEffort, + priority: mediumPriority, + data: testData, + testName: "Cancellation Limits: Scheduled \(i)", + failWithErr: nil + ) + + i = i + 1 + + } + + // Cancel the second transaction + cancelTransaction( + id: 2, + failWithErr: nil + ) + + var id: UInt64 = 1 + + while id < numToCancel { + + // Cancel the transactions + if id != 2 { + cancelTransaction( + id: id, + failWithErr: nil + ) + } + + // make sure the getStatus logic is working correctly + // the second transaction should be canceled + if id < 12 { + Test.assertEqual(statusCanceled, getStatus(id: 2)!) + } else { + Test.assertEqual(statusUnknown, getStatus(id: 2)!) + } + + id = id + 1 + } + + // Check that the canceled transactions are the ones we expect + var canceledTransactions = getCanceledTransactions() + Test.assertEqual(10, canceledTransactions.length) + + // The first 10 canceled transactions should have been removed from the canceled transactions array + i = 10 as UInt64 + for canceledID in canceledTransactions { + Test.assertEqual(i, canceledID) + i = i + 1 + } + + // get the status of one of the first 30 transactions and one of the later ones + var status = getStatus(id: 1) + Test.assertEqual(statusUnknown, status!) + + status = getStatus(id: 19) + Test.assertEqual(statusCanceled, status!) + + status = getStatus(id: 20) + Test.assertEqual(statusScheduled, status!) +} + +access(all) fun testScheduledTransactionScheduleAnotherTransaction() { + + if startingHeight < getCurrentBlockHeight() { + Test.reset(to: startingHeight) + } + + let currentTime = getTimestamp() + var timeInFuture = currentTime + futureDelta*5.0 + + // Schedule a medium transaction + scheduleTransaction( + timestamp: timeInFuture, + fee: feeAmount, + effort: mediumEffort, + priority: mediumPriority, + data: "schedule", + testName: "Schedule Another Transaction: Scheduled", + failWithErr: nil + ) + + let transactionData = getTransactionData(id: 1) + Test.assertEqual(1 as UInt64,transactionData!.id) + Test.assertEqual(timeInFuture, transactionData!.scheduledTimestamp) + Test.assertEqual(mediumPriority, transactionData!.priority.rawValue) + Test.assertEqual(feeAmount, transactionData!.fees) + Test.assertEqual(mediumEffort, transactionData!.executionEffort) + Test.assertEqual(statusScheduled, transactionData!.status.rawValue) + + Test.moveTime(by: Fix64(futureDelta*6.0)) + + processTransactions() + + executeScheduledTransaction( + id: 1, + testName: "Schedule Another Transaction: Executed", + failWithErr: nil + ) + + // get the status of the newly scheduled transaction with ID 2 + var status = getStatus(id: 2) + Test.assertEqual(statusScheduled, status!) + +} + + +access(all) fun testScheduledTransactionDestroyHandler() { + + if startingHeight < getCurrentBlockHeight() { + Test.reset(to: startingHeight) + } + + let currentTime = getTimestamp() + var timeInFuture = currentTime + futureDelta*10.0 + + // Schedule a medium transaction + scheduleTransaction( + timestamp: timeInFuture, + fee: feeAmount, + effort: mediumEffort, + priority: mediumPriority, + data: testData, + testName: "Destroy Handler: Scheduled", + failWithErr: nil + ) + + // Schedule a medium transaction + scheduleTransaction( + timestamp: timeInFuture, + fee: feeAmount, + effort: mediumEffort, + priority: mediumPriority, + data: testData, + testName: "Destroy Handler: SecondScheduled To Cancel", + failWithErr: nil + ) + + // Destroy the handler for both transactions + let destroyHandlerCode = Test.readFile("./transactions/destroy_handler.cdc") + let executeTx = Test.Transaction( + code: destroyHandlerCode, + authorizers: [serviceAccount.address], + signers: [serviceAccount], + arguments: [] + ) + var result = Test.executeTransaction(executeTx) + Test.expect(result, Test.beSucceeded()) + + // Cancel the second transaction + cancelTransaction( + id: 2, + failWithErr: nil + ) + + // make sure the canceled event was emitted with empty handler values + let canceledEvents = Test.eventsOfType(Type()) + Test.assertEqual(1, canceledEvents.length) + let canceledEvent = canceledEvents[0] as! FlowTransactionScheduler.Canceled + Test.assertEqual(UInt64(2), canceledEvent.id) + Test.assertEqual(mediumPriority, canceledEvent.priority) + Test.assertEqual(feeAmount/UFix64(2.0), canceledEvent.feesReturned) + Test.assertEqual(feeAmount/UFix64(2.0), canceledEvent.feesDeducted) + Test.assertEqual(Address(0x0000000000000001), canceledEvent.transactionHandlerOwner) + Test.assertEqual("A.0000000000000001.TestFlowScheduledTransactionHandler.Handler", canceledEvent.transactionHandlerTypeIdentifier) + + Test.moveTime(by: Fix64(futureDelta*11.0)) + + processTransactions() + + // The transaction with the handler should not have emitted an event because the handler was destroyed + let pendingExecutionEvents = Test.eventsOfType(Type()) + Test.assertEqual(0, pendingExecutionEvents.length) + + executeScheduledTransaction( + id: 1, + testName: "Destroy Handler: Execute", + failWithErr: "Invalid transaction handler: Could not borrow a reference to the transaction handler" + ) + +} + +access(all) fun testScheduledTransactionEstimateReturnNil() { + + if startingHeight < getCurrentBlockHeight() { + Test.reset(to: startingHeight) + } + + let currentTime = getTimestamp() + var timeInFuture = currentTime + futureDelta*20.0 + + // Schedule a high priority transaction + scheduleTransaction( + timestamp: timeInFuture, + fee: feeAmount, + effort: maxEffort, + priority: highPriority, + data: testData, + testName: "Estimate Return Nil: Scheduled 1", + failWithErr: nil + ) + + // Schedule a high priority transaction + scheduleTransaction( + timestamp: timeInFuture, + fee: feeAmount, + effort: maxEffort, + priority: highPriority, + data: testData, + testName: "Estimate Return Nil: Scheduled 2", + failWithErr: nil + ) + + // Schedule a high priority transaction + scheduleTransaction( + timestamp: timeInFuture, + fee: feeAmount, + effort: maxEffort, + priority: highPriority, + data: testData, + testName: "Estimate Return Nil: Scheduled 3", + failWithErr: nil + ) + + let estimate = getEstimate( + data: testData, + timestamp: timeInFuture, + priority: highPriority, + executionEffort: maxEffort + ) + + Test.assertEqual(nil, estimate.flowFee) + Test.assertEqual(nil, estimate.timestamp) + Test.assertEqual("Invalid execution effort: \(maxEffort) is greater than the priority's available effort for the requested timestamp.", estimate.error!) +} diff --git a/tests/transactionScheduler_schedule_test.cdc b/tests/transactionScheduler_schedule_test.cdc new file mode 100644 index 000000000..d48ac04a1 --- /dev/null +++ b/tests/transactionScheduler_schedule_test.cdc @@ -0,0 +1,1523 @@ +import Test +import BlockchainHelpers +import "FlowTransactionScheduler" +import "FlowToken" +import "TestFlowScheduledTransactionHandler" + +import "scheduled_transaction_test_helpers.cdc" + +access(all) +fun setup() { + + var err = Test.deployContract( + name: "FlowTransactionScheduler", + path: "../contracts/FlowTransactionScheduler.cdc", + arguments: [] + ) + Test.expect(err, Test.beNil()) + + err = Test.deployContract( + name: "TestFlowScheduledTransactionHandler", + path: "../contracts/testContracts/TestFlowScheduledTransactionHandler.cdc", + arguments: [] + ) + Test.expect(err, Test.beNil()) +} + +/** --------------------------------------------------------------------------------- + Transaction scheduler schedule tests + --------------------------------------------------------------------------------- */ + +// Transaction structure for tests +access(all) struct ScheduledTransaction { + access(all) var id: UInt64? + access(all) let requestedDelta: UFix64 + access(all) let priority: UInt8 + access(all) let executionEffort: UInt64 + access(all) let data: AnyStruct? + access(all) let fees: UFix64 + access(all) let failWithErr: String? + + access(all) init( + requestedDelta: UFix64, + priority: UInt8, + executionEffort: UInt64, + data: AnyStruct?, + fees: UFix64, + failWithErr: String? + ) { + self.id = nil + self.requestedDelta = requestedDelta + self.priority = priority + self.executionEffort = executionEffort + self.data = data + self.fees = fees + self.failWithErr = failWithErr + } + + access(all) fun setID(id: UInt64?) { + self.id = id + } +} + +// Test case structure for schedule and effort used tests +access(all) struct ScheduleAndEffortUsedTestCase { + access(all) let name: String + access(all) let transactions: [ScheduledTransaction] + access(all) let transactionsIndicesToCancel: [Int] + access(all) let expectedAvailableEfforts: {UFix64: {UInt8: UInt64}} + access(all) let expectedPendingQueues: {UFix64: [UInt64]} + access(all) let expectedPendingQueueAfterExecution: [UInt64] + + access(all) init( + name: String, + transactions: [ScheduledTransaction], + transactionsIndicesToCancel: [Int], + expectedAvailableEfforts: {UFix64: {UInt8: UInt64}}, + expectedPendingQueues: {UFix64: [UInt64]}, + expectedPendingQueueAfterExecution: [UInt64] + ) { + self.name = name + self.transactions = transactions + self.transactionsIndicesToCancel = transactionsIndicesToCancel + self.expectedAvailableEfforts = expectedAvailableEfforts + self.expectedPendingQueues = expectedPendingQueues + self.expectedPendingQueueAfterExecution = expectedPendingQueueAfterExecution + } + + access(all) fun setID(index: Int, id: UInt64?) { + self.transactions[index].setID(id: id) + } +} + +access(all) fun runScheduleAndEffortUsedTestCase(testCase: ScheduleAndEffortUsedTestCase, currentTimestamp: UFix64): UFix64 { + + var scheduleIndex = 0 + var idToSet = 1 + for tx in testCase.transactions { + scheduleTransaction( + timestamp: currentTimestamp + tx.requestedDelta, + fee: tx.fees, + effort: tx.executionEffort, + priority: tx.priority, + data: tx.data, + testName: testCase.name, + failWithErr: tx.failWithErr + ) + if tx.failWithErr == nil { + testCase.setID(index: scheduleIndex, id: UInt64(idToSet)) + idToSet = idToSet + 1 + } + scheduleIndex = scheduleIndex + 1 + } + + for cancelIndex in testCase.transactionsIndicesToCancel { + cancelTransaction(id: testCase.transactions[cancelIndex].id!, failWithErr: nil) + testCase.setID(index: cancelIndex, id: nil) + } + + for delta in testCase.expectedAvailableEfforts.keys { + for priority in testCase.expectedAvailableEfforts[delta]!.keys { + let expectedEffort = testCase.expectedAvailableEfforts[delta]![priority]! + let actualEffort = getSlotAvailableEffort(timestamp: currentTimestamp + delta, priority: priority) + + // check available efforts + Test.assert(expectedEffort == actualEffort, + message: "available effort mismatch for test case: \(testCase.name) with timestamp \(currentTimestamp + delta) and priority \(priority). Expected \(expectedEffort) but got \(actualEffort)" + ) + } + } + + Test.moveTime(by: Fix64(futureDelta-30.0)) + + let sortedTimestamps = FlowTransactionScheduler.SortedTimestamps() + for delta in testCase.expectedPendingQueues.keys { + sortedTimestamps.add(timestamp: currentTimestamp + delta) + } + + for timestamp in sortedTimestamps.getAll() { + // move time forward to trigger execution eligibility + while getTimestamp() < timestamp { + Test.moveTime(by: Fix64(1.0)) + } + + let expectedPendingQueue = testCase.expectedPendingQueues[timestamp - currentTimestamp]! + let actualPendingQueue = getPendingQueue() + Test.assert(expectedPendingQueue.length == actualPendingQueue.length, + message: "pending queue length mismatch for test case: \(testCase.name) with timestamp \(timestamp). Expected \(expectedPendingQueue.length) but got \(actualPendingQueue.length)" + ) + + for id in expectedPendingQueue { + Test.assert(actualPendingQueue.contains(id), + message: "pending queue element mismatch for test case: \(testCase.name) with timestamp \(timestamp). Expected \(id) but could not find it in the actual pending queue" + ) + } + } + + // process transactions + processTransactions() + + var numberOfTransactionsExecuted = 0 + + for tx in testCase.transactions { + if tx.id != nil && numberOfTransactionsExecuted < collectionTransactionsLimit && UInt64(numberOfTransactionsExecuted)*maxEffort < collectionEffortLimit - maxEffort { + numberOfTransactionsExecuted = numberOfTransactionsExecuted + 1 + if tx.data != nil { + if tx.data as! String == "cancel" { + executeScheduledTransaction(id: tx.id!, testName: testCase.name, failWithErr: "Transaction must be in a scheduled state in order to be canceled") + continue + } else if tx.data as! String == "fail" { + executeScheduledTransaction(id: tx.id!, testName: testCase.name, failWithErr: "Transaction \(tx.id!) failed") + continue + } + } + executeScheduledTransaction(id: tx.id!, testName: testCase.name, failWithErr: nil) + } + } + + // move time forward by 20.0 + Test.moveTime(by: Fix64(20.0)) + + // get actual pending queue + let actualPendingQueueAfterExecution = getPendingQueue() + Test.assert(testCase.expectedPendingQueueAfterExecution.length == actualPendingQueueAfterExecution.length, + message: "pending queue after execution length mismatch for test case: \(testCase.name) after execution. Expected \(testCase.expectedPendingQueueAfterExecution.length) but got \(actualPendingQueueAfterExecution.length)" + ) + for id in testCase.expectedPendingQueueAfterExecution { + Test.assert(actualPendingQueueAfterExecution.contains(id), + message: "pending queue after execution element mismatch for test case: \(testCase.name). Expected \(id) but could not find it in the actual pending queue" + ) + } + + return getTimestamp() +} + +access(all) fun testScheduleAndEffortUsed() { + + var startingHeight = getCurrentBlockHeight() + + // Common transactions that we will use multiple times in certain test cases + + let lowTransactionWith300Effort = ScheduledTransaction( + requestedDelta: futureDelta, + priority: lowPriority, + executionEffort: 300, + data: testData, + fees: feeAmount, + failWithErr: nil + ) + + let mediumTransactionWith4000Effort = ScheduledTransaction( + requestedDelta: futureDelta, + priority: mediumPriority, + executionEffort: 4000, + data: testData, + fees: feeAmount, + failWithErr: nil + ) + + let highTransactionWith8000Effort = ScheduledTransaction( + requestedDelta: futureDelta, + priority: highPriority, + executionEffort: 8000, + data: testData, + fees: feeAmount, + failWithErr: nil + ) + + let testCases: [ScheduleAndEffortUsedTestCase] = [ + // Low priority only test cases + ScheduleAndEffortUsedTestCase( + name: "Low priority: Zero fees and zero effort fails with no effort used", + transactions: [ + ScheduledTransaction( + requestedDelta: futureDelta, + priority: highPriority, + executionEffort: 1000, + data: testData, + fees: 0.0, + failWithErr: "Insufficient fees: The Fee balance of 0.00000000 is not sufficient to pay the required amount of 0.00010000 for execution of the transaction." + ), + ScheduledTransaction( + requestedDelta: futureDelta, + priority: lowPriority, + executionEffort: 0, + data: testData, + fees: feeAmount, + failWithErr: "Invalid execution effort: 0 is less than the minimum execution effort of 10" + ) + ], + transactionsIndicesToCancel: [], + expectedAvailableEfforts: { + futureDelta: { + highPriority: highPriorityMaxEffort, + mediumPriority: mediumPriorityMaxEffort, + lowPriority: lowPriorityMaxEffort + } + }, + expectedPendingQueues: { + futureDelta: [] + }, + expectedPendingQueueAfterExecution: [] + ), + ScheduleAndEffortUsedTestCase( + name: "Low priority: Min effort fits in slot and uses min effort", + transactions: [ + ScheduledTransaction( + requestedDelta: futureDelta, + priority: lowPriority, + executionEffort: 10, + data: testData, + fees: feeAmount, + failWithErr: nil + ) + ], + transactionsIndicesToCancel: [], + expectedAvailableEfforts: { + futureDelta: { + highPriority: highPriorityMaxEffort, + mediumPriority: mediumPriorityMaxEffort, + lowPriority: lowPriorityMaxEffort - 10 + } + }, + expectedPendingQueues: { + futureDelta: [1] + }, + expectedPendingQueueAfterExecution: [] + ), + ScheduleAndEffortUsedTestCase( + name: "Low priority: Max effort fits in slot and uses max effort. Other low priority transactions are scheduled for later", + transactions: [ + ScheduledTransaction( + requestedDelta: futureDelta, + priority: lowPriority, + executionEffort: lowPriorityMaxEffort, + data: testData, + fees: feeAmount, + failWithErr: nil + ), + ScheduledTransaction( + requestedDelta: futureDelta, + priority: lowPriority, + executionEffort: 10, + data: testData, + fees: feeAmount, + failWithErr: nil + ) + ], + transactionsIndicesToCancel: [], + expectedAvailableEfforts: { + futureDelta: { + highPriority: highPriorityMaxEffort, + mediumPriority: mediumPriorityMaxEffort, + lowPriority: 0 + }, + futureDelta + 1.0: { + highPriority: highPriorityMaxEffort, + mediumPriority: mediumPriorityMaxEffort, + lowPriority: lowPriorityMaxEffort - 10 + } + }, + expectedPendingQueues: { + futureDelta: [1], + futureDelta + 1.0: [1,2] + }, + expectedPendingQueueAfterExecution: [] + ), + ScheduleAndEffortUsedTestCase( + name: "Low Priority: Greater than max effort Fails", + transactions: [ + ScheduledTransaction( + requestedDelta: futureDelta, + priority: lowPriority, + executionEffort: lowPriorityMaxEffort + 1, + data: testData, + fees: feeAmount, + failWithErr: "Invalid execution effort: 5001 is greater than the priority's max effort of 5000" + ) + ], + transactionsIndicesToCancel: [], + expectedAvailableEfforts: { + futureDelta: { + highPriority: highPriorityMaxEffort, + mediumPriority: mediumPriorityMaxEffort, + lowPriority: lowPriorityMaxEffort + } + }, + expectedPendingQueues: { + futureDelta: [] + }, + expectedPendingQueueAfterExecution: [] + ), + ScheduleAndEffortUsedTestCase( + name: "Low Priority: Many low priority transactions scheduled for same timestamp", + transactions: [ + lowTransactionWith300Effort, + lowTransactionWith300Effort, + lowTransactionWith300Effort, + lowTransactionWith300Effort, + lowTransactionWith300Effort, + lowTransactionWith300Effort, + lowTransactionWith300Effort, + lowTransactionWith300Effort, + lowTransactionWith300Effort, + lowTransactionWith300Effort, + lowTransactionWith300Effort, + lowTransactionWith300Effort, + lowTransactionWith300Effort, + lowTransactionWith300Effort, + lowTransactionWith300Effort, + lowTransactionWith300Effort, + ScheduledTransaction( + requestedDelta: futureDelta, + priority: lowPriority, + executionEffort: 300, + data: testData, + fees: feeAmount, + failWithErr: nil + ) + ], + transactionsIndicesToCancel: [], + expectedAvailableEfforts: { + futureDelta: { + highPriority: highPriorityMaxEffort, + mediumPriority: mediumPriorityMaxEffort, + lowPriority: 200 + }, + futureDelta + 1.0: { + highPriority: highPriorityMaxEffort, + mediumPriority: mediumPriorityMaxEffort, + lowPriority: 4700 + } + }, + expectedPendingQueues: { + futureDelta: [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16], + futureDelta + 1.0: [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17] + }, + expectedPendingQueueAfterExecution: [] + ), + + // Medium priority only test cases + ScheduleAndEffortUsedTestCase( + name: "Medium priority: Min effort fits in slot and uses min effort", + transactions: [ + ScheduledTransaction( + requestedDelta: futureDelta, + priority: mediumPriority, + executionEffort: 10, + data: testData, + fees: feeAmount, + failWithErr: nil + ) + ], + transactionsIndicesToCancel: [], + expectedAvailableEfforts: { + futureDelta: { + highPriority: highPriorityMaxEffort, + mediumPriority: mediumPriorityMaxEffort - 10, + lowPriority: lowPriorityMaxEffort + } + }, + expectedPendingQueues: { + futureDelta: [1] + }, + expectedPendingQueueAfterExecution: [] + ), + ScheduleAndEffortUsedTestCase( + name: "Medium priority: Max effort fits in slot and uses max effort. Other medium priority transactions are scheduled for later", + transactions: [ + ScheduledTransaction( + requestedDelta: futureDelta, + priority: mediumPriority, + executionEffort: maxEffort, + data: testData, + fees: feeAmount, + failWithErr: nil + ), + ScheduledTransaction( + requestedDelta: futureDelta, + priority: mediumPriority, + executionEffort: maxEffort, + data: testData, + fees: feeAmount, + failWithErr: nil + ) + ], + transactionsIndicesToCancel: [], + expectedAvailableEfforts: { + futureDelta: { + highPriority: highPriorityMaxEffort - 4999, + mediumPriority: mediumPriorityMaxEffort - maxEffort, + lowPriority: lowPriorityMaxEffort + }, + futureDelta + 1.0: { + highPriority: highPriorityMaxEffort - 4999, + mediumPriority: mediumPriorityMaxEffort - maxEffort, + lowPriority: lowPriorityMaxEffort + } + }, + expectedPendingQueues: { + futureDelta: [1], + futureDelta + 1.0: [1,2] + }, + expectedPendingQueueAfterExecution: [] + ), + ScheduleAndEffortUsedTestCase( + name: "Medium Priority: Greater than max effort Fails", + transactions: [ + ScheduledTransaction( + requestedDelta: futureDelta, + priority: mediumPriority, + executionEffort: maxEffort + 1, + data: testData, + fees: feeAmount, + failWithErr: "Invalid execution effort: \(maxEffort + 1) is greater than the maximum transaction effort of 9999" + ) + ], + transactionsIndicesToCancel: [], + expectedAvailableEfforts: { + futureDelta: { + highPriority: highPriorityMaxEffort, + mediumPriority: mediumPriorityMaxEffort, + lowPriority: lowPriorityMaxEffort + } + }, + expectedPendingQueues: { + futureDelta: [] + }, + expectedPendingQueueAfterExecution: [] + ), + + // Medium Priority: Many medium priority transactions scheduled for same timestamp + ScheduleAndEffortUsedTestCase( + name: "Medium Priority: Many medium priority transactions scheduled for same timestamp", + transactions: [ + mediumTransactionWith4000Effort, + mediumTransactionWith4000Effort, + mediumTransactionWith4000Effort, + mediumTransactionWith4000Effort, + mediumTransactionWith4000Effort, + mediumTransactionWith4000Effort, + mediumTransactionWith4000Effort, + mediumTransactionWith4000Effort, + mediumTransactionWith4000Effort, + mediumTransactionWith4000Effort + ], + transactionsIndicesToCancel: [], + expectedAvailableEfforts: { + futureDelta: { + highPriority: highPriorityMaxEffort-7000, + mediumPriority: 3000, + lowPriority: lowPriorityMaxEffort + }, + futureDelta + 1.0: { + highPriority: highPriorityMaxEffort-7000, + mediumPriority: 3000, + lowPriority: lowPriorityMaxEffort + }, + futureDelta + 2.0: { + highPriority: highPriorityMaxEffort-7000, + mediumPriority: 3000, + lowPriority: lowPriorityMaxEffort + }, + futureDelta + 3.0: { + highPriority: highPriorityMaxEffort, + mediumPriority: 11000, + lowPriority: lowPriorityMaxEffort + } + }, + expectedPendingQueues: { + futureDelta: [1,2,3], + futureDelta + 1.0: [1,2,3,4,5,6], + futureDelta + 2.0: [1,2,3,4,5,6,7,8,9], + futureDelta + 3.0: [1,2,3,4,5,6,7,8,9,10] + }, + expectedPendingQueueAfterExecution: [] + ), + + // High priority only test cases + ScheduleAndEffortUsedTestCase( + name: "High priority: Min effort fits in slot and uses min effort", + transactions: [ + ScheduledTransaction( + requestedDelta: futureDelta, + priority: highPriority, + executionEffort: 10, + data: testData, + fees: feeAmount, + failWithErr: nil + ) + ], + transactionsIndicesToCancel: [], + expectedAvailableEfforts: { + futureDelta: { + highPriority: highPriorityMaxEffort - 10, + mediumPriority: mediumPriorityMaxEffort, + lowPriority: lowPriorityMaxEffort + } + }, + expectedPendingQueues: { + futureDelta: [1] + }, + expectedPendingQueueAfterExecution: [] + ), + ScheduleAndEffortUsedTestCase( + name: "High priority: Max effort fits in slot and uses max effort. Other high priority transactions fail in the same slot", + transactions: [ + ScheduledTransaction( + requestedDelta: futureDelta, + priority: highPriority, + executionEffort: maxEffort, + data: testData, + fees: feeAmount, + failWithErr: nil + ), + ScheduledTransaction( + requestedDelta: futureDelta, + priority: highPriority, + executionEffort: maxEffort, + data: testData, + fees: feeAmount, + failWithErr: nil + ), + ScheduledTransaction( + requestedDelta: futureDelta, + priority: highPriority, + executionEffort: maxEffort, + data: testData, + fees: feeAmount, + failWithErr: nil + ), + ScheduledTransaction( + requestedDelta: futureDelta, + priority: highPriority, + executionEffort: maxEffort, + data: testData, + fees: feeAmount, + failWithErr: "Invalid execution effort: \(maxEffort) is greater than the priority's available effort for the requested timestamp." + ) + ], + transactionsIndicesToCancel: [], + expectedAvailableEfforts: { + futureDelta: { + highPriority: highPriorityMaxEffort - 3*maxEffort, + mediumPriority: mediumPriorityEffortReserve + 3, + lowPriority: lowPriorityMaxEffort + }, + futureDelta + 1.0: { + highPriority: highPriorityMaxEffort, + mediumPriority: mediumPriorityMaxEffort, + lowPriority: lowPriorityMaxEffort + } + }, + expectedPendingQueues: { + futureDelta: [1,2,3], + futureDelta + 1.0: [1,2,3] + }, + expectedPendingQueueAfterExecution: [] + ), + ScheduleAndEffortUsedTestCase( + name: "High Priority: Greater than max effort Fails", + transactions: [ + ScheduledTransaction( + requestedDelta: futureDelta, + priority: highPriority, + executionEffort: maxEffort + 1, + data: testData, + fees: feeAmount, + failWithErr: "Invalid execution effort: \(maxEffort + 1) is greater than the maximum transaction effort of 9999" + ) + ], + transactionsIndicesToCancel: [], + expectedAvailableEfforts: { + futureDelta: { + highPriority: highPriorityMaxEffort, + mediumPriority: mediumPriorityMaxEffort, + lowPriority: lowPriorityMaxEffort + } + }, + expectedPendingQueues: { + futureDelta: [] + }, + expectedPendingQueueAfterExecution: [] + ), + ScheduleAndEffortUsedTestCase( + name: "High Priority: Many high priority transactions scheduled for the same timestamp", + transactions: [ + highTransactionWith8000Effort, + highTransactionWith8000Effort, + highTransactionWith8000Effort, + ScheduledTransaction( + requestedDelta: futureDelta + 1.0, + priority: highPriority, + executionEffort: 8000, + data: testData, + fees: feeAmount, + failWithErr: nil + ) + ], + transactionsIndicesToCancel: [], + expectedAvailableEfforts: { + futureDelta: { + highPriority: 6000, + mediumPriority: 11000, + lowPriority: lowPriorityMaxEffort + }, + futureDelta + 1.0: { + highPriority: highPriorityMaxEffort - 8000, + mediumPriority: mediumPriorityMaxEffort, + lowPriority: lowPriorityMaxEffort + } + }, + expectedPendingQueues: { + futureDelta: [1,2,3], + futureDelta + 1.0: [1,2,3,4] + }, + expectedPendingQueueAfterExecution: [] + ), + + // Mixed priority test cases - testing shared limit usage + ScheduleAndEffortUsedTestCase( + name: "Mixed priorities: High priorities use shared limit, medium priority uses reserve", + transactions: [ + ScheduledTransaction( + requestedDelta: futureDelta, + priority: highPriority, + executionEffort: 9000, + data: testData, + fees: feeAmount, + failWithErr: nil + ), + ScheduledTransaction( + requestedDelta: futureDelta, + priority: highPriority, + executionEffort: 9000, + data: testData, + fees: feeAmount, + failWithErr: nil + ), + ScheduledTransaction( + requestedDelta: futureDelta, + priority: highPriority, + executionEffort: 9000, + data: testData, + fees: feeAmount, + failWithErr: nil + ), + ScheduledTransaction( + requestedDelta: futureDelta, + priority: highPriority, + executionEffort: 3000, + data: testData, + fees: feeAmount, + failWithErr: nil + ), + ScheduledTransaction( + requestedDelta: futureDelta, + priority: mediumPriority, + executionEffort: mediumPriorityEffortReserve, + data: testData, + fees: feeAmount, + failWithErr: nil + ), + ScheduledTransaction( + requestedDelta: futureDelta, + priority: lowPriority, + executionEffort: 1000, + data: testData, + fees: feeAmount, + failWithErr: nil + ), + ScheduledTransaction( + requestedDelta: futureDelta, + priority: mediumPriority, + executionEffort: 1000, + data: testData, + fees: feeAmount, + failWithErr: nil + ), + ScheduledTransaction( + requestedDelta: futureDelta, + priority: highPriority, + executionEffort: 1000, + data: testData, + fees: feeAmount, + failWithErr: "Invalid execution effort: 1000 is greater than the priority's available effort for the requested timestamp." + ) + ], + transactionsIndicesToCancel: [], + expectedAvailableEfforts: { + futureDelta: { + highPriority: 0, + mediumPriority: 0, + lowPriority: 0 + }, + futureDelta + 1.0: { + highPriority: highPriorityMaxEffort, + mediumPriority: mediumPriorityMaxEffort - 1000, + lowPriority: lowPriorityMaxEffort - 1000 + } + }, + expectedPendingQueues: { + futureDelta: [1,2,3,4,5], + futureDelta + 1.0: [1,2,3,4,5,6,7] + }, + expectedPendingQueueAfterExecution: [] + ), + ScheduleAndEffortUsedTestCase( + name: "Mixed priorities: Medium uses shared limit, high priority fails in the same slot", + transactions: [ + ScheduledTransaction( + requestedDelta: futureDelta, + priority: mediumPriority, + executionEffort: 9000, + data: testData, + fees: feeAmount, + failWithErr: nil + ), + ScheduledTransaction( + requestedDelta: futureDelta, + priority: mediumPriority, + executionEffort: 6000, + data: testData, + fees: feeAmount, + failWithErr: nil + ), + ScheduledTransaction( + requestedDelta: futureDelta, + priority: highPriority, + executionEffort: 9000, + data: testData, + fees: feeAmount, + failWithErr: nil + ), + ScheduledTransaction( + requestedDelta: futureDelta, + priority: highPriority, + executionEffort: 9000, + data: testData, + fees: feeAmount, + failWithErr: nil + ), + ScheduledTransaction( + requestedDelta: futureDelta, + priority: highPriority, + executionEffort: 2001, + data: testData, + fees: feeAmount, + failWithErr: "Invalid execution effort: 2001 is greater than the priority's available effort for the requested timestamp." + ), + ScheduledTransaction( + requestedDelta: futureDelta, + priority: highPriority, + executionEffort: 2000, + data: testData, + fees: feeAmount, + failWithErr: nil + ) + ], + transactionsIndicesToCancel: [], + expectedAvailableEfforts: { + futureDelta: { + highPriority: 0, + mediumPriority: 0, + lowPriority: 0 + } + }, + expectedPendingQueues: { + futureDelta: [1,2,3,4,5], + futureDelta + 1.0: [1,2,3,4,5] + }, + expectedPendingQueueAfterExecution: [] + ), + ScheduleAndEffortUsedTestCase( + name: "Mixed priorities: High and medium use most of shared limit, low priority fits in remaining but doesn't use the high or medium effort", + transactions: [ + highTransactionWith8000Effort, + highTransactionWith8000Effort, + highTransactionWith8000Effort, + ScheduledTransaction( + requestedDelta: futureDelta, + priority: mediumPriority, + executionEffort: mediumPriorityEffortReserve + 4000, + data: testData, + fees: feeAmount, + failWithErr: nil + ), + ScheduledTransaction( + requestedDelta: futureDelta, + priority: lowPriority, + executionEffort: 2001, + data: testData, + fees: feeAmount, + failWithErr: nil + ), + ScheduledTransaction( + requestedDelta: futureDelta, + priority: mediumPriority, + executionEffort: 2001, + data: testData, + fees: feeAmount, + failWithErr: nil + ), + ScheduledTransaction( + requestedDelta: futureDelta, + priority: lowPriority, + executionEffort: 2000, + data: testData, + fees: feeAmount, + failWithErr: nil + ) + ], + transactionsIndicesToCancel: [], + expectedAvailableEfforts: { + futureDelta: { + highPriority: 2000, + mediumPriority: 2000, + lowPriority: 0 + }, + futureDelta + 1.0: { + highPriority: highPriorityMaxEffort, + mediumPriority: mediumPriorityMaxEffort-2001, + lowPriority: lowPriorityMaxEffort - 2001 + } + }, + expectedPendingQueues: { + futureDelta: [1,2,3,4,7], + futureDelta + 1.0: [1,2,3,4,5,6,7] + }, + expectedPendingQueueAfterExecution: [] + ), + + // Test cases for low priority transactions getting rescheduled by higher priority transactions + ScheduleAndEffortUsedTestCase( + name: "Low priority gets rescheduled: Low priority fills slot, high and medium priority pushes it to next timestamp", + transactions: [ + ScheduledTransaction( + requestedDelta: futureDelta, + priority: lowPriority, + executionEffort: lowPriorityMaxEffort, + data: testData, + fees: feeAmount, + failWithErr: nil + ), + ScheduledTransaction( + requestedDelta: futureDelta, + priority: highPriority, + executionEffort: 9000, + data: testData, + fees: feeAmount, + failWithErr: nil + ), + ScheduledTransaction( + requestedDelta: futureDelta, + priority: highPriority, + executionEffort: 9000, + data: testData, + fees: feeAmount, + failWithErr: nil + ), + ScheduledTransaction( + requestedDelta: futureDelta, + priority: highPriority, + executionEffort: 9000, + data: testData, + fees: feeAmount, + failWithErr: nil + ), + ScheduledTransaction( + requestedDelta: futureDelta, + priority: mediumPriority, + executionEffort: 8000, + data: testData, + fees: feeAmount, + failWithErr: nil + ) + ], + transactionsIndicesToCancel: [], + expectedAvailableEfforts: { + futureDelta: { + highPriority: 0, + mediumPriority: 0, + lowPriority: 0 + }, + futureDelta + 1.0: { + highPriority: highPriorityMaxEffort, + mediumPriority: mediumPriorityMaxEffort, + lowPriority: 0 + } + }, + expectedPendingQueues: { + futureDelta: [2,3,4,5], + futureDelta + 1.0: [1,2,3,4,5] + }, + expectedPendingQueueAfterExecution: [] + ), + ScheduleAndEffortUsedTestCase( + name: "Low priority gets rescheduled: Multiple low priority transactions get pushed by high and medium priority", + transactions: [ + ScheduledTransaction( + requestedDelta: futureDelta, + priority: lowPriority, + executionEffort: 2000, + data: testData, + fees: feeAmount, + failWithErr: nil + ), + ScheduledTransaction( + requestedDelta: futureDelta, + priority: lowPriority, + executionEffort: 2000, + data: testData, + fees: feeAmount, + failWithErr: nil + ), + highTransactionWith8000Effort, + highTransactionWith8000Effort, + highTransactionWith8000Effort, + ScheduledTransaction( + requestedDelta: futureDelta, + priority: highPriority, + executionEffort: 6000, + data: testData, + fees: feeAmount, + failWithErr: nil + ), + ScheduledTransaction( + requestedDelta: futureDelta, + priority: mediumPriority, + executionEffort: 2000, + data: testData, + fees: feeAmount, + failWithErr: nil + ) + ], + transactionsIndicesToCancel: [], + expectedAvailableEfforts: { + futureDelta: { + highPriority: 0, + mediumPriority: 3000, + lowPriority: 1000 + }, + futureDelta + 1.0: { + highPriority: highPriorityMaxEffort, + mediumPriority: mediumPriorityMaxEffort, + lowPriority: 3000 + } + }, + expectedPendingQueues: { + futureDelta: [1,3,4,5,6,7], + futureDelta + 1.0: [1,2,3,4,5,6,7] + }, + expectedPendingQueueAfterExecution: [] + ), + ScheduleAndEffortUsedTestCase( + name: "Low priority gets rescheduled: Low Priorities get pushed to multiple slots", + transactions: [ + ScheduledTransaction( + requestedDelta: futureDelta, + priority: lowPriority, + executionEffort: 3000, + data: testData, + fees: feeAmount, + failWithErr: nil + ), + ScheduledTransaction( + requestedDelta: futureDelta, + priority: lowPriority, + executionEffort: 2000, + data: testData, + fees: feeAmount, + failWithErr: nil + ), + ScheduledTransaction( + requestedDelta: futureDelta, + priority: mediumPriority, + executionEffort: 8000, + data: testData, + fees: feeAmount, + failWithErr: nil + ), + ScheduledTransaction( + requestedDelta: futureDelta, + priority: mediumPriority, + executionEffort: 7000, + data: testData, + fees: feeAmount, + failWithErr: nil + ), + ScheduledTransaction( + requestedDelta: futureDelta + 1.0, + priority: highPriority, + executionEffort: 8000, + data: testData, + fees: feeAmount, + failWithErr: nil + ), + ScheduledTransaction( + requestedDelta: futureDelta + 1.0, + priority: highPriority, + executionEffort: 8000, + data: testData, + fees: feeAmount, + failWithErr: nil + ), + ScheduledTransaction( + requestedDelta: futureDelta + 1.0, + priority: highPriority, + executionEffort: 8000, + data: testData, + fees: feeAmount, + failWithErr: nil + ), + ScheduledTransaction( + requestedDelta: futureDelta + 1.0, + priority: highPriority, + executionEffort: 6000, + data: testData, + fees: feeAmount, + failWithErr: nil + ), + ScheduledTransaction( + requestedDelta: futureDelta + 1.0, + priority: mediumPriority, + executionEffort: mediumPriorityEffortReserve - 2000, + data: testData, + fees: feeAmount, + failWithErr: nil + ), + ScheduledTransaction( + requestedDelta: futureDelta, + priority: highPriority, + executionEffort: 9500, + data: testData, + fees: feeAmount, + failWithErr: nil + ), + // Should push 1 and 2 to the next two timestamps + ScheduledTransaction( + requestedDelta: futureDelta, + priority: highPriority, + executionEffort: 9500, + data: testData, + fees: feeAmount, + failWithErr: nil + ) + ], + transactionsIndicesToCancel: [], + expectedAvailableEfforts: { + futureDelta: { + highPriority: 1000, + mediumPriority: 0, + lowPriority: 1000 + }, + futureDelta + 1.0: { + highPriority: 0, + mediumPriority: 2000, + lowPriority: 0 + }, + futureDelta + 2.0: { + highPriority: highPriorityMaxEffort, + mediumPriority: mediumPriorityMaxEffort, + lowPriority: 2000 + } + }, + expectedPendingQueues: { + futureDelta: [3,4,10,11], + futureDelta + 1.0: [2,3,4,5,6,7,8,9,10,11], + futureDelta + 2.0: [1,2,3,4,5,6,7,8,9,10,11] + }, + expectedPendingQueueAfterExecution: [] + ), + // Self-canceling transaction test case + ScheduleAndEffortUsedTestCase( + name: "Cancel Tests: Transaction tries to cancel itself during execution: Should fail", + transactions: [ + ScheduledTransaction( + requestedDelta: futureDelta, + priority: lowPriority, + executionEffort: 3000, + data: "cancel", + fees: feeAmount, + failWithErr: nil + ) + ], + transactionsIndicesToCancel: [], + expectedAvailableEfforts: { + futureDelta: { + highPriority: highPriorityMaxEffort, + mediumPriority: mediumPriorityMaxEffort, + lowPriority: lowPriorityMaxEffort - 3000 + } + }, + expectedPendingQueues: { + futureDelta: [1] + }, + expectedPendingQueueAfterExecution: [] + ), + ScheduleAndEffortUsedTestCase( + name: "Cancel Tests: High priority transaction canceled after scheduling", + transactions: [ + ScheduledTransaction( + requestedDelta: futureDelta, + priority: highPriority, + executionEffort: 5000, + data: testData, + fees: feeAmount, + failWithErr: nil + ) + ], + transactionsIndicesToCancel: [0], + expectedAvailableEfforts: { + futureDelta: { + highPriority: highPriorityMaxEffort, + mediumPriority: mediumPriorityMaxEffort, + lowPriority: lowPriorityMaxEffort + } + }, + expectedPendingQueues: { + futureDelta: [] + }, + expectedPendingQueueAfterExecution: [] + ), + + ScheduleAndEffortUsedTestCase( + name: "Cancel Tests: Medium priority transaction canceled after scheduling", + transactions: [ + ScheduledTransaction( + requestedDelta: futureDelta, + priority: mediumPriority, + executionEffort: 3000, + data: testData, + fees: feeAmount, + failWithErr: nil + ) + ], + transactionsIndicesToCancel: [0], + expectedAvailableEfforts: { + futureDelta: { + highPriority: highPriorityMaxEffort, + mediumPriority: mediumPriorityMaxEffort, + lowPriority: lowPriorityMaxEffort + } + }, + expectedPendingQueues: { + futureDelta: [] + }, + expectedPendingQueueAfterExecution: [] + ), + + ScheduleAndEffortUsedTestCase( + name: "Cancel Tests: Low priority transaction canceled after scheduling", + transactions: [ + ScheduledTransaction( + requestedDelta: futureDelta, + priority: lowPriority, + executionEffort: 2000, + data: testData, + fees: feeAmount, + failWithErr: nil + ) + ], + transactionsIndicesToCancel: [0], + expectedAvailableEfforts: { + futureDelta: { + highPriority: highPriorityMaxEffort, + mediumPriority: mediumPriorityMaxEffort, + lowPriority: lowPriorityMaxEffort + } + }, + expectedPendingQueues: { + futureDelta: [] + }, + expectedPendingQueueAfterExecution: [] + ), + + ScheduleAndEffortUsedTestCase( + name: "Cancel Tests: Multiple transactions with one canceled", + transactions: [ + ScheduledTransaction( + requestedDelta: futureDelta, + priority: highPriority, + executionEffort: 4000, + data: testData, + fees: feeAmount, + failWithErr: nil + ), + ScheduledTransaction( + requestedDelta: futureDelta, + priority: mediumPriority, + executionEffort: 2500, + data: testData, + fees: feeAmount, + failWithErr: nil + ), + ScheduledTransaction( + requestedDelta: futureDelta, + priority: lowPriority, + executionEffort: 1500, + data: testData, + fees: feeAmount, + failWithErr: nil + ) + ], + transactionsIndicesToCancel: [1], + expectedAvailableEfforts: { + futureDelta: { + highPriority: highPriorityMaxEffort - 4000, + mediumPriority: mediumPriorityMaxEffort, + lowPriority: lowPriorityMaxEffort - 1500 + } + }, + expectedPendingQueues: { + futureDelta: [1, 3] + }, + expectedPendingQueueAfterExecution: [] + ), + + ScheduleAndEffortUsedTestCase( + name: "Cancel Tests: Multiple transactions with multiple canceled", + transactions: [ + ScheduledTransaction( + requestedDelta: futureDelta, + priority: highPriority, + executionEffort: 4000, + data: testData, + fees: feeAmount, + failWithErr: nil + ), + ScheduledTransaction( + requestedDelta: futureDelta, + priority: mediumPriority, + executionEffort: 2500, + data: testData, + fees: feeAmount, + failWithErr: nil + ), + ScheduledTransaction( + requestedDelta: futureDelta, + priority: lowPriority, + executionEffort: 1500, + data: testData, + fees: feeAmount, + failWithErr: nil + ) + ], + transactionsIndicesToCancel: [0, 2], + expectedAvailableEfforts: { + futureDelta: { + highPriority: highPriorityMaxEffort, + mediumPriority: mediumPriorityMaxEffort - 2500, + lowPriority: lowPriorityMaxEffort + } + }, + expectedPendingQueues: { + futureDelta: [2] + }, + expectedPendingQueueAfterExecution: [] + ), + ScheduleAndEffortUsedTestCase( + name: "Cancel Tests: Transaction canceled with different timestamp", + transactions: [ + ScheduledTransaction( + requestedDelta: futureDelta + 50.0, + priority: highPriority, + executionEffort: 6000, + data: testData, + fees: feeAmount, + failWithErr: nil + ) + ], + transactionsIndicesToCancel: [0], + expectedAvailableEfforts: { + futureDelta: { + highPriority: highPriorityMaxEffort, + mediumPriority: mediumPriorityMaxEffort, + lowPriority: lowPriorityMaxEffort + }, + futureDelta + 50.0: { + highPriority: highPriorityMaxEffort, + mediumPriority: mediumPriorityMaxEffort, + lowPriority: lowPriorityMaxEffort + } + }, + expectedPendingQueues: { + futureDelta + 50.0: [] + }, + expectedPendingQueueAfterExecution: [] + ), + ScheduleAndEffortUsedTestCase( + name: "Cancel Tests: Cancel a transaction that was moved to a different timestamp by another transaction", + transactions: [ + ScheduledTransaction( + requestedDelta: futureDelta, + priority: lowPriority, + executionEffort: lowPriorityMaxEffort, + data: testData, + fees: feeAmount, + failWithErr: nil + ), + highTransactionWith8000Effort, + highTransactionWith8000Effort, + highTransactionWith8000Effort, + ScheduledTransaction( + requestedDelta: futureDelta, + priority: highPriority, + executionEffort: 6000, + data: testData, + fees: feeAmount, + failWithErr: nil + ), + ScheduledTransaction( + requestedDelta: futureDelta, + priority: mediumPriority, + executionEffort: lowPriorityMaxEffort, + data: testData, + fees: feeAmount, + failWithErr: nil + ) + ], + transactionsIndicesToCancel: [0], + expectedAvailableEfforts: { + futureDelta: { + highPriority: 0, + mediumPriority: 0, + lowPriority: 0 + }, + futureDelta + 1.0: { + highPriority: highPriorityMaxEffort, + mediumPriority: mediumPriorityMaxEffort, + lowPriority: lowPriorityMaxEffort + } + }, + expectedPendingQueues: { + futureDelta: [2,3,4,5,6], + futureDelta + 1.0: [2,3,4,5,6] + }, + expectedPendingQueueAfterExecution: [] + ), + ScheduleAndEffortUsedTestCase( + name: "Fail Tests: Transaction with fail data should fail during execution", + transactions: [ + ScheduledTransaction( + requestedDelta: futureDelta, + priority: mediumPriority, + executionEffort: 2000, + data: "fail", + fees: feeAmount, + failWithErr: nil + ) + ], + transactionsIndicesToCancel: [], + expectedAvailableEfforts: { + futureDelta: { + highPriority: highPriorityMaxEffort, + mediumPriority: mediumPriorityMaxEffort - 2000, + lowPriority: lowPriorityMaxEffort + } + }, + expectedPendingQueues: { + futureDelta: [1] + }, + expectedPendingQueueAfterExecution: [] + ), + ScheduleAndEffortUsedTestCase( + name: "Schedule Tests: Transaction schedules another transaction during execution", + transactions: [ + ScheduledTransaction( + requestedDelta: futureDelta, + priority: highPriority, + executionEffort: 3000, + data: "schedule", + fees: feeAmount, + failWithErr: nil + ) + ], + transactionsIndicesToCancel: [], + expectedAvailableEfforts: { + futureDelta: { + highPriority: highPriorityMaxEffort - 3000, + mediumPriority: mediumPriorityMaxEffort, + lowPriority: lowPriorityMaxEffort + } + }, + expectedPendingQueues: { + futureDelta: [1] + }, + expectedPendingQueueAfterExecution: [2] + ) + ] + + /// Test case to test transactions over collection effort limit + /// + var transactionsOverCollectionEffortLimit: [ScheduledTransaction] = [] + while UInt64(transactionsOverCollectionEffortLimit.length)*maxEffort <= collectionEffortLimit + maxEffort*2 { + transactionsOverCollectionEffortLimit.append(ScheduledTransaction( + requestedDelta: futureDelta+UFix64(transactionsOverCollectionEffortLimit.length), + priority: mediumPriority, + executionEffort: maxEffort, + data: testData, + fees: feeAmount, + failWithErr: nil + )) + } + + var expectedPendingQueue: {UFix64: [UInt64]} = {} + var queue: [UInt64] = [] + var i: Int = 1 + while i <= transactionsOverCollectionEffortLimit.length - 3 { + queue.append(UInt64(i)) + i = i + 1 + } + expectedPendingQueue[futureDelta+UFix64(transactionsOverCollectionEffortLimit.length)] = queue + + testCases.append(ScheduleAndEffortUsedTestCase( + name: "Collection Limit Tests: Transactions over collection effort limit", + transactions: transactionsOverCollectionEffortLimit, + transactionsIndicesToCancel: [], + expectedAvailableEfforts: {}, + expectedPendingQueues: expectedPendingQueue, + expectedPendingQueueAfterExecution: [UInt64(transactionsOverCollectionEffortLimit.length-2), UInt64(transactionsOverCollectionEffortLimit.length-1), UInt64(transactionsOverCollectionEffortLimit.length)] + )) + + /// Test case to test transactions over collection transaction limit + /// + var transactionsOverCollectionTxLimit: [ScheduledTransaction] = [] + while transactionsOverCollectionTxLimit.length < collectionTransactionsLimit + 2 { + transactionsOverCollectionTxLimit.append(ScheduledTransaction( + requestedDelta: futureDelta+UFix64(transactionsOverCollectionTxLimit.length), + priority: mediumPriority, + executionEffort: 2000, + data: testData, + fees: feeAmount, + failWithErr: nil + )) + } + + expectedPendingQueue = {} + queue = [] + i = 1 + while i <= collectionTransactionsLimit { + queue.append(UInt64(i)) + i = i + 1 + } + expectedPendingQueue[futureDelta+UFix64(transactionsOverCollectionTxLimit.length)] = queue + + testCases.append(ScheduleAndEffortUsedTestCase( + name: "Collection Limit Tests: Transactions over collection transaction limit", + transactions: transactionsOverCollectionTxLimit, + transactionsIndicesToCancel: [], + expectedAvailableEfforts: {}, + expectedPendingQueues: expectedPendingQueue, + expectedPendingQueueAfterExecution: [UInt64(collectionTransactionsLimit+1), UInt64(collectionTransactionsLimit+2)] + )) + + var currentTimestamp = getTimestamp() + + for testCase in testCases { + currentTimestamp = runScheduleAndEffortUsedTestCase(testCase: testCase, currentTimestamp: currentTimestamp) + if startingHeight < getCurrentBlockHeight() { + Test.reset(to: startingHeight) + } + } +} \ No newline at end of file diff --git a/tests/transactionScheduler_test.cdc b/tests/transactionScheduler_test.cdc new file mode 100644 index 000000000..c8b3faf8f --- /dev/null +++ b/tests/transactionScheduler_test.cdc @@ -0,0 +1,852 @@ +import Test +import BlockchainHelpers +import "FlowTransactionScheduler" +import "FlowToken" +import "TestFlowScheduledTransactionHandler" + +import "scheduled_transaction_test_helpers.cdc" + +access(all) +fun setup() { + + var err = Test.deployContract( + name: "FlowTransactionScheduler", + path: "../contracts/FlowTransactionScheduler.cdc", + arguments: [] + ) + Test.expect(err, Test.beNil()) + + err = Test.deployContract( + name: "TestFlowScheduledTransactionHandler", + path: "../contracts/testContracts/TestFlowScheduledTransactionHandler.cdc", + arguments: [] + ) + Test.expect(err, Test.beNil()) + +} + +/** --------------------------------------------------------------------------------- + Transaction handler integration tests + --------------------------------------------------------------------------------- */ + + +access(all) fun testInit() { + + // Try to process transactions + // Nothing will process because nothing is scheduled, but should not fail + processTransactions() + + // try to get the status of a transaction that is not scheduled yet + var status = getStatus(id: UInt64(10)) + Test.assertEqual(nil, status) + + // try to get the status of transaction with ID 0 + status = getStatus(id: UInt64(0)) + Test.assertEqual(nil, status) + + // Try to execute a transaction, should fail + executeScheduledTransaction(id: UInt64(1), testName: "testInit", failWithErr: "Invalid ID: Transaction with id 1 not found") + + // verify that the available efforts are all their defaults + var effort = getSlotAvailableEffort(timestamp: futureTime, priority: highPriority) + Test.assertEqual(highPriorityMaxEffort, effort) + + effort = getSlotAvailableEffort(timestamp: futureTime, priority: mediumPriority) + Test.assertEqual(mediumPriorityMaxEffort, effort) + + effort = getSlotAvailableEffort(timestamp: futureTime, priority: lowPriority) + Test.assertEqual(lowPriorityMaxEffort, effort) +} + +access(all) fun testGetSizeOfData() { + + // Test different values for data to verify that it reports the correct sizes + var size = getSizeOfData(data: 1) + Test.assertEqual(0.00000000 as UFix64, size) + + size = getSizeOfData(data: 100000000) + Test.assertEqual(0.00000000 as UFix64, size) + + size = getSizeOfData(data: StoragePath(identifier: "scheduledTransactionsStoragePath")) + Test.assertEqual(0.00005600 as UFix64, size) + + size = getSizeOfData(data: testData) + Test.assertEqual(0.00003000 as UFix64, size) + + // let largeArray: [Int] = [] + // while largeArray.length < 10000 { + // largeArray.append(1) + // } + + // size = getSizeOfData(data: largeArray) + // Test.assertEqual(0.05286100 as UFix64, size) +} + +/** --------------------------------------------------------------------------------- + Transaction scheduler estimate() tests + --------------------------------------------------------------------------------- */ + +// Test case structure for estimate function +access(all) struct EstimateTestCase { + access(all) let name: String + access(all) let timestamp: UFix64 + access(all) let priority: FlowTransactionScheduler.Priority + access(all) let executionEffort: UInt64 + access(all) let data: AnyStruct? + access(all) let expectedFee: UFix64? + access(all) let expectedTimestamp: UFix64? + access(all) let expectedError: String? + + access(all) init( + name: String, + timestamp: UFix64, + priority: FlowTransactionScheduler.Priority, + executionEffort: UInt64, + data: AnyStruct?, + expectedFee: UFix64?, + expectedTimestamp: UFix64?, + expectedError: String? + ) { + self.name = name + self.timestamp = timestamp + self.priority = priority + self.executionEffort = executionEffort + self.data = data + self.expectedFee = expectedFee + self.expectedTimestamp = expectedTimestamp + self.expectedError = expectedError + } +} + +access(all) fun testEstimate() { + + let currentTime = getCurrentBlock().timestamp + let futureTime = currentTime + 100.0 + let pastTime = currentTime - 100.0 + let farFutureTime = currentTime + 10000.0 + + let estimateTestCases: [EstimateTestCase] = [ + // Error cases - should return EstimatedScheduledTransaction with error + EstimateTestCase( + name: "Low priority returns requested timestamp and error", + timestamp: futureTime, + priority: FlowTransactionScheduler.Priority.Low, + executionEffort: 1000, + data: nil, + expectedFee: 0.00002, + expectedTimestamp: futureTime, + expectedError: "Invalid Priority: Cannot estimate for Low Priority transactions. They will be included in the first block with available space after their requested timestamp." + ), + EstimateTestCase( + name: "Past timestamp returns error", + timestamp: pastTime, + priority: FlowTransactionScheduler.Priority.High, + executionEffort: 1000, + data: nil, + expectedFee: nil, + expectedTimestamp: nil, + expectedError: "Invalid timestamp: \(pastTime) is in the past, current timestamp: " + ), + EstimateTestCase( + name: "Current timestamp returns error", + timestamp: currentTime, + priority: FlowTransactionScheduler.Priority.Medium, + executionEffort: 1000, + data: nil, + expectedFee: nil, + expectedTimestamp: nil, + expectedError: "Invalid timestamp: \(currentTime) is in the past, current timestamp: " + ), + EstimateTestCase( + name: "Zero execution effort returns error", + timestamp: futureTime + 7.0, + priority: FlowTransactionScheduler.Priority.High, + executionEffort: 0, + data: nil, + expectedFee: nil, + expectedTimestamp: nil, + expectedError: "Invalid execution effort: 0 is less than the minimum execution effort of 10" + ), + EstimateTestCase( + name: "Excessive high priority effort returns error", + timestamp: futureTime + 8.0, + priority: FlowTransactionScheduler.Priority.High, + executionEffort: 50000, + data: nil, + expectedFee: nil, + expectedTimestamp: nil, + expectedError: "Invalid execution effort: 50000 is greater than the maximum transaction effort of 9999" + ), + EstimateTestCase( + name: "Excessive medium priority effort returns error", + timestamp: futureTime + 9.0, + priority: FlowTransactionScheduler.Priority.Medium, + executionEffort: 10000, + data: nil, + expectedFee: nil, + expectedTimestamp: nil, + expectedError: "Invalid execution effort: 10000 is greater than the maximum transaction effort of 9999" + ), + EstimateTestCase( + name: "Excessive low priority effort returns error", + timestamp: futureTime + 10.0, + priority: FlowTransactionScheduler.Priority.Low, + executionEffort: 5001, + data: nil, + expectedFee: nil, + expectedTimestamp: nil, + expectedError: "Invalid execution effort: 5001 is greater than the priority's max effort of 5000" + ), + + // Valid cases - should return EstimatedScheduledTransaction with no error + EstimateTestCase( + name: "High priority effort", + timestamp: futureTime + 1.0, + priority: FlowTransactionScheduler.Priority.High, + executionEffort: 5000, + data: nil, + expectedFee: 0.0001, + expectedTimestamp: futureTime + 1.0, + expectedError: nil + ), + EstimateTestCase( + name: "Medium priority minimum effort", + timestamp: futureTime + 4.0, + priority: FlowTransactionScheduler.Priority.Medium, + executionEffort: 10, + data: nil, + expectedFee: 0.00005, + expectedTimestamp: futureTime + 4.0, + expectedError: nil + ), + EstimateTestCase( + name: "Far future timestamp", + timestamp: farFutureTime, + priority: FlowTransactionScheduler.Priority.High, + executionEffort: 1000, + data: nil, + expectedFee: 0.0001, + expectedTimestamp: farFutureTime, + expectedError: nil + ), + EstimateTestCase( + name: "String data", + timestamp: futureTime + 10.0, + priority: FlowTransactionScheduler.Priority.High, + executionEffort: 1000, + data: "string data", + expectedFee: 0.0001, + expectedTimestamp: futureTime + 10.0, + expectedError: nil + ), + EstimateTestCase( + name: "Dictionary data", + timestamp: futureTime + 11.0, + priority: FlowTransactionScheduler.Priority.Medium, + executionEffort: 1000, + data: {"key": "value"}, + expectedFee: 0.00005, + expectedTimestamp: futureTime + 11.0, + expectedError: nil + ), + EstimateTestCase( + name: "Array data", + timestamp: futureTime + 12.0, + priority: FlowTransactionScheduler.Priority.Medium, + executionEffort: 1000, + data: [1, 2, 3, 4, 5, 6], + expectedFee: 0.00005, + expectedTimestamp: futureTime + 12.0, + expectedError: nil + ) + ] + + for testCase in estimateTestCases { + runEstimateTestCase(testCase: testCase) + } +} + +access(all) fun runEstimateTestCase(testCase: EstimateTestCase) { + let estimate = FlowTransactionScheduler.estimate( + data: testCase.data, + timestamp: testCase.timestamp, + priority: testCase.priority, + executionEffort: testCase.executionEffort + ) + + // Check fee + if let expectedFee = testCase.expectedFee { + let fee = estimate.flowFee ?? panic("Couldn't unwrap fee for test case: \(testCase.name)") + Test.assert(expectedFee == estimate.flowFee, message: "fee mismatch for test case: \(testCase.name). Expected \(expectedFee) but got \(estimate.flowFee!)") + } else { + Test.assert(estimate.flowFee == nil, message: "expected nil fee for test case: \(testCase.name)") + } + + // Check timestamp + if let expectedTimestamp = testCase.expectedTimestamp { + Test.assert(expectedTimestamp == estimate.timestamp, message: "timestamp mismatch for test case: \(testCase.name)") + } else { + Test.assert(estimate.timestamp == nil, message: "expected nil timestamp for test case: \(testCase.name)") + } + + // Check error + if let expectedError = testCase.expectedError { + Test.assert(estimate.error!.contains(expectedError), message: "error mismatch for test case: \(testCase.name). Expected \(expectedError) but got \(estimate.error!)") + } else { + Test.assert(estimate.error == nil, message: "expected nil error for test case: \(testCase.name)") + } +} + +/** --------------------------------------------------------------------------------- + Transaction scheduler config details tests + --------------------------------------------------------------------------------- */ + + +access(all) fun testConfigDetails() { + + /** ------------- + Error Test Cases + ---------------- */ + setConfigDetails( + maximumIndividualEffort: nil, + minimumExecutionEffort: nil, + slotSharedEffortLimit: nil, + priorityEffortReserve: nil, + priorityEffortLimit: nil, + maxDataSizeMB: nil, + priorityFeeMultipliers: nil, + refundMultiplier: 1.1, + canceledTransactionsLimit: nil, + collectionEffortLimit: nil, + collectionTransactionsLimit: nil, + shouldFail: "Invalid refund multiplier: The multiplier must be between 0.0 and 1.0 but got 1.10000000" + ) + + setConfigDetails( + maximumIndividualEffort: nil, + minimumExecutionEffort: nil, + slotSharedEffortLimit: nil, + priorityEffortReserve: nil, + priorityEffortLimit: nil, + maxDataSizeMB: nil, + priorityFeeMultipliers: {highPriority: 20.0, mediumPriority: 10.0, lowPriority: 0.9}, + refundMultiplier: nil, + canceledTransactionsLimit: nil, + collectionEffortLimit: nil, + collectionTransactionsLimit: nil, + shouldFail: "Invalid priority fee multiplier: Low priority multiplier must be greater than or equal to 1.0 but got 0.90000000" + ) + + setConfigDetails( + maximumIndividualEffort: nil, + minimumExecutionEffort: nil, + slotSharedEffortLimit: nil, + priorityEffortReserve: nil, + priorityEffortLimit: nil, + maxDataSizeMB: nil, + priorityFeeMultipliers: {highPriority: 20.0, mediumPriority: 3.0, lowPriority: 4.0}, + refundMultiplier: nil, + canceledTransactionsLimit: nil, + collectionEffortLimit: nil, + collectionTransactionsLimit: nil, + shouldFail: "Invalid priority fee multiplier: Medium priority multiplier must be greater than or equal to 4.00000000 but got 3.00000000" + ) + + setConfigDetails( + maximumIndividualEffort: nil, + minimumExecutionEffort: nil, + slotSharedEffortLimit: nil, + priorityEffortReserve: nil, + priorityEffortLimit: nil, + maxDataSizeMB: nil, + priorityFeeMultipliers: {highPriority: 5.0, mediumPriority: 6.0, lowPriority: 4.0}, + refundMultiplier: nil, + canceledTransactionsLimit: nil, + collectionEffortLimit: nil, + collectionTransactionsLimit: nil, + shouldFail: "Invalid priority fee multiplier: High priority multiplier must be greater than or equal to 6.00000000 but got 5.00000000" + ) + + setConfigDetails( + maximumIndividualEffort: nil, + minimumExecutionEffort: nil, + slotSharedEffortLimit: nil, + priorityEffortReserve: {highPriority: 40000, mediumPriority: 30000, lowPriority: 10000}, + priorityEffortLimit: {highPriority: 30000, mediumPriority: 30000, lowPriority: 10000}, + maxDataSizeMB: nil, + priorityFeeMultipliers: nil, + refundMultiplier: nil, + canceledTransactionsLimit: nil, + collectionEffortLimit: nil, + collectionTransactionsLimit: nil, + shouldFail: "Invalid priority effort limit: High priority effort limit must be greater than or equal to the priority effort reserve of 40000" + ) + + setConfigDetails( + maximumIndividualEffort: nil, + minimumExecutionEffort: nil, + slotSharedEffortLimit: nil, + priorityEffortReserve: {highPriority: 30000, mediumPriority: 40000, lowPriority: 10000}, + priorityEffortLimit: {highPriority: 30000, mediumPriority: 30000, lowPriority: 10000}, + maxDataSizeMB: nil, + priorityFeeMultipliers: nil, + refundMultiplier: nil, + canceledTransactionsLimit: nil, + collectionEffortLimit: nil, + collectionTransactionsLimit: nil, + shouldFail: "Invalid priority effort limit: Medium priority effort limit must be greater than or equal to the priority effort reserve of 40000" + ) + + setConfigDetails( + maximumIndividualEffort: nil, + minimumExecutionEffort: nil, + slotSharedEffortLimit: nil, + priorityEffortReserve: {highPriority: 30000, mediumPriority: 30000, lowPriority: 20000}, + priorityEffortLimit: {highPriority: 30000, mediumPriority: 30000, lowPriority: 10000}, + maxDataSizeMB: nil, + priorityFeeMultipliers: nil, + refundMultiplier: nil, + canceledTransactionsLimit: nil, + collectionEffortLimit: nil, + collectionTransactionsLimit: nil, + shouldFail: "Invalid priority effort limit: Low priority effort limit must be greater than or equal to the priority effort reserve of 20000" + ) + + setConfigDetails( + maximumIndividualEffort: nil, + minimumExecutionEffort: nil, + slotSharedEffortLimit: nil, + priorityEffortReserve: nil, + priorityEffortLimit: nil, + maxDataSizeMB: nil, + priorityFeeMultipliers: nil, + refundMultiplier: nil, + canceledTransactionsLimit: nil, + collectionEffortLimit: 30000 as UInt64, + collectionTransactionsLimit: nil, + shouldFail: "Invalid collection effort limit: Collection effort limit must be greater than 35000 but got 30000" + ) + + setConfigDetails( + maximumIndividualEffort: nil, + minimumExecutionEffort: nil, + slotSharedEffortLimit: nil, + priorityEffortReserve: nil, + priorityEffortLimit: nil, + maxDataSizeMB: nil, + priorityFeeMultipliers: nil, + refundMultiplier: nil, + canceledTransactionsLimit: nil, + collectionEffortLimit: nil, + collectionTransactionsLimit: -1, + shouldFail: "Invalid collection transactions limit: Collection transactions limit must be greater than or equal to 0 but got -1" + ) + + setConfigDetails( + maximumIndividualEffort: nil, + minimumExecutionEffort: nil, + slotSharedEffortLimit: nil, + priorityEffortReserve: nil, + priorityEffortLimit: nil, + maxDataSizeMB: nil, + priorityFeeMultipliers: nil, + refundMultiplier: nil, + canceledTransactionsLimit: 0, + collectionEffortLimit: nil, + collectionTransactionsLimit: nil, + shouldFail: "Invalid canceled transactions limit: Canceled transactions limit must be greater than or equal to 1 but got 0" + ) + + + /** ------------- + Valid Test Case + ---------------- */ + let oldConfig = getConfigDetails() + Test.assertEqual(9999 as UInt64,oldConfig.maximumIndividualEffort) + Test.assertEqual(10 as UInt64,oldConfig.minimumExecutionEffort) + Test.assertEqual(35000 as UInt64,oldConfig.slotTotalEffortLimit) + Test.assertEqual(10000 as UInt64,oldConfig.slotSharedEffortLimit) + Test.assertEqual(20000 as UInt64,oldConfig.priorityEffortReserve[FlowTransactionScheduler.Priority.High]!) + Test.assertEqual(5000 as UInt64,oldConfig.priorityEffortReserve[FlowTransactionScheduler.Priority.Medium]!) + Test.assertEqual(0 as UInt64,oldConfig.priorityEffortReserve[FlowTransactionScheduler.Priority.Low]!) + Test.assertEqual(30000 as UInt64,oldConfig.priorityEffortLimit[FlowTransactionScheduler.Priority.High]!) + Test.assertEqual(15000 as UInt64,oldConfig.priorityEffortLimit[FlowTransactionScheduler.Priority.Medium]!) + Test.assertEqual(5000 as UInt64,oldConfig.priorityEffortLimit[FlowTransactionScheduler.Priority.Low]!) + Test.assertEqual(3.0,oldConfig.maxDataSizeMB) + Test.assertEqual(10.0,oldConfig.priorityFeeMultipliers[FlowTransactionScheduler.Priority.High]!) + Test.assertEqual(5.0,oldConfig.priorityFeeMultipliers[FlowTransactionScheduler.Priority.Medium]!) + Test.assertEqual(2.0,oldConfig.priorityFeeMultipliers[FlowTransactionScheduler.Priority.Low]!) + Test.assertEqual(0.5,oldConfig.refundMultiplier) + Test.assertEqual(1000 as UInt,oldConfig.canceledTransactionsLimit) + Test.assertEqual(500000 as UInt64,oldConfig.collectionEffortLimit) + Test.assertEqual(150 as Int,oldConfig.collectionTransactionsLimit) + + + setConfigDetails( + maximumIndividualEffort: 14999, + minimumExecutionEffort: 10, + slotSharedEffortLimit: 20000, + priorityEffortReserve: nil, + priorityEffortLimit: {highPriority: 30000, mediumPriority: 30000, lowPriority: 10000}, + maxDataSizeMB: 1.0, + priorityFeeMultipliers: {highPriority: 20.0, mediumPriority: 10.0, lowPriority: 4.0}, + refundMultiplier: nil, + canceledTransactionsLimit: 2000, + collectionEffortLimit: 800000, + collectionTransactionsLimit: 90, + shouldFail: nil + ) + + // Verify new config details + let newConfig = getConfigDetails() + Test.assertEqual(14999 as UInt64,newConfig.maximumIndividualEffort) + Test.assertEqual(10 as UInt64,newConfig.minimumExecutionEffort) + Test.assertEqual(45000 as UInt64,newConfig.slotTotalEffortLimit) + Test.assertEqual(20000 as UInt64,newConfig.slotSharedEffortLimit) + Test.assertEqual(oldConfig.priorityEffortReserve[FlowTransactionScheduler.Priority.High]!,newConfig.priorityEffortReserve[FlowTransactionScheduler.Priority.High]!) + Test.assertEqual(oldConfig.priorityEffortReserve[FlowTransactionScheduler.Priority.Medium]!,newConfig.priorityEffortReserve[FlowTransactionScheduler.Priority.Medium]!) + Test.assertEqual(oldConfig.priorityEffortReserve[FlowTransactionScheduler.Priority.Low]!,newConfig.priorityEffortReserve[FlowTransactionScheduler.Priority.Low]!) + Test.assertEqual(30000 as UInt64,newConfig.priorityEffortLimit[FlowTransactionScheduler.Priority.High]!) + Test.assertEqual(30000 as UInt64,newConfig.priorityEffortLimit[FlowTransactionScheduler.Priority.Medium]!) + Test.assertEqual(10000 as UInt64,newConfig.priorityEffortLimit[FlowTransactionScheduler.Priority.Low]!) + Test.assertEqual(1.0,newConfig.maxDataSizeMB) + Test.assertEqual(20.0,newConfig.priorityFeeMultipliers[FlowTransactionScheduler.Priority.High]!) + Test.assertEqual(10.0,newConfig.priorityFeeMultipliers[FlowTransactionScheduler.Priority.Medium]!) + Test.assertEqual(4.0,newConfig.priorityFeeMultipliers[FlowTransactionScheduler.Priority.Low]!) + Test.assertEqual(oldConfig.refundMultiplier,newConfig.refundMultiplier) + Test.assertEqual(2000 as UInt,newConfig.canceledTransactionsLimit) + Test.assertEqual(800000 as UInt64,newConfig.collectionEffortLimit) + Test.assertEqual(90 as Int,newConfig.collectionTransactionsLimit) +} + +/** --------------------------------------------------------------------------------- + SortedTimestamps struct tests + --------------------------------------------------------------------------------- */ + +// Test case structures for table-driven tests +access(all) struct AddTestCase { + access(all) let name: String + access(all) let timestampsToAdd: [UFix64] + access(all) let expectedLength: Int + access(all) let expectedOrder: [UFix64]? + + access(all) init(name: String, timestampsToAdd: [UFix64], expectedLength: Int, expectedOrder: [UFix64]?) { + self.name = name + self.timestampsToAdd = timestampsToAdd + self.expectedLength = expectedLength + self.expectedOrder = expectedOrder + } +} + +access(all) struct RemoveTestCase { + access(all) let name: String + access(all) let initialTimestamps: [UFix64] + access(all) let timestampToRemove: UFix64 + access(all) let expectedLength: Int + access(all) let expectedRemaining: [UFix64] + + access(all) init(name: String, initialTimestamps: [UFix64], timestampToRemove: UFix64, expectedLength: Int, expectedRemaining: [UFix64]) { + self.name = name + self.initialTimestamps = initialTimestamps + self.timestampToRemove = timestampToRemove + self.expectedLength = expectedLength + self.expectedRemaining = expectedRemaining + } +} + +access(all) struct PastTestCase { + access(all) let name: String + access(all) let timestamps: [UFix64] + access(all) let current: UFix64 + access(all) let expectedPast: [UFix64] + + access(all) init(name: String, timestamps: [UFix64], current: UFix64, expectedPast: [UFix64]) { + self.name = name + self.timestamps = timestamps + self.current = current + self.expectedPast = expectedPast + } +} + +access(all) struct CheckTestCase { + access(all) let name: String + access(all) let timestamps: [UFix64] + access(all) let current: UFix64 + access(all) let expected: Bool + + access(all) init(name: String, timestamps: [UFix64], current: UFix64, expected: Bool) { + self.name = name + self.timestamps = timestamps + self.current = current + self.expected = expected + } +} + +access(all) fun testSortedTimestampsInit() { + let sortedTimestamps = FlowTransactionScheduler.SortedTimestamps() + + // Test that it initializes with empty timestamps + let pastTimestamps = sortedTimestamps.getBefore(current: 100.0) + Test.assertEqual(0, pastTimestamps.length) + + // Test that check returns false for empty timestamps + Test.assertEqual(false, sortedTimestamps.hasBefore(current: 100.0)) +} + +access(all) fun testSortedTimestampsAdd() { + let testCases: [AddTestCase] = [ + AddTestCase( + name: "Add timestamps in random order", + timestampsToAdd: [50.0, 30.0, 70.0, 10.0, 40.0], + expectedLength: 5, + expectedOrder: [10.0, 30.0, 40.0, 50.0, 70.0] + ), + AddTestCase( + name: "Add duplicate timestamp", + timestampsToAdd: [30.0, 30.0], + expectedLength: 2, + expectedOrder: [30.0, 30.0] + ), + AddTestCase( + name: "Add single timestamp", + timestampsToAdd: [42.0], + expectedLength: 1, + expectedOrder: [42.0] + ), + AddTestCase( + name: "Add already sorted timestamps", + timestampsToAdd: [10.0, 20.0, 30.0, 40.0], + expectedLength: 4, + expectedOrder: [10.0, 20.0, 30.0, 40.0] + ) + ] + + for testCase in testCases { + let sortedTimestamps = FlowTransactionScheduler.SortedTimestamps() + + // Add all timestamps + for timestamp in testCase.timestampsToAdd { + sortedTimestamps.add(timestamp: timestamp) + } + + // Verify result + let result = sortedTimestamps.getBefore(current: 100.0) + Test.assertEqual(testCase.expectedLength, result.length) + + if let expectedOrder = testCase.expectedOrder { + for i, expected in expectedOrder { + Test.assertEqual(expected, result[i]) + } + } + } +} + +access(all) fun testSortedTimestampsRemove() { + let testCases: [RemoveTestCase] = [ + RemoveTestCase( + name: "Remove middle timestamp", + initialTimestamps: [10.0, 20.0, 30.0, 40.0, 50.0], + timestampToRemove: 30.0, + expectedLength: 4, + expectedRemaining: [10.0, 20.0, 40.0, 50.0] + ), + RemoveTestCase( + name: "Remove first timestamp", + initialTimestamps: [10.0, 20.0, 30.0], + timestampToRemove: 10.0, + expectedLength: 2, + expectedRemaining: [20.0, 30.0] + ), + RemoveTestCase( + name: "Remove last timestamp", + initialTimestamps: [10.0, 20.0, 30.0], + timestampToRemove: 30.0, + expectedLength: 2, + expectedRemaining: [10.0, 20.0] + ), + RemoveTestCase( + name: "Remove non-existent timestamp", + initialTimestamps: [10.0, 20.0], + timestampToRemove: 99.0, + expectedLength: 2, + expectedRemaining: [10.0, 20.0] + ), + RemoveTestCase( + name: "Remove from single element", + initialTimestamps: [25.0], + timestampToRemove: 25.0, + expectedLength: 0, + expectedRemaining: [] + ) + ] + + for testCase in testCases { + let sortedTimestamps = FlowTransactionScheduler.SortedTimestamps() + + // Add initial timestamps + for timestamp in testCase.initialTimestamps { + sortedTimestamps.add(timestamp: timestamp) + } + + // Remove the specified timestamp + sortedTimestamps.remove(timestamp: testCase.timestampToRemove) + + // Verify result + let result = sortedTimestamps.getBefore(current: 100.0) + Test.assertEqual(testCase.expectedLength, result.length) + + for i, expected in testCase.expectedRemaining { + Test.assertEqual(expected, result[i]) + } + } +} + +access(all) fun testSortedTimestampsPast() { + let testCases: [PastTestCase] = [ + PastTestCase( + name: "Get past timestamps with current = 25.0", + timestamps: [10.0, 20.0, 30.0, 40.0, 50.0], + current: 25.0, + expectedPast: [10.0, 20.0] + ), + PastTestCase( + name: "Get past timestamps with current = 30.0 (inclusive)", + timestamps: [10.0, 20.0, 30.0, 40.0, 50.0], + current: 30.0, + expectedPast: [10.0, 20.0, 30.0] + ), + PastTestCase( + name: "Get past timestamps with current = 0.0 (none)", + timestamps: [10.0, 20.0, 30.0], + current: 0.0, + expectedPast: [] + ), + PastTestCase( + name: "Get all timestamps", + timestamps: [10.0, 20.0, 30.0, 40.0, 50.0], + current: 100.0, + expectedPast: [10.0, 20.0, 30.0, 40.0, 50.0] + ), + PastTestCase( + name: "Empty timestamps array", + timestamps: [], + current: 50.0, + expectedPast: [] + ), + PastTestCase( + name: "Current exactly between timestamps", + timestamps: [10.0, 30.0], + current: 20.0, + expectedPast: [10.0] + ) + ] + + for testCase in testCases { + let sortedTimestamps = FlowTransactionScheduler.SortedTimestamps() + + // Add timestamps + for timestamp in testCase.timestamps { + sortedTimestamps.add(timestamp: timestamp) + } + + // Get past timestamps + let result = sortedTimestamps.getBefore(current: testCase.current) + + // Verify result + Test.assertEqual(testCase.expectedPast.length, result.length) + + for i, expected in testCase.expectedPast { + Test.assertEqual(expected, result[i]) + } + } +} + +access(all) fun testSortedTimestampsCheck() { + let testCases: [CheckTestCase] = [ + CheckTestCase( + name: "Check on empty array", + timestamps: [], + current: 100.0, + expected: false + ), + CheckTestCase( + name: "Current before first timestamp", + timestamps: [50.0], + current: 49.0, + expected: false + ), + CheckTestCase( + name: "Current equal to first timestamp", + timestamps: [50.0], + current: 50.0, + expected: true + ), + CheckTestCase( + name: "Current after first timestamp", + timestamps: [50.0], + current: 51.0, + expected: true + ), + CheckTestCase( + name: "Multiple timestamps, check before first", + timestamps: [30.0, 50.0, 70.0], + current: 29.0, + expected: false + ), + CheckTestCase( + name: "Multiple timestamps, check equal to first", + timestamps: [30.0, 50.0, 70.0], + current: 30.0, + expected: true + ), + CheckTestCase( + name: "Multiple timestamps, check after all", + timestamps: [30.0, 50.0, 70.0], + current: 100.0, + expected: true + ) + ] + + for testCase in testCases { + let sortedTimestamps = FlowTransactionScheduler.SortedTimestamps() + + // Add timestamps + for timestamp in testCase.timestamps { + sortedTimestamps.add(timestamp: timestamp) + } + + // Check result + let result = sortedTimestamps.hasBefore(current: testCase.current) + Test.assertEqual(testCase.expected, result) + } +} + +access(all) fun testSortedTimestampsEdgeCases() { + let sortedTimestamps = FlowTransactionScheduler.SortedTimestamps() + + // Test adding timestamps at boundaries + sortedTimestamps.add(timestamp: 0.1) + sortedTimestamps.add(timestamp: UFix64.max - 1.0) // Near max value + + let allTimestamps = sortedTimestamps.getBefore(current: UFix64.max) + Test.assertEqual(2, allTimestamps.length) + Test.assertEqual(0.1, allTimestamps[0]) + Test.assertEqual(UFix64.max - 1.0, allTimestamps[1]) + + // Test with many timestamps to verify sorting performance + let manyTimestamps = FlowTransactionScheduler.SortedTimestamps() + var i = 100 + while i > 0 { + manyTimestamps.add(timestamp: UFix64(i)) + i = i - 1 + } + + let sortedResult = manyTimestamps.getBefore(current: 200.0) + Test.assertEqual(100, sortedResult.length) + + // Verify first few are sorted correctly + Test.assertEqual(1.0, sortedResult[0]) + Test.assertEqual(2.0, sortedResult[1]) + Test.assertEqual(3.0, sortedResult[2]) + Test.assertEqual(100.0, sortedResult[99]) +} \ No newline at end of file diff --git a/tests/transactions/destroy_handler.cdc b/tests/transactions/destroy_handler.cdc new file mode 100644 index 000000000..82d61e4e2 --- /dev/null +++ b/tests/transactions/destroy_handler.cdc @@ -0,0 +1,11 @@ +import "TestFlowScheduledTransactionHandler" +import "FlowTransactionScheduler" + +transaction { + prepare(account: auth(BorrowValue, LoadValue) &Account) { + let handler <- account.storage.load<@TestFlowScheduledTransactionHandler.Handler>(from: TestFlowScheduledTransactionHandler.HandlerStoragePath) + ?? panic("Could not load TestFlowScheduledTransactionHandler") + destroy handler + } +} + diff --git a/transactions/transactionScheduler/admin/execute_transaction.cdc b/transactions/transactionScheduler/admin/execute_transaction.cdc new file mode 100644 index 000000000..671829612 --- /dev/null +++ b/transactions/transactionScheduler/admin/execute_transaction.cdc @@ -0,0 +1,12 @@ +import "FlowTransactionScheduler" + +// Execute a scheduled transaction by the FlowTransactionScheduler contract. +// This will be called by the FVM and the transaction will be executed by their ID. +transaction(id: UInt64) { + prepare(serviceAccount: auth(BorrowValue) &Account) { + let scheduler = serviceAccount.storage.borrow(from: FlowTransactionScheduler.storagePath) + ?? panic("Could not borrow FlowTransactionScheduler") + + scheduler.executeTransaction(id: id) + } +} \ No newline at end of file diff --git a/transactions/transactionScheduler/admin/process_scheduled_transactions.cdc b/transactions/transactionScheduler/admin/process_scheduled_transactions.cdc new file mode 100644 index 000000000..a0dd3e2fd --- /dev/null +++ b/transactions/transactionScheduler/admin/process_scheduled_transactions.cdc @@ -0,0 +1,13 @@ +import "FlowTransactionScheduler" + +// Process scheduled transactions by the FlowTransactionScheduler contract. +// This will be called by the FVM and all scheduled transactions that should be +// executed will be processed. An event for each will be emitted. +transaction { + prepare(serviceAccount: auth(BorrowValue) &Account) { + let scheduler = serviceAccount.storage.borrow(from: FlowTransactionScheduler.storagePath) + ?? panic("Could not borrow FlowTransactionScheduler") + + scheduler.process() + } +} \ No newline at end of file diff --git a/transactions/transactionScheduler/admin/set_config_details.cdc b/transactions/transactionScheduler/admin/set_config_details.cdc new file mode 100644 index 000000000..5c3ebcd74 --- /dev/null +++ b/transactions/transactionScheduler/admin/set_config_details.cdc @@ -0,0 +1,83 @@ +import "FlowTransactionScheduler" + +transaction( + maximumIndividualEffort: UInt64?, + minimumExecutionEffort: UInt64?, + slotSharedEffortLimit: UInt64?, + priorityEffortReserve: {UInt8: UInt64}?, + priorityEffortLimit: {UInt8: UInt64}?, + maxDataSizeMB: UFix64?, + priorityFeeMultipliers: {UInt8: UFix64}?, + refundMultiplier: UFix64?, + canceledTransactionsLimit: UInt?, + collectionEffortLimit: UInt64?, + collectionTransactionsLimit: Int?) { + prepare(account: auth(BorrowValue, SaveValue, IssueStorageCapabilityController, PublishCapability, GetStorageCapabilityController) &Account) { + // borrow an entitled reference to the SharedScheduler resource + let schedulerRef = account.storage.borrow(from: /storage/sharedScheduler) + ?? panic("Could not borrow reference to SharedScheduler resource") + + // get the current config + let currentConfig = FlowTransactionScheduler.getConfig() + + let highRawValue = FlowTransactionScheduler.Priority.High.rawValue + let mediumRawValue = FlowTransactionScheduler.Priority.Medium.rawValue + let lowRawValue = FlowTransactionScheduler.Priority.Low.rawValue + + var newReserves: {FlowTransactionScheduler.Priority: UInt64} = { + FlowTransactionScheduler.Priority.High: currentConfig.priorityEffortReserve[FlowTransactionScheduler.Priority.High]!, + FlowTransactionScheduler.Priority.Medium: currentConfig.priorityEffortReserve[FlowTransactionScheduler.Priority.Medium]!, + FlowTransactionScheduler.Priority.Low: currentConfig.priorityEffortReserve[FlowTransactionScheduler.Priority.Low]! + } + var newLimits: {FlowTransactionScheduler.Priority: UInt64} = { + FlowTransactionScheduler.Priority.High: currentConfig.priorityEffortLimit[FlowTransactionScheduler.Priority.High]!, + FlowTransactionScheduler.Priority.Medium: currentConfig.priorityEffortLimit[FlowTransactionScheduler.Priority.Medium]!, + FlowTransactionScheduler.Priority.Low: currentConfig.priorityEffortLimit[FlowTransactionScheduler.Priority.Low]! + } + var newMultipliers: {FlowTransactionScheduler.Priority: UFix64} = { + FlowTransactionScheduler.Priority.High: currentConfig.priorityFeeMultipliers[FlowTransactionScheduler.Priority.High]!, + FlowTransactionScheduler.Priority.Medium: currentConfig.priorityFeeMultipliers[FlowTransactionScheduler.Priority.Medium]!, + FlowTransactionScheduler.Priority.Low: currentConfig.priorityFeeMultipliers[FlowTransactionScheduler.Priority.Low]! + } + + if let reserves = priorityEffortReserve { + newReserves = { + FlowTransactionScheduler.Priority.High: reserves[highRawValue]!, + FlowTransactionScheduler.Priority.Medium: reserves[mediumRawValue]!, + FlowTransactionScheduler.Priority.Low: reserves[lowRawValue]! + } + } + if let limits = priorityEffortLimit { + newLimits = { + FlowTransactionScheduler.Priority.High: limits[highRawValue]!, + FlowTransactionScheduler.Priority.Medium: limits[mediumRawValue]!, + FlowTransactionScheduler.Priority.Low: limits[lowRawValue]! + } + } + if let multipliers = priorityFeeMultipliers { + newMultipliers = { + FlowTransactionScheduler.Priority.High: multipliers[highRawValue]!, + FlowTransactionScheduler.Priority.Medium: multipliers[mediumRawValue]!, + FlowTransactionScheduler.Priority.Low: multipliers[lowRawValue]! + } + } + + // create a new config, only updating the fields that are provided as non-nil arguments to this transaction + let newConfig: FlowTransactionScheduler.Config = FlowTransactionScheduler.Config( + maximumIndividualEffort: maximumIndividualEffort ?? currentConfig.maximumIndividualEffort, + minimumExecutionEffort: minimumExecutionEffort ?? currentConfig.minimumExecutionEffort, + slotSharedEffortLimit: slotSharedEffortLimit ?? currentConfig.slotSharedEffortLimit, + priorityEffortReserve: newReserves, + priorityEffortLimit: newLimits, + maxDataSizeMB: maxDataSizeMB ?? currentConfig.maxDataSizeMB, + priorityFeeMultipliers: newMultipliers, + refundMultiplier: refundMultiplier ?? currentConfig.refundMultiplier, + canceledTransactionsLimit: canceledTransactionsLimit ?? currentConfig.canceledTransactionsLimit, + collectionEffortLimit: collectionEffortLimit ?? currentConfig.collectionEffortLimit, + collectionTransactionsLimit: collectionTransactionsLimit ?? currentConfig.collectionTransactionsLimit + ) + + // set the new config + schedulerRef.setConfig(newConfig: newConfig) + } +} \ No newline at end of file diff --git a/transactions/transactionScheduler/cancel_transaction.cdc b/transactions/transactionScheduler/cancel_transaction.cdc new file mode 100644 index 000000000..c7449d1dd --- /dev/null +++ b/transactions/transactionScheduler/cancel_transaction.cdc @@ -0,0 +1,22 @@ +import "FlowTransactionScheduler" +import "TestFlowScheduledTransactionHandler" +import "FlowToken" +import "FungibleToken" + +// ⚠️ WARNING: UNSAFE FOR PRODUCTION ⚠️ +// This transaction uses a TEST CONTRACT and should NEVER be used in production! +// This transaction is designed solely for testing FlowTransactionScheduler functionality +// and contains unsafe implementations that could lead to loss of funds or security vulnerabilities. +// +// DO NOT USE THIS TRANSACTION IN PRODUCTION! +// +transaction(id: UInt64) { + + prepare(account: auth(BorrowValue, SaveValue, IssueStorageCapabilityController, PublishCapability, GetStorageCapabilityController) &Account) { + + let vault = account.storage.borrow(from: /storage/flowTokenVault) + ?? panic("Could not borrow FlowToken vault") + + vault.deposit(from: <-TestFlowScheduledTransactionHandler.cancelTransaction(id: id)) + } +} diff --git a/transactions/transactionScheduler/schedule_transaction.cdc b/transactions/transactionScheduler/schedule_transaction.cdc new file mode 100644 index 000000000..4556bf93b --- /dev/null +++ b/transactions/transactionScheduler/schedule_transaction.cdc @@ -0,0 +1,74 @@ +import "FlowTransactionScheduler" +import "TestFlowScheduledTransactionHandler" +import "FlowToken" +import "FungibleToken" + +// ⚠️ WARNING: UNSAFE FOR PRODUCTION ⚠️ +// This transaction uses a TEST CONTRACT and should NEVER be used in production! +// This transaction is designed solely for testing FlowTransactionScheduler functionality +// and contains unsafe implementations that could lead to loss of funds or security vulnerabilities. +// +// DO NOT USE THIS TRANSACTION IN PRODUCTION! +// +/// Schedules a transaction for the TestFlowScheduledTransactionHandler contract +/// +/// This is just an example transaction that uses an example contract +/// If you want to schedule your own transactions, you need to develop your own contract +/// that has a resource that implements the FlowTransactionScheduler.TransactionHandler interface +/// that contains your custom code that should be executed when the transaction is scheduled. +/// Your transaction will look similar to this one, but will use your custom contract and types +/// instead of TestFlowScheduledTransactionHandler + +transaction(timestamp: UFix64, feeAmount: UFix64, effort: UInt64, priority: UInt8, testData: AnyStruct?) { + + prepare(account: auth(BorrowValue, SaveValue, IssueStorageCapabilityController, PublishCapability, GetStorageCapabilityController) &Account) { + + // If a transaction handler has not been created for this account yet, create one, + // store it, and issue a capability that will be used to create the transaction + if !account.storage.check<@TestFlowScheduledTransactionHandler.Handler>(from: TestFlowScheduledTransactionHandler.HandlerStoragePath) { + let handler <- TestFlowScheduledTransactionHandler.createHandler() + + account.storage.save(<-handler, to: TestFlowScheduledTransactionHandler.HandlerStoragePath) + account.capabilities.storage.issue(TestFlowScheduledTransactionHandler.HandlerStoragePath) + } + + // Get the capability that will be used to create the transaction + let handlerCap = account.capabilities.storage + .getControllers(forPath: TestFlowScheduledTransactionHandler.HandlerStoragePath)[0] + .capability as! Capability + + // borrow a reference to the vault that will be used for fees + let vault = account.storage.borrow(from: /storage/flowTokenVault) + ?? panic("Could not borrow FlowToken vault") + + let fees <- vault.withdraw(amount: feeAmount) as! @FlowToken.Vault + let priorityEnum = FlowTransactionScheduler.Priority(rawValue: priority) + ?? FlowTransactionScheduler.Priority.High + + if let dataString = testData as? String { + if dataString == "schedule" { + // Schedule the transaction that schedules another transaction + let scheduledTransaction <- FlowTransactionScheduler.schedule( + handlerCap: handlerCap, + data: handlerCap, + timestamp: timestamp, + priority: priorityEnum, + executionEffort: effort, + fees: <-fees + ) + TestFlowScheduledTransactionHandler.addScheduledTransaction(scheduledTx: <-scheduledTransaction) + return + } + } + // Schedule the regular transaction with the main contract + let scheduledTransaction <- FlowTransactionScheduler.schedule( + handlerCap: handlerCap, + data: testData, + timestamp: timestamp, + priority: priorityEnum, + executionEffort: effort, + fees: <-fees + ) + TestFlowScheduledTransactionHandler.addScheduledTransaction(scheduledTx: <-scheduledTransaction) + } +} diff --git a/transactions/transactionScheduler/scripts/get_canceled_transactions.cdc b/transactions/transactionScheduler/scripts/get_canceled_transactions.cdc new file mode 100644 index 000000000..103ae848f --- /dev/null +++ b/transactions/transactionScheduler/scripts/get_canceled_transactions.cdc @@ -0,0 +1,5 @@ +import "FlowTransactionScheduler" + +access(all) fun main(): [UInt64] { + return FlowTransactionScheduler.getCanceledTransactions() +} diff --git a/transactions/transactionScheduler/scripts/get_config.cdc b/transactions/transactionScheduler/scripts/get_config.cdc new file mode 100644 index 000000000..12f298a7b --- /dev/null +++ b/transactions/transactionScheduler/scripts/get_config.cdc @@ -0,0 +1,5 @@ +import "FlowTransactionScheduler" + +access(all) fun main(): {FlowTransactionScheduler.SchedulerConfig} { + return FlowTransactionScheduler.getConfig() +} diff --git a/transactions/transactionScheduler/scripts/get_estimate.cdc b/transactions/transactionScheduler/scripts/get_estimate.cdc new file mode 100644 index 000000000..4eff48185 --- /dev/null +++ b/transactions/transactionScheduler/scripts/get_estimate.cdc @@ -0,0 +1,26 @@ +import "FlowTransactionScheduler" + +access(all) fun main( + data: AnyStruct?, + timestamp: UFix64, + priority: UInt8, + executionEffort: UInt64 +): FlowTransactionScheduler.EstimatedScheduledTransaction { + var priorityEnum: FlowTransactionScheduler.Priority = FlowTransactionScheduler.Priority.High + if priority == 0 { + priorityEnum = FlowTransactionScheduler.Priority.High + } else if priority == 1 { + priorityEnum = FlowTransactionScheduler.Priority.Medium + } else if priority == 2 { + priorityEnum = FlowTransactionScheduler.Priority.Low + } else { + panic("Invalid priority: \(priority). Must be 0 (High), 1 (Medium), or 2 (Low)") + } + + return FlowTransactionScheduler.estimate( + data: data, + timestamp: timestamp, + priority: priorityEnum, + executionEffort: executionEffort + ) +} diff --git a/transactions/transactionScheduler/scripts/get_slot_available_effort.cdc b/transactions/transactionScheduler/scripts/get_slot_available_effort.cdc new file mode 100644 index 000000000..4a26864bd --- /dev/null +++ b/transactions/transactionScheduler/scripts/get_slot_available_effort.cdc @@ -0,0 +1,6 @@ +import "FlowTransactionScheduler" + +access(all) fun main(timestamp: UFix64, priority: UInt8): UInt64 { + let priortyEnum = FlowTransactionScheduler.Priority(rawValue: priority)! + return FlowTransactionScheduler.getSlotAvailableEffort(timestamp: timestamp, priority: priortyEnum) +} diff --git a/transactions/transactionScheduler/scripts/get_status.cdc b/transactions/transactionScheduler/scripts/get_status.cdc new file mode 100644 index 000000000..5ceae9c27 --- /dev/null +++ b/transactions/transactionScheduler/scripts/get_status.cdc @@ -0,0 +1,8 @@ +import "FlowTransactionScheduler" + +access(all) fun main(id: UInt64): UInt8 { + let status = FlowTransactionScheduler.getStatus(id: id) + ?? panic("Invalid ID: \(id) transaction not found") + + return status.rawValue +} diff --git a/transactions/transactionScheduler/scripts/get_transaction_data.cdc b/transactions/transactionScheduler/scripts/get_transaction_data.cdc new file mode 100644 index 000000000..82afa68db --- /dev/null +++ b/transactions/transactionScheduler/scripts/get_transaction_data.cdc @@ -0,0 +1,5 @@ +import "FlowTransactionScheduler" + +access(all) fun main(id: UInt64): FlowTransactionScheduler.TransactionData? { + return FlowTransactionScheduler.getTransactionData(id: id) +} diff --git a/transactions/transactionScheduler/scripts/get_transactions_for_timeframe.cdc b/transactions/transactionScheduler/scripts/get_transactions_for_timeframe.cdc new file mode 100644 index 000000000..cd714800b --- /dev/null +++ b/transactions/transactionScheduler/scripts/get_transactions_for_timeframe.cdc @@ -0,0 +1,5 @@ +import "FlowTransactionScheduler" + +access(all) fun main(startTimestamp: UFix64, endTimestamp: UFix64): {UFix64: {UInt8: [UInt64]}} { + return FlowTransactionScheduler.getTransactionsForTimeframe(startTimestamp: startTimestamp, endTimestamp: endTimestamp) +}