Skip to content

Commit 89ae001

Browse files
committed
Shorten function names
Signed-off-by: Denis Varlakov <denis@dfns.co>
1 parent 429560d commit 89ae001

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

examples/random-generation-protocol/src/lib.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -189,8 +189,8 @@ mod tests {
189189
|i, party, rng| protocol_of_random_generation(party, i, n, rng),
190190
)
191191
.await
192-
.expect_success()
193-
.expect_same();
192+
.expect_ok()
193+
.expect_eq();
194194

195195
std::println!("Output randomness: {}", hex::encode(randomness));
196196
}
@@ -204,8 +204,8 @@ mod tests {
204204
})
205205
.run()
206206
.unwrap()
207-
.expect_success()
208-
.expect_same();
207+
.expect_ok()
208+
.expect_eq();
209209
}
210210

211211
// Emulate the protocol using the state machine interface

round-based/src/simulation/mod.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@
4343
//! )
4444
//! .await
4545
//! // unwrap `Result`s
46-
//! .expect_success()
46+
//! .expect_ok()
4747
//! // check that all parties produced the same response
48-
//! .expect_same();
48+
//! .expect_eq();
4949
//!
5050
//! println!("Output randomness: {}", hex::encode(output));
5151
//! # }
@@ -71,7 +71,7 @@ where
7171
/// Panics if at least one of the parties returned `Err(_)`. In this case,
7272
/// a verbose error message will shown specifying which of the parties returned
7373
/// an error.
74-
pub fn expect_success(self) -> SimResult<T> {
74+
pub fn expect_ok(self) -> SimResult<T> {
7575
let mut oks = alloc::vec::Vec::with_capacity(self.0.len());
7676
let mut errs = alloc::vec::Vec::with_capacity(self.0.len());
7777

@@ -113,7 +113,7 @@ where
113113
/// panics with a verbose error message.
114114
///
115115
/// Panics if simulation contained zero parties.
116-
pub fn expect_same(mut self) -> T {
116+
pub fn expect_eq(mut self) -> T {
117117
let Some(first) = self.0.first() else {
118118
panic!("simulation contained zero parties");
119119
};

round-based/src/simulation/sim_async.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -216,9 +216,9 @@ impl NextMessageId {
216216
/// )
217217
/// .await
218218
/// // unwrap `Result`s
219-
/// .expect_success()
219+
/// .expect_ok()
220220
/// // check that all parties produced the same response
221-
/// .expect_same();
221+
/// .expect_eq();
222222
///
223223
/// println!("Output randomness: {}", hex::encode(output));
224224
/// # }
@@ -275,9 +275,9 @@ where
275275
/// )
276276
/// .await
277277
/// // unwrap `Result`s
278-
/// .expect_success()
278+
/// .expect_ok()
279279
/// // check that all parties produced the same response
280-
/// .expect_same();
280+
/// .expect_eq();
281281
///
282282
/// println!("Output randomness: {}", hex::encode(output));
283283
/// # }

0 commit comments

Comments
 (0)