-
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 dual_attesation tests
- Loading branch information
1 parent
5b87a3f
commit bbe761a
Showing
3 changed files
with
218 additions
and
196 deletions.
There are no files selected for viewing
46 changes: 46 additions & 0 deletions
46
diem-move/diem-framework/core/transactional-tests/dual_attestation/tests.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,46 @@ | ||
processed 14 tasks | ||
|
||
task 2 'run'. lines 12-19: | ||
Error: Transaction discarded. VMStatus: status ABORTED of type Execution with sub status 258 | ||
|
||
task 4 'run'. lines 67-74: | ||
Error: Transaction discarded. VMStatus: status ABORTED of type Execution with sub status 5 | ||
|
||
task 5 'run'. lines 76-83: | ||
Events: | ||
{ | ||
key: 01000000000000000dceedf16faf883d6d0770241510ed43 | ||
seq_num: 0 | ||
type: 0x1::DualAttestation::BaseUrlRotationEvent | ||
data: "000000000000000000" | ||
} | ||
{ | ||
key: 01000000000000000000000000000000000000000a550c18 | ||
seq_num: 2 | ||
type: 0x1::DiemAccount::AdminTransactionEvent | ||
data: "0000000000000000" | ||
} | ||
|
||
task 6 'run'. lines 85-92: | ||
Error: Transaction discarded. VMStatus: status ABORTED of type Execution with sub status 5 | ||
|
||
task 7 'run'. lines 94-104: | ||
Error: Transaction discarded. VMStatus: status ABORTED of type Execution with sub status 519 | ||
|
||
task 8 'run'. lines 105-112: | ||
Error: Transaction discarded. VMStatus: status ABORTED of type Execution with sub status 1 | ||
|
||
task 9 'run'. lines 114-136: | ||
Error: Transaction discarded. VMStatus: status ABORTED of type Execution with sub status 1 | ||
|
||
task 10 'run'. lines 138-145: | ||
Error: Transaction discarded. VMStatus: status ABORTED of type Execution with sub status 5 | ||
|
||
task 11 'run'. lines 147-154: | ||
Error: Transaction discarded. VMStatus: status ABORTED of type Execution with sub status 5 | ||
|
||
task 12 'run'. lines 156-163: | ||
Error: Transaction discarded. VMStatus: status ABORTED of type Execution with sub status 5 | ||
|
||
task 13 'run'. lines 165-172: | ||
Error: Transaction discarded. VMStatus: status ABORTED of type Execution with sub status 5 |
172 changes: 172 additions & 0 deletions
172
diem-move/diem-framework/core/transactional-tests/dual_attestation/tests.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,172 @@ | ||
//# init --parent-vasps Alice Bob --validators FreddyMac | ||
|
||
//# run --admin-script --signers DiemRoot FreddyMac | ||
script{ | ||
use DiemFramework::DualAttestation; | ||
|
||
fun main() { | ||
DualAttestation::get_cur_microdiem_limit(); | ||
} | ||
} | ||
|
||
//# run --admin-script --signers DiemRoot Alice | ||
script{ | ||
use DiemFramework::DualAttestation; | ||
|
||
fun main(_dr: signer, not_blessed: signer) { | ||
DualAttestation::set_microdiem_limit(¬_blessed, 99); | ||
} | ||
} | ||
|
||
//# run --admin-script --signers DiemRoot TreasuryCompliance | ||
script{ | ||
use DiemFramework::DualAttestation; | ||
|
||
fun main(_dr: signer, blessed: signer) { | ||
DualAttestation::set_microdiem_limit(&blessed, 1001); | ||
} | ||
} | ||
|
||
// TODO: DualAttestation::publish_credential is now a friend function | ||
// Make this into a unit test. | ||
// //! new-transaction | ||
// //! sender: blessed | ||
// script{ | ||
// use DiemFramework::DualAttestation; | ||
// fun main(account: signer) { | ||
// let account = &account; | ||
// DualAttestation::publish_credential(account, account, x""); | ||
// } | ||
// } | ||
// // check: "Keep(ABORTED { code: 1283," | ||
|
||
// TODO: Make into unit test | ||
// //! new-transaction | ||
// //! sender: blessed | ||
// script{ | ||
// use DiemFramework::DualAttestation; | ||
// fun main(account: signer) { | ||
// let account = &account; | ||
// DualAttestation::publish_credential(account, account, x""); | ||
// } | ||
// } | ||
// // check: "Keep(ABORTED { code: 1283," | ||
|
||
// TODO: Make into unit test | ||
// //! new-transaction | ||
// //! sender: bob | ||
// script{ | ||
// use DiemFramework::DualAttestation; | ||
// fun main(account: signer) { | ||
// let account = &account; | ||
// DualAttestation::publish_credential(account, account, x""); | ||
// } | ||
// } | ||
// // check: "Keep(ABORTED { code: 258," | ||
|
||
//# run --admin-script --signers DiemRoot TreasuryCompliance | ||
script{ | ||
use DiemFramework::DualAttestation; | ||
|
||
fun main(_dr: signer, account: signer) { | ||
DualAttestation::rotate_base_url(&account, x""); | ||
} | ||
} | ||
|
||
//# run --admin-script --signers DiemRoot Bob --show-events | ||
script{ | ||
use DiemFramework::DualAttestation; | ||
|
||
fun main(_dr: signer, account: signer) { | ||
DualAttestation::rotate_base_url(&account, x""); | ||
} | ||
} | ||
|
||
//# run --admin-script --signers DiemRoot TreasuryCompliance | ||
script{ | ||
use DiemFramework::DualAttestation; | ||
|
||
fun main(_dr: signer, account: signer) { | ||
DualAttestation::rotate_compliance_public_key(&account, x""); | ||
} | ||
} | ||
|
||
//# run --admin-script --signers DiemRoot Bob | ||
script{ | ||
use DiemFramework::DualAttestation; | ||
|
||
fun main(_dr: signer, account: signer) { | ||
DualAttestation::rotate_compliance_public_key(&account, x""); | ||
} | ||
} | ||
|
||
// TODO: why are the two following transactions identical? | ||
// | ||
//# run --admin-script --signers DiemRoot Bob | ||
script{ | ||
use DiemFramework::DualAttestation; | ||
|
||
fun main(_dr: signer, account: signer) { | ||
DualAttestation::initialize(&account); | ||
} | ||
} | ||
|
||
//# run --admin-script --signers DiemRoot Bob | ||
script{ | ||
use DiemFramework::DualAttestation; | ||
|
||
fun main(_dr: signer, account: signer) { | ||
DualAttestation::initialize(&account); | ||
} | ||
} | ||
|
||
// TODO: Make into unit test | ||
// //! new-transaction | ||
// //! sender: diemroot | ||
// //! execute-as: freddymac | ||
// script{ | ||
// use DiemFramework::DualAttestation; | ||
// fun main(dr_account: signer, freddy: signer) { | ||
// let dr_account = &dr_account; | ||
// let freddy = &freddy; | ||
// DualAttestation::publish_credential(freddy, dr_account, b"freddy"); | ||
// DualAttestation::publish_credential(freddy, dr_account, b"freddy"); | ||
// } | ||
// } | ||
// // check: "Discard(INVALID_WRITE_SET)" | ||
|
||
//# run --admin-script --signers DiemRoot DiemRoot | ||
script{ | ||
use DiemFramework::DualAttestation; | ||
|
||
fun main() { | ||
DualAttestation::human_name(@FreddyMac); | ||
} | ||
} | ||
|
||
//# run --admin-script --signers DiemRoot DiemRoot | ||
script{ | ||
use DiemFramework::DualAttestation; | ||
|
||
fun main() { | ||
DualAttestation::base_url(@FreddyMac); | ||
} | ||
} | ||
|
||
//# run --admin-script --signers DiemRoot DiemRoot | ||
script{ | ||
use DiemFramework::DualAttestation; | ||
|
||
fun main() { | ||
DualAttestation::compliance_public_key(@FreddyMac); | ||
} | ||
} | ||
|
||
//# run --admin-script --signers DiemRoot DiemRoot | ||
script{ | ||
use DiemFramework::DualAttestation; | ||
|
||
fun main() { | ||
DualAttestation::expiration_date(@FreddyMac); | ||
} | ||
} |
Oops, something went wrong.