Skip to content

Commit

Permalink
[diem-transactional-tests] migrate prologue/<sequenuce number tests>
Browse files Browse the repository at this point in the history
  • Loading branch information
vgao1996 authored and bors-libra committed Dec 17, 2021
1 parent fa53725 commit 4dc515b
Show file tree
Hide file tree
Showing 7 changed files with 53 additions and 28 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
processed 1 task
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//# run --admin-script --signers DiemRoot DiemRoot
script {
use DiemFramework::DiemAccount;

Expand Down
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
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.

This file was deleted.

This file was deleted.

This file was deleted.

0 comments on commit 4dc515b

Please sign in to comment.