Skip to content

Commit 3bbec82

Browse files
sasuke0787Lucietta De StaccatoArchibald Fitz HindBea O'TempoGabi Beaver
authored andcommitted
[vouch score] refactor walk to find all simple paths (#406)
Co-authored-by: Lucietta De Staccato <[email protected]> Co-authored-by: Archibald Fitz Hind <[email protected]> Co-authored-by: Bea O'Tempo <bea_o'[email protected]> Co-authored-by: Gabi Beaver <[email protected]> Co-authored-by: Franci Tempo <[email protected]> Co-authored-by: Rosina Fitz Lento <[email protected]> Co-authored-by: Beauregard O'Sforzando <beauregard_o'[email protected]> Co-authored-by: Basil Saint Urchin <[email protected]> Co-authored-by: Vale De Bittern <[email protected]> Co-authored-by: Beauregard Legato <[email protected]> Co-authored-by: Chiaretta Saint Adagio <[email protected]> Co-authored-by: Sandra Stag <[email protected]> Co-authored-by: Vale McPiano <[email protected]> Co-authored-by: Sofi Forte <[email protected]> Co-authored-by: Archibald De Bittern <[email protected]> Co-authored-by: Paoletta De Lento <[email protected]> Co-authored-by: Mariella Legato <[email protected]> Co-authored-by: Rosina Von Stag <[email protected]> Co-authored-by: Rosina Fortissimo <[email protected]> Co-authored-by: Isa Saint Bittern <[email protected]> Co-authored-by: Isa McMezzo <[email protected]> Co-authored-by: Crispin Accelerando <[email protected]> Co-authored-by: Mariella De Tempo <[email protected]> Co-authored-by: Rupert Von Cony <[email protected]> Co-authored-by: Sofi Hart <[email protected]>
1 parent 6bfe959 commit 3bbec82

File tree

8 files changed

+687
-297
lines changed

8 files changed

+687
-297
lines changed

framework/libra-framework/sources/ol_sources/tests/boundary.test.move

Lines changed: 0 additions & 103 deletions
Original file line numberDiff line numberDiff line change
@@ -107,109 +107,6 @@ module ol_framework::test_boundary {
107107
assert!(transaction_fee::system_fees_collected() == 9018000, 7357006);
108108
}
109109

110-
// #[test(root = @ol_framework, alice = @0x1000a, marlon_rando = @0x12345)]
111-
// fun e2e_add_validator_happy(root: signer, alice: signer, marlon_rando: signer) {
112-
// let initial_vals = common_test_setup(&root);
113-
114-
// // generate credentials for validator registration
115-
// ol_account::transfer(&alice, @0x12345, 200000);
116-
// let (_sk, pk, pop) = stake::generate_identity();
117-
// let pk_bytes = bls12381::public_key_to_bytes(&pk);
118-
// let pop_bytes = bls12381::proof_of_possession_to_bytes(&pop);
119-
// validator_universe::register_validator(&marlon_rando, pk_bytes, pop_bytes, b"123", b"abc");
120-
121-
// // MARLON PAYS THE BID
122-
// let vals = validator_universe::get_eligible_validators();
123-
// assert!(vector::length(&vals) == 11, 7357001);
124-
125-
// mock::mock_bids(&vals);
126-
127-
// // MARLON HAS MANY FRIENDS
128-
// vouch::test_set_received_list(@0x12345, vals);
129-
130-
// let (errs, _pass) = proof_of_fee::audit_qualification(@0x12345);
131-
// assert!(vector::length(&errs) == 0, 7357002);
132-
133-
// // get initial vals balance
134-
// let balances = vector::map(initial_vals, |addr| {
135-
// let (_unlocked, total) = ol_account::balance(addr);
136-
// total
137-
// });
138-
139-
// mock::trigger_epoch(&root);
140-
141-
// assert!(epoch_boundary::get_reconfig_success(), 7357003);
142-
143-
// // musical chairs recommended 11 seats BUT...
144-
// assert!(epoch_boundary::get_max_seats_offered() == 11, 7357004);
145-
146-
// // there were only 11 bidders for the 11 offered, which is not competitive enough
147-
// assert!(epoch_boundary::get_qualified_bidders() == 11, 7357004);
148-
149-
// // NOTE: now MARLON is INCLUDED in this, and we filled all the seats on offer.
150-
// // all vals had winning bids, but it was less than the seats on offer
151-
// let win = epoch_boundary::get_auction_winners();
152-
// // print(&vector::length(&win));
153-
154-
155-
// assert!(vector::length(&win) == 10, 7357005);
156-
157-
// // // all of the auction winners became the validators ulitmately
158-
// // assert!(vector::length(&epoch_boundary::get_actual_vals()) == 11, 7357006);
159-
160-
// // // check initial vals rewards received and bid fees collected
161-
// // // previous balance = current - reward + fee
162-
// // let i = 0;
163-
// // while (i < vector::length(&initial_vals)) {
164-
// // let (_unlocked, current) = ol_account::balance(*vector::borrow(&initial_vals, i));
165-
// // let previous = *vector::borrow(&balances, i);
166-
// // assert!(current == (previous + 1_000_000 - 1_000), 7357007);
167-
// // i = i + 1;
168-
// // };
169-
170-
// // // check Marlon's balance: 200_000 - 1_000 = 199_000
171-
// // let (_unlocked, marlon_balance) = ol_account::balance(@0x12345);
172-
// // assert!(marlon_balance == 199_000, 7357008);
173-
174-
// // // check subsidy for new rewards and fees collected
175-
// // // fees collected = 11 * 1_000_000 + 11 * 1_000 = 11_011_000
176-
// // assert!(transaction_fee::system_fees_collected() == 11_011_000, 7357009);
177-
178-
// // // another epoch and everyone is compliant as well
179-
// // mock::mock_all_vals_good_performance(&root);
180-
// // mock::trigger_epoch(&root);
181-
182-
// // assert!(epoch_boundary::get_max_seats_offered() == 12, 7357010);
183-
// // assert!(vector::length(&epoch_boundary::get_actual_vals()) == 11, 7357011);
184-
185-
// // // check initial vals rewards received and bid fees collected
186-
// // // previous balance = current - 2*reward + 2*fee
187-
// // let i = 0;
188-
// // while (i < vector::length(&initial_vals)) {
189-
// // let (_unlocked, current) = ol_account::balance(*vector::borrow(&initial_vals, i));
190-
// // let previous = *vector::borrow(&balances, i);
191-
// // assert!(current == (previous + 2_000_000 - 2_000), 7357012);
192-
// // i = i + 1;
193-
// // };
194-
195-
// // // check Marlon's balance: 200_000 + 1_000_000 - 2_000 = 1_198_000
196-
// // let (_unlocked, marlon_balance) = ol_account::balance(@0x12345);
197-
// // assert!(marlon_balance == 1_198_000, 7357013);
198-
199-
// // // CHECK BURNT FEES
200-
201-
// // // prepare clean epoch
202-
// // mock::trigger_epoch(&root);
203-
204-
// // let (before, _) = burn::get_lifetime_tracker();
205-
206-
// // mock::trigger_epoch(&root);
207-
208-
// // // check that only the entry fee sum is being burnt
209-
// // let (after,_) = burn::get_lifetime_tracker();
210-
// // assert!(after - before == 11_000_000, 7357014); // scale 1_000
211-
// }
212-
213110

214111
#[test(root = @ol_framework, alice = @0x1000a, marlon_rando = @0x12345)]
215112
fun e2e_competitive_set(root: signer, alice: signer, marlon_rando: signer) {

framework/libra-framework/sources/ol_sources/tests/donor_voice.test.move

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ module ol_framework::test_donor_voice {
132132

133133
let (_unlocked_dv, dv_balance) = ol_account::balance(donor_voice_address);
134134
let (_, marlon_balance) = ol_account::balance(marlon_rando);
135+
// TODO: add assert here
135136
diem_std::debug::print(&dv_balance);
136137
diem_std::debug::print(&marlon_balance);
137138

0 commit comments

Comments
 (0)