-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[diem-transactional-tests] migrate prologue/<sequenuce number tests>
- Loading branch information
1 parent
fa53725
commit 4dc515b
Showing
7 changed files
with
53 additions
and
28 deletions.
There are no files selected for viewing
1 change: 1 addition & 0 deletions
1
...move/diem-framework/core/transactional-tests/genesis/genesis_account_sequence_numbers.exp
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 @@ | ||
processed 1 task |
1 change: 1 addition & 0 deletions
1
...sis/genesis_account_sequence_numbers.move → ...sis/genesis_account_sequence_numbers.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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
//# run --admin-script --signers DiemRoot DiemRoot | ||
script { | ||
use DiemFramework::DiemAccount; | ||
|
||
|
7 changes: 7 additions & 0 deletions
7
diem-move/diem-framework/core/transactional-tests/prologue/sequence_number.exp
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 @@ | ||
processed 8 tasks | ||
|
||
task 5 'publish'. lines 32-34: | ||
Error: Transaction discarded. VMStatus: status SEQUENCE_NUMBER_TOO_OLD of type Validation | ||
|
||
task 6 'publish'. lines 37-39: | ||
Error: Transaction discarded. VMStatus: status SEQUENCE_NUMBER_TOO_NEW of type Validation |
44 changes: 44 additions & 0 deletions
44
diem-move/diem-framework/core/transactional-tests/prologue/sequence_number.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,44 @@ | ||
//# init --parent-vasps Alice | ||
|
||
// Check that the initial sequence number is 0. | ||
//# run --admin-script --signers DiemRoot DiemRoot | ||
script { | ||
use DiemFramework::DiemAccount; | ||
|
||
fun main() { | ||
assert!(DiemAccount::sequence_number(@Alice) == 0, 72); | ||
} | ||
} | ||
|
||
// Bump the sequence number twice. | ||
//# publish | ||
module Alice::M1 {} | ||
|
||
|
||
//# publish | ||
module Alice::M2 {} | ||
|
||
// Check that the initial sequence number is 2. | ||
//# run --admin-script --signers DiemRoot DiemRoot | ||
script { | ||
use DiemFramework::DiemAccount; | ||
|
||
fun main() { | ||
assert!(DiemAccount::sequence_number(@Alice) == 2, 72); | ||
} | ||
} | ||
|
||
|
||
//# publish --sequence-number 1 | ||
module Alice::M3 {} | ||
// Should fail since the sequence number is too old. | ||
|
||
|
||
//# publish --sequence-number 3 | ||
module Alice::M4 {} | ||
// Should fail since the sequence number is too new. | ||
|
||
|
||
//# publish --sequence-number 2 | ||
module Alice::M5 {} | ||
// Should succeed. |
12 changes: 0 additions & 12 deletions
12
...move-compiler/functional-tests/tests/diem/prologue/can_run_with_good_sequence_number.move
This file was deleted.
Oops, something went wrong.
8 changes: 0 additions & 8 deletions
8
...e-compiler/functional-tests/tests/diem/prologue/cant_run_with_future_sequence_number.move
This file was deleted.
Oops, something went wrong.
8 changes: 0 additions & 8 deletions
8
...ve-compiler/functional-tests/tests/diem/prologue/cant_run_with_stale_sequence_number.move
This file was deleted.
Oops, something went wrong.