Skip to content

Commit 5846354

Browse files
authored
Merge pull request #959 from input-output-hk/jpraynaud/958-upgrade-rust-1.70.0
Upgrade Rust `1.70.0`
2 parents 27d5783 + c8276dc commit 5846354

File tree

3 files changed

+25
-15
lines changed

3 files changed

+25
-15
lines changed

.github/workflows/ci.yml

+8-4
Original file line numberDiff line numberDiff line change
@@ -128,9 +128,11 @@ jobs:
128128
shell: bash
129129
run: |
130130
set -o pipefail && \
131-
cargo test --no-fail-fast ${{ matrix.test-args }} \
132-
-- -Z unstable-options --format json --report-time \
133-
| tee >(cargo2junit > test-results${{ matrix.artifact-suffix }}-${{ runner.os }}-${{ runner.arch }}.xml)
131+
cargo test --no-fail-fast ${{ matrix.test-args }}
132+
# TODO: Previous command that uses unstable options which are not supported anymore in stable toolchain
133+
#cargo test --no-fail-fast ${{ matrix.test-args }} \
134+
# -- -Z unstable-options --format json --report-time \
135+
# | tee >(cargo2junit > test-results${{ matrix.artifact-suffix }}-${{ runner.os }}-${{ runner.arch }}.xml)
134136
135137
- name: Upload Tests Results
136138
uses: actions/upload-artifact@v3
@@ -230,7 +232,9 @@ jobs:
230232
if-no-files-found: error
231233

232234
publish-tests-results:
233-
if: success() || failure()
235+
# TODO: reactivate when cargo test errors export to json works in stable version
236+
#if: success() || failure()
237+
if: false
234238
runs-on: ubuntu-22.04
235239
needs:
236240
- test

mithril-aggregator/src/database/provider/single_signature.rs

+16-11
Original file line numberDiff line numberDiff line change
@@ -311,15 +311,14 @@ mod tests {
311311
fn test_convert_single_signatures() {
312312
let single_signature = fake_data::single_signatures(vec![1, 3, 4, 6, 7, 9]);
313313
let open_message_id = Uuid::parse_str("193d1442-e89b-43cf-9519-04d8db9a12ff").unwrap();
314-
let single_signature_expected = single_signature.clone();
315314

316315
let single_signature_record = SingleSignatureRecord::from_single_signatures(
317316
&single_signature,
318317
&open_message_id,
319318
Epoch(1),
320319
);
321-
let single_signature = single_signature_record.into();
322-
assert_eq!(single_signature_expected, single_signature);
320+
let single_signature_returned = single_signature_record.into();
321+
assert_eq!(single_signature, single_signature_returned);
323322
}
324323

325324
#[test]
@@ -411,14 +410,14 @@ mod tests {
411410

412411
#[tokio::test]
413412
async fn test_get_single_signature_records() {
414-
let single_signature_records = setup_single_signature_records(2, 3, 4);
413+
let single_signature_records_src = setup_single_signature_records(2, 3, 4);
415414

416415
let connection = Connection::open(":memory:").unwrap();
417-
setup_single_signature_db(&connection, single_signature_records.clone()).unwrap();
416+
setup_single_signature_db(&connection, single_signature_records_src.clone()).unwrap();
418417

419418
let provider = SingleSignatureRecordProvider::new(&connection);
420419

421-
let open_message_id_test = single_signature_records[0].open_message_id.to_owned();
420+
let open_message_id_test = single_signature_records_src[0].open_message_id.to_owned();
422421
let single_signature_records: Vec<SingleSignatureRecord> = provider
423422
.get_by_open_message_id(&open_message_id_test)
424423
.unwrap()
@@ -467,11 +466,17 @@ mod tests {
467466
.collect();
468467
assert!(single_signature_records.is_empty());
469468

470-
let single_signature_records: Vec<SingleSignatureRecord> =
471-
provider.get_all().unwrap().collect();
472-
let expected_single_signature_records: Vec<SingleSignatureRecord> =
473-
single_signature_records.clone();
474-
assert_eq!(expected_single_signature_records, single_signature_records);
469+
let single_signature_records_returned: Vec<SingleSignatureRecord> = provider
470+
.get_all()
471+
.unwrap()
472+
.collect::<Vec<_>>()
473+
.into_iter()
474+
.rev()
475+
.collect();
476+
assert_eq!(
477+
single_signature_records_src,
478+
single_signature_records_returned
479+
);
475480
}
476481

477482
#[test]

mithril-stm/src/eligibility_check.rs

+1
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ pub(crate) fn ev_lt_phi(phi_f: f64, ev: [u8; 64], stake: Stake, total_stake: Sta
6161
/// Therefore, a good integral bound is the maximum value that `|ln(1.0 - phi_f)|` can take with
6262
/// `phi_f \in [0, 0.95]` (if we expect to have `phi_f > 0.95` this bound should be extended),
6363
/// which is `3`. Hence, we set `M = 3`.
64+
#[allow(clippy::redundant_clone)]
6465
fn taylor_comparison(bound: usize, cmp: Ratio<BigInt>, x: Ratio<BigInt>) -> bool {
6566
let mut new_x = x.clone();
6667
let mut phi: Ratio<BigInt> = One::one();

0 commit comments

Comments
 (0)