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
errorMessage: "Amount is required for deposit for scheduled transaction with ID \(id)")
627
+
self.emitError(id: id, errorMessage: "Amount is required for deposit for scheduled transaction with ID \(id) and index \(index)")
623
628
return
624
629
}
625
630
letvault = self.flowTokenVaultCapability.borrow()
626
631
if vault ==nil {
627
-
emitCOAHandlerExecutionError(id: id, owner: self.owner?.address, coaAddress: coa!.address().toString(), errorMessage: "FlowToken vault capability is invalid or expired for scheduled transaction with ID \(id)")
632
+
self.emitError(id: id, errorMessage: "FlowToken vault capability is invalid or expired for scheduled transaction with ID \(id) and index \(index)")
628
633
return
629
634
}
635
+
if txParams.amount!> vault!.balance &&!txParams.revertOnFailure {
636
+
self.emitError(id: id, errorMessage: "Insufficient FLOW in FlowToken vault for deposit into COA for scheduled transaction with ID \(id) and index \(index)")
errorMessage: "FlowToken vault capability is invalid or expired for scheduled transaction with ID \(id)")
647
+
self.emitError(id: id, errorMessage: "FlowToken vault capability is invalid or expired for scheduled transaction with ID \(id) and index \(index)")
641
648
return
642
649
}
643
650
644
651
letamount = EVM.Balance(attoflow: 0)
645
652
amount.setFLOW(flow: txParams.amount!)
646
653
654
+
if amount.attoflow > coa!.balance().attoflow &&!txParams.revertOnFailure {
655
+
self.emitError(id: id, errorMessage: "Insufficient FLOW in COA vault for withdrawal from COA for scheduled transaction with ID \(id) and index \(index)")
errorMessage: "Call to EVM address, data, gas limit, and value are required for EVM call for scheduled transaction with ID \(id)")
662
+
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)")
self.emitError(id: id, errorMessage: "EVM call failed for scheduled transaction with ID \(id) and index \(index) with error: \(result.errorCode):\(result.errorMessage)")
670
+
continue
671
+
} else {
672
+
panic("EVM call failed for scheduled transaction with ID \(id) and index \(index) with error: \(result.errorCode):\(result.errorMessage)")
errorMessage: "Invalid scheduled transaction data type for COA handler execution for tx with ID \(id)! Expected FlowTransactionSchedulerUtils.COAHandlerParams but got \(data.getType().identifier)")
678
+
self.emitError(id: id, errorMessage: "Invalid scheduled transaction data type for COA handler execution for tx with ID \(id)! Expected [FlowTransactionSchedulerUtils.COAHandlerParams] but got \(data.getType().identifier)")
assert(amount !=nil, message: "Amount is required for withdrawal but was not provided")
739
758
}
740
759
ifself.txType == COAHandlerTxType.Call {
741
-
assert(callToEVMAddress !=nil&& callToEVMAddress!.length ==20, message: "Call to EVM address is required for EVM call but was not provided or is invalid")
760
+
assert(callToEVMAddress !=nil&& callToEVMAddress!.length ==40, message: "Call to EVM address is required for EVM call but was not provided or is invalid length (must be 40 hex chars)")
742
761
assert(data !=nil, message: "Data is required for EVM call but was not provided")
743
762
assert(gasLimit !=nil, message: "Gas limit is required for EVM call but was not provided")
744
763
assert(value !=nil, message: "Value is required for EVM call but was not provided")
0 commit comments