-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[VM] Update execution logic to invalidate loader cache upon all parti…
…al errors when there's a code publish
- Loading branch information
1 parent
6aae9a3
commit a78970a
Showing
6 changed files
with
163 additions
and
15 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
7 changes: 7 additions & 0 deletions
7
aptos-move/e2e-move-tests/src/tests/code_publishing.data/pack_init_module_failed/Move.toml
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 @@ | ||
[package] | ||
name = "test_package" | ||
version = "0.0.0" | ||
upgrade_policy = "immutable" | ||
|
||
[dependencies] | ||
AptosFramework = { local = "../../../../../framework/aptos-framework" } |
26 changes: 26 additions & 0 deletions
26
...e/e2e-move-tests/src/tests/code_publishing.data/pack_init_module_failed/sources/test.move
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,26 @@ | ||
module 0xcafe::test { | ||
use aptos_framework::coin::{Self, Coin}; | ||
use aptos_framework::aptos_coin::AptosCoin; | ||
use std::signer::address_of; | ||
|
||
struct State has key { | ||
important_value: u64, | ||
coins: Coin<AptosCoin>, | ||
} | ||
|
||
fun init_module(s: &signer) { | ||
// Transfer away all the APT from s so there's nothing left to pay for gas. | ||
// This makes this init_module function fail for sure. | ||
let balance = coin::balance<AptosCoin>(address_of(s)); | ||
let coins = coin::withdraw<AptosCoin>(s, balance); | ||
|
||
move_to(s, State { | ||
important_value: get_value(), | ||
coins, | ||
}) | ||
} | ||
|
||
fun get_value(): u64 { | ||
1 | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
...e/e2e-move-tests/src/tests/code_publishing.data/pack_init_module_second_attempt/Move.toml
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 @@ | ||
[package] | ||
name = "test_package" | ||
version = "0.0.0" | ||
upgrade_policy = "immutable" | ||
|
||
[dependencies] | ||
AptosFramework = { local = "../../../../../framework/aptos-framework" } |
20 changes: 20 additions & 0 deletions
20
...ve-tests/src/tests/code_publishing.data/pack_init_module_second_attempt/sources/test.move
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,20 @@ | ||
module 0xcafe::test { | ||
use aptos_framework::coin::{Self, Coin}; | ||
use aptos_framework::aptos_coin::AptosCoin; | ||
|
||
struct State has key { | ||
important_value: u64, | ||
coins: Coin<AptosCoin>, | ||
} | ||
|
||
fun init_module(s: &signer) { | ||
move_to(s, State { | ||
important_value: get_value(), | ||
coins: coin::zero<AptosCoin>(), | ||
}) | ||
} | ||
|
||
fun get_value(): u64 { | ||
2 | ||
} | ||
} |
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