-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a new script that checks if payer has balance to pay for tx (#435)
* Add a new script that checks if payer has balance to pay for tx * Rewrite check_if_payer_has_sufficient_balance to return struct * Update contract to cadence 1 * create custom minted account * payer executes tx and pays for it * fix tx signers * refactor test
- Loading branch information
1 parent
8f67f15
commit 83cacb3
Showing
5 changed files
with
139 additions
and
2 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
transactions/FlowServiceAccount/scripts/verify_payer_balance_for_tx_execution.cdc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import FlowFees from "FlowFees" | ||
|
||
access(all) fun main(payerAcct: Address, inclusionEffort: UFix64, maxExecutionEffort: UFix64): FlowFees.VerifyPayerBalanceResult { | ||
let authAcct = getAuthAccount<auth(BorrowValue) &Account>(payerAcct) | ||
return FlowFees.verifyPayersBalanceForTransactionExecution(authAcct, inclusionEffort: inclusionEffort, | ||
maxExecutionEffort: maxExecutionEffort) | ||
} |