You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Iterate through all the COA transactions and execute them all
634
+
// If revertOnFailure is true for a transaction and any part of it fails, the entire scheduled transaction will be reverted
635
+
// If not but a part of the transaction fails, an error event will be emitted but the scheduled transaction will continue to execute the next transaction
636
+
//
637
+
iflettransactions = params {
623
638
forindex, txParamsintransactions {
624
639
switchtxParams.txType {
625
640
caseCOAHandlerTxType.DepositFLOW:
626
-
iftxParams.amount==nil {
627
-
self.emitError(id: id, errorMessage: "Amount is required for deposit for scheduled transaction with ID \(id) and index \(index)")
628
-
return
629
-
}
630
641
letvault = self.flowTokenVaultCapability.borrow()
631
642
ifvault==nil {
632
-
self.emitError(id: id, errorMessage: "FlowToken vault capability is invalid or expired for scheduled transaction with ID \(id) and index \(index)")
633
-
return
643
+
if!txParams.revertOnFailure {
644
+
self.emitError(id: id, errorMessage: "FlowToken vault capability is invalid or expired for scheduled transaction with ID \(id) and index \(index)")
645
+
continue
646
+
} else {
647
+
panic("FlowToken vault capability is invalid or expired for scheduled transaction with ID \(id) and index \(index)")
self.emitError(id: id, errorMessage: "Insufficient FLOW in FlowToken vault for deposit into COA for scheduled transaction with ID \(id) and index \(index)")
637
653
continue
638
654
}
655
+
656
+
// Deposit the FLOW into the COA vault. If there isn't enough FLOW in the vault,
657
+
//the transaction will be reverted because we know revertOnFailure is true
self.emitError(id: id, errorMessage: "Call to EVM address, data, gas limit, and value are required for EVM call for scheduled transaction with ID \(id) and index \(index)")
0 commit comments