Skip to content

Upgrade Rust 1.70.0 #959

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,11 @@ jobs:
shell: bash
run: |
set -o pipefail && \
cargo test --no-fail-fast ${{ matrix.test-args }} \
-- -Z unstable-options --format json --report-time \
| tee >(cargo2junit > test-results${{ matrix.artifact-suffix }}-${{ runner.os }}-${{ runner.arch }}.xml)
cargo test --no-fail-fast ${{ matrix.test-args }}
# TODO: Previous command that uses unstable options which are not supported anymore in stable toolchain
#cargo test --no-fail-fast ${{ matrix.test-args }} \
# -- -Z unstable-options --format json --report-time \
# | tee >(cargo2junit > test-results${{ matrix.artifact-suffix }}-${{ runner.os }}-${{ runner.arch }}.xml)

- name: Upload Tests Results
uses: actions/upload-artifact@v3
Expand Down Expand Up @@ -230,7 +232,9 @@ jobs:
if-no-files-found: error

publish-tests-results:
if: success() || failure()
# TODO: reactivate when cargo test errors export to json works in stable version
#if: success() || failure()
if: false
runs-on: ubuntu-22.04
needs:
- test
Expand Down
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion mithril-aggregator/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "mithril-aggregator"
version = "0.3.24"
version = "0.3.25"
description = "A Mithril Aggregator server"
authors = { workspace = true }
edition = { workspace = true }
Expand Down
27 changes: 16 additions & 11 deletions mithril-aggregator/src/database/provider/single_signature.rs
Original file line number Diff line number Diff line change
Expand Up @@ -311,15 +311,14 @@ mod tests {
fn test_convert_single_signatures() {
let single_signature = fake_data::single_signatures(vec![1, 3, 4, 6, 7, 9]);
let open_message_id = Uuid::parse_str("193d1442-e89b-43cf-9519-04d8db9a12ff").unwrap();
let single_signature_expected = single_signature.clone();

let single_signature_record = SingleSignatureRecord::from_single_signatures(
&single_signature,
&open_message_id,
Epoch(1),
);
let single_signature = single_signature_record.into();
assert_eq!(single_signature_expected, single_signature);
let single_signature_returned = single_signature_record.into();
assert_eq!(single_signature, single_signature_returned);
}

#[test]
Expand Down Expand Up @@ -411,14 +410,14 @@ mod tests {

#[tokio::test]
async fn test_get_single_signature_records() {
let single_signature_records = setup_single_signature_records(2, 3, 4);
let single_signature_records_src = setup_single_signature_records(2, 3, 4);

let connection = Connection::open(":memory:").unwrap();
setup_single_signature_db(&connection, single_signature_records.clone()).unwrap();
setup_single_signature_db(&connection, single_signature_records_src.clone()).unwrap();

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

let open_message_id_test = single_signature_records[0].open_message_id.to_owned();
let open_message_id_test = single_signature_records_src[0].open_message_id.to_owned();
let single_signature_records: Vec<SingleSignatureRecord> = provider
.get_by_open_message_id(&open_message_id_test)
.unwrap()
Expand Down Expand Up @@ -467,11 +466,17 @@ mod tests {
.collect();
assert!(single_signature_records.is_empty());

let single_signature_records: Vec<SingleSignatureRecord> =
provider.get_all().unwrap().collect();
let expected_single_signature_records: Vec<SingleSignatureRecord> =
single_signature_records.clone();
assert_eq!(expected_single_signature_records, single_signature_records);
let single_signature_records_returned: Vec<SingleSignatureRecord> = provider
.get_all()
.unwrap()
.collect::<Vec<_>>()
.into_iter()
.rev()
.collect();
assert_eq!(
single_signature_records_src,
single_signature_records_returned
);
}

#[test]
Expand Down
2 changes: 1 addition & 1 deletion mithril-stm/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "mithril-stm"
version = "0.2.13"
version = "0.2.14"
edition = { workspace = true }
authors = { workspace = true }
documentation = { workspace = true }
Expand Down
1 change: 1 addition & 0 deletions mithril-stm/src/eligibility_check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ pub(crate) fn ev_lt_phi(phi_f: f64, ev: [u8; 64], stake: Stake, total_stake: Sta
/// Therefore, a good integral bound is the maximum value that `|ln(1.0 - phi_f)|` can take with
/// `phi_f \in [0, 0.95]` (if we expect to have `phi_f > 0.95` this bound should be extended),
/// which is `3`. Hence, we set `M = 3`.
#[allow(clippy::redundant_clone)]
fn taylor_comparison(bound: usize, cmp: Ratio<BigInt>, x: Ratio<BigInt>) -> bool {
let mut new_x = x.clone();
let mut phi: Ratio<BigInt> = One::one();
Expand Down