Skip to content

Commit 2bde7bc

Browse files
More comments modified
1 parent 796fc4d commit 2bde7bc

2 files changed

Lines changed: 11 additions & 13 deletions

File tree

crates/contract/src/api/tee_verifier.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ use std::collections::{BTreeMap, BTreeSet};
1717
impl MpcContract {
1818
/// Vote for a candidate account to become the trusted verifier contract
1919
/// account, committing to the code hash the voter audited. When the proposal
20-
/// crosses the signing threshold, the trusted verifier account is updated
20+
/// crosses the governance threshold, the trusted verifier account is updated
2121
/// and all pending verifier-change votes are cleared.
2222
#[handle_result]
2323
pub fn vote_tee_verifier_change(
@@ -131,7 +131,7 @@ mod tests {
131131

132132
#[test]
133133
fn vote_tee_verifier_change__should_apply_candidate_when_threshold_reached() {
134-
// Given a running contract with 3 participants, signing threshold 2,
134+
// Given a running contract with 3 participants, governance threshold 2,
135135
// starting unconfigured.
136136
let (mut contract, participants, _) = setup_tee_test_contract(3, 2);
137137
assert_eq!(contract.tee_verifier_account_id, None);
@@ -193,7 +193,7 @@ mod tests {
193193

194194
#[test]
195195
fn remove_non_participant_tee_verifier_votes__should_drop_votes_from_dropped_participants() {
196-
// Given a running contract with 3 participants, signing threshold 3, where
196+
// Given a running contract with 3 participants, governance threshold 3, where
197197
// two participants have cast votes for distinct candidates (neither crosses
198198
// threshold, so both stay pending).
199199
let (mut contract, participants, _) = setup_tee_test_contract(3, 3);

crates/contract/src/tee/verifier_votes.rs

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,6 @@ mod tests {
120120
}
121121
}
122122

123-
/// 3 authenticated participants with the given governance threshold and
124-
/// fresh, empty pending votes.
125123
struct Voting {
126124
participants: Participants,
127125
params: GovernanceThresholdParameters,
@@ -183,7 +181,7 @@ mod tests {
183181

184182
#[test]
185183
fn vote__should_not_cross_below_threshold() {
186-
// Given 3 participants, threshold 2
184+
// Given 3 participants, governance threshold 2
187185
let mut voting = Voting::with_threshold(2);
188186
let proposal = proposal("v.near", 1);
189187

@@ -200,7 +198,7 @@ mod tests {
200198

201199
#[test]
202200
fn vote__should_cross_threshold_and_clear_pending() {
203-
// Given 3 participants, threshold 2
201+
// Given 3 participants, governance threshold 2
204202
let mut voting = Voting::with_threshold(2);
205203
let proposal = proposal("v.near", 1);
206204

@@ -215,7 +213,7 @@ mod tests {
215213

216214
#[test]
217215
fn vote__should_not_combine_same_account_different_hashes() {
218-
// Given 3 participants, threshold 2
216+
// Given 3 participants, governance threshold 2
219217
let mut voting = Voting::with_threshold(2);
220218
let candidate = "v.near";
221219
let proposal_hash_1 = proposal(candidate, 1);
@@ -239,7 +237,7 @@ mod tests {
239237

240238
#[test]
241239
fn revote__should_replace_previous_vote() {
242-
// Given 3 participants, threshold 2
240+
// Given 3 participants, governance threshold 2
243241
let mut voting = Voting::with_threshold(2);
244242
let first_proposal = proposal("a.near", 1);
245243
let second_proposal = proposal("b.near", 1);
@@ -260,7 +258,7 @@ mod tests {
260258

261259
#[test]
262260
fn withdraw__should_remove_caller_vote() {
263-
// Given 3 participants, threshold 2, and one recorded vote
261+
// Given 3 participants, governance threshold 2, and one recorded vote
264262
let mut voting = Voting::with_threshold(2);
265263
let proposal = proposal("v.near", 1);
266264
voting.must_cast(0, &proposal);
@@ -270,19 +268,19 @@ mod tests {
270268
);
271269

272270
// When the caller withdraws
273-
voting.votes.withdraw(&voting.voters[0]);
271+
voting.votes.withdraw(&voting.voter(0));
274272

275273
// Then their vote is removed
276274
assert_eq!(voting.votes.pending(), BTreeMap::new());
277275

278276
// When a voter who never voted withdraws, it is a no-op
279-
voting.votes.withdraw(&voting.voters[1]);
277+
voting.votes.withdraw(&voting.voter(1));
280278
assert_eq!(voting.votes.pending(), BTreeMap::new());
281279
}
282280

283281
#[test]
284282
fn retain__should_keep_current_participants_and_drop_the_rest() {
285-
// Given 3 participants, threshold 3, and two voters sharing one bucket
283+
// Given 3 participants, governance threshold 3, and two voters sharing one bucket
286284
let mut voting = Voting::with_threshold(3);
287285
let proposal = proposal("v.near", 1);
288286
voting.must_cast(0, &proposal);

0 commit comments

Comments
 (0)