-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #92 from onflow/add-gas-setting-txn
Add FlowEVMBridgeConfig.setGasLimit() transaction & test coverage
- Loading branch information
Showing
5 changed files
with
66 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import "FlowEVMBridgeConfig" | ||
|
||
/// Returns the gas limit for the Flow-EVM bridge. | ||
/// | ||
/// @returns The current gas limit shared by all the bridge-related EVM operations. | ||
/// | ||
access(all) | ||
fun main(): UInt64 { | ||
return FlowEVMBridgeConfig.gasLimit | ||
} |
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
File renamed without changes.
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,23 @@ | ||
import "FlowEVMBridgeConfig" | ||
|
||
/// Sets the gas limit for all bridge-related operations in EVM. | ||
/// | ||
/// @param gasLimit: The new gas limit for all bridge-related operations in EVM. | ||
/// | ||
transaction(gasLimit: UInt64) { | ||
|
||
let admin: auth(FlowEVMBridgeConfig.Gas) &FlowEVMBridgeConfig.Admin | ||
|
||
prepare(signer: auth(BorrowValue) &Account) { | ||
self.admin = signer.storage.borrow<auth(FlowEVMBridgeConfig.Gas) &FlowEVMBridgeConfig.Admin>(from: FlowEVMBridgeConfig.adminStoragePath) | ||
?? panic("Could not borrow FlowEVMBridgeConfig Admin reference") | ||
} | ||
|
||
execute { | ||
self.admin.setGasLimit(gasLimit) | ||
} | ||
|
||
post { | ||
FlowEVMBridgeConfig.gasLimit == gasLimit: "Problem setting gasLimit to: ".concat(gasLimit.toString()) | ||
} | ||
} |