Skip to content

Commit

Permalink
[diem-transactional-tests] migrate reconfiguration 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 c39a247 commit 9bcb46e
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 54 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
processed 6 tasks

task 1 'block'. lines 3-5:
Events:
ContractEvent { key: EventKey(11000000000000000000000000000000000000000a550c18), index: 0, type: Struct(StructTag { address: 00000000000000000000000000000001, module: Identifier("DiemBlock"), name: Identifier("NewBlockEvent"), type_params: [] }), event_data: "0000000000000000c5e34b925cf6875fec02d4b77adbd2d6000200000000000000" }

task 2 'run'. lines 6-16:
Error: Transaction discarded. VMStatus: status ABORTED of type Execution with sub status 2

task 4 'block'. lines 27-29:
Events:
ContractEvent { key: EventKey(11000000000000000000000000000000000000000a550c18), index: 1, type: Struct(StructTag { address: 00000000000000000000000000000001, module: Identifier("DiemBlock"), name: Identifier("NewBlockEvent"), type_params: [] }), event_data: "0000000000000000c5e34b925cf6875fec02d4b77adbd2d6000300000000000000" }
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
//# init --validators Vivian Valentina --parent-vasps Alice

//# block --proposer Vivian --time 2

// Reconfiguration can only be invoked by the diem root.
//# run --admin-script --signers DiemRoot Vivian
script {
use DiemFramework::DiemConfig;

fun main(_dr: signer, vv: signer) {
DiemConfig::reconfigure(&vv);
}
}


// Reconfiguration can only be invoked by the diem root.
//# run --admin-script --signers DiemRoot DiemRoot
script {
use DiemFramework::DiemConfig;

fun main(dr: signer, _dr2: signer) {
DiemConfig::reconfigure(&dr);
DiemConfig::reconfigure(&dr);
}
}

//# block --proposer Vivian --time 3

// Make sure two reconfigurations will only trigger one reconfiguration event.
//# run --admin-script --signers DiemRoot DiemRoot
script {
use DiemFramework::DiemConfig;

fun main(dr: signer, _dr2: signer) {
DiemConfig::reconfigure(&dr);
}
}

// TODO: missing events!!!

This file was deleted.

0 comments on commit 9bcb46e

Please sign in to comment.