-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Check the Gas Free function during the compilation of the Move module. (
#886) * Check the Gas Free function during the compilation of the Move module. * Check the gas_free function during module publishing. * fix the ordering of verifier function * execute the gas_validate and gas_charge_post function when use tx has been executed * Add gas_free function to deduct module account fees and update test code. * Fix error handling and code reuse. * Report an error indicating that the definition of the gas_free function is incomplete. * Fix the checking logic. * Resolve the issue with executing the gas_free callback function. --------- Co-authored-by: stevenlaw123 <[email protected]>
- Loading branch information
1 parent
5418339
commit aa7658a
Showing
9 changed files
with
955 additions
and
12 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,14 @@ | ||
[package] | ||
name = "gas_payer" | ||
version = "0.0.1" | ||
|
||
[dependencies] | ||
MoveosStdlib = { local = "../../moveos/moveos-stdlib/moveos-stdlib" } | ||
|
||
[addresses] | ||
rooch_examples = "_" | ||
moveos_std = "0x2" | ||
rooch_framework = "0x3" | ||
|
||
[dev-addresses] | ||
rooch_examples = "0x42" |
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,15 @@ | ||
module rooch_examples::gas_payer { | ||
use moveos_std::context::Context; | ||
|
||
fun gas_validate_function(_ctx: &Context): bool{ | ||
true | ||
} | ||
|
||
fun gas_charge_post_function(_ctx: &mut Context, _gas_used: u128): bool { | ||
true | ||
} | ||
|
||
#[gas_free(gas_validate=gas_validate_function, gas_charge_post=gas_charge_post_function)] | ||
public entry fun play(_ctx: &mut Context, _sender: &signer){ | ||
} | ||
} |
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
Oops, something went wrong.