Skip to content

Commit

Permalink
Merge 40adb66 into b13dab8
Browse files Browse the repository at this point in the history
  • Loading branch information
jacderida committed May 1, 2022
2 parents b13dab8 + 40adb66 commit 661874b
Show file tree
Hide file tree
Showing 14 changed files with 75 additions and 106 deletions.
29 changes: 6 additions & 23 deletions .github/workflows/pr.yml
@@ -1,19 +1,12 @@
# PR workflow.
#
# Runs full suite of checks, with warnings treated as errors.
# Gather code coverage stats and publish them on coveralls.io.

name: PR

on:
pull_request:
branches: [ master ]

env:
# Run all cargo commands with --verbose.
CARGO_TERM_VERBOSE: true
RUST_BACKTRACE: 1
# Deny all compiler warnings.
RUSTFLAGS: "-D warnings"

jobs:
Expand All @@ -23,15 +16,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
# Install Rust and required components
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: rustfmt, clippy

# Cache.
- name: Cargo cache registry, index and build
uses: actions/cache@v2.1.4
with:
Expand All @@ -41,14 +32,17 @@ jobs:
target
key: ${{ runner.os }}-cargo-cache-${{ hashFiles('**/Cargo.lock') }}

# Check if the code is formatted correctly.
- name: Check formatting
run: cargo fmt --all -- --check

# Run Clippy.
- shell: bash
run: ./scripts/clippy

- uses: maidsafe/verify-licensing-info@main
name: verify licensing
with:
company-name: MaidSafe

check_pr_size:
if: "!startsWith(github.event.pull_request.title, 'Automated version bump')"
name: Check PR size doesn't break set limit
Expand All @@ -60,21 +54,19 @@ jobs:
- uses: maidsafe/pr_size_checker@v2
with:
max_lines_changed: 200

coverage:
if: "!startsWith(github.event.pull_request.title, 'Automated version bump')"
name: Code coverage check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
# Install Rust
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true

# Cache.
- name: Cargo cache registry, index and build
uses: actions/cache@v2.1.4
with:
Expand All @@ -84,7 +76,6 @@ jobs:
target
key: ${{ runner.os }}-cargo-cache-${{ hashFiles('**/Cargo.lock') }}

# Run cargo tarpaulin & push result to coveralls.io
- name: rust-tarpaulin code coverage check
uses: actions-rs/tarpaulin@v0.1
with:
Expand All @@ -107,7 +98,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
# Install Rust and required components
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly
Expand All @@ -125,7 +115,6 @@ jobs:
steps:
- uses: actions/checkout@v2

# wget the shared deny.toml file from the QA repo
- shell: bash
run: wget https://raw.githubusercontent.com/maidsafe/QA/master/misc-scripts/deny.toml

Expand All @@ -140,14 +129,12 @@ jobs:
os: [ubuntu-latest, windows-latest, macOS-latest]
steps:
- uses: actions/checkout@v2
# Install Rust
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true

# Cache.
- name: Cargo cache registry, index and build
uses: actions/cache@v2.1.4
with:
Expand All @@ -157,24 +144,20 @@ jobs:
target
key: ${{ runner.os }}-cargo-cache-${{ hashFiles('**/Cargo.lock') }}

# Run tests.
- shell: bash
run: ./scripts/tests

# Test publish using --dry-run.
test-publish:
if: "!startsWith(github.event.pull_request.title, 'Automated version bump')"
name: Test Publish
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
# Install Rust
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true

# Cargo publish dry run
- name: Cargo Publish Dry Run
run: cargo publish --dry-run
29 changes: 29 additions & 0 deletions LICENSE
@@ -0,0 +1,29 @@
BSD 3-Clause License

Copyright (c) 2022, MaidSafe.
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
11 changes: 0 additions & 11 deletions LICENSE-BSD

This file was deleted.

7 changes: 0 additions & 7 deletions LICENSE-MIT

This file was deleted.

4 changes: 3 additions & 1 deletion README.md
Expand Up @@ -13,7 +13,9 @@ This algorithm is synchronous and will require participants are disqualified for

## License

This Safe Network library is dual-licensed under the Modified BSD ([LICENSE-BSD](LICENSE-BSD) https://opensource.org/licenses/BSD-3-Clause) or the MIT license ([LICENSE-MIT](LICENSE-MIT) http://opensource.org/licenses/MIT) at your option.
This Safe Network library is licensed under the BSD-3-Clause license.

See the [LICENSE](LICENSE) file for more details.

## Contributing

Expand Down
11 changes: 4 additions & 7 deletions src/dev_utils/mod.rs
@@ -1,11 +1,8 @@
// Copyright 2020 MaidSafe.net limited.
// Copyright (c) 2022, MaidSafe.
// All rights reserved.
//
// This SAFE Network Software is licensed to you under the MIT license <LICENSE-MIT
// https://opensource.org/licenses/MIT> or the Modified BSD license <LICENSE-BSD
// https://opensource.org/licenses/BSD-3-Clause>, at your option. This file may not be copied,
// modified, or distributed except according to those terms. Please review the Licences for the
// specific language governing permissions and limitations relating to use of the SAFE Network
// Software.
// This SAFE Network Software is licensed under the BSD-3-Clause license.
// Please see the LICENSE file for more details.

mod peer;

Expand Down
11 changes: 4 additions & 7 deletions src/dev_utils/peer.rs
@@ -1,11 +1,8 @@
// Copyright 2020 MaidSafe.net limited.
// Copyright (c) 2022, MaidSafe.
// All rights reserved.
//
// This SAFE Network Software is licensed to you under the MIT license <LICENSE-MIT
// https://opensource.org/licenses/MIT> or the Modified BSD license <LICENSE-BSD
// https://opensource.org/licenses/BSD-3-Clause>, at your option. This file may not be copied,
// modified, or distributed except according to those terms. Please review the Licences for the
// specific language governing permissions and limitations relating to use of the SAFE Network
// Software.
// This SAFE Network Software is licensed under the BSD-3-Clause license.
// Please see the LICENSE file for more details.

use rand::Rng;
use serde_derive::{Deserialize, Serialize};
Expand Down
11 changes: 4 additions & 7 deletions src/key_gen/encryptor.rs
@@ -1,11 +1,8 @@
// Copyright 2020 MaidSafe.net limited.
// Copyright (c) 2022, MaidSafe.
// All rights reserved.
//
// This SAFE Network Software is licensed to you under the MIT license <LICENSE-MIT
// https://opensource.org/licenses/MIT> or the Modified BSD license <LICENSE-BSD
// https://opensource.org/licenses/BSD-3-Clause>, at your option. This file may not be copied,
// modified, or distributed except according to those terms. Please review the Licences for the
// specific language governing permissions and limitations relating to use of the SAFE Network
// Software.
// This SAFE Network Software is licensed under the BSD-3-Clause license.
// Please see the LICENSE file for more details.

use super::Error;
use aes::Aes128;
Expand Down
11 changes: 4 additions & 7 deletions src/key_gen/message.rs
@@ -1,11 +1,8 @@
// Copyright 2020 MaidSafe.net limited.
// Copyright (c) 2022, MaidSafe.
// All rights reserved.
//
// This SAFE Network Software is licensed to you under the MIT license <LICENSE-MIT
// https://opensource.org/licenses/MIT> or the Modified BSD license <LICENSE-BSD
// https://opensource.org/licenses/BSD-3-Clause>, at your option. This file may not be copied,
// modified, or distributed except according to those terms. Please review the Licences for the
// specific language governing permissions and limitations relating to use of the SAFE Network
// Software.
// This SAFE Network Software is licensed under the BSD-3-Clause license.
// Please see the LICENSE file for more details.

use super::encryptor::{Iv, Key};
use super::{Acknowledgment, Part};
Expand Down
11 changes: 4 additions & 7 deletions src/key_gen/mod.rs
@@ -1,11 +1,8 @@
// Copyright 2020 MaidSafe.net limited.
// Copyright (c) 2022, MaidSafe.
// All rights reserved.
//
// This SAFE Network Software is licensed to you under the MIT license <LICENSE-MIT
// https://opensource.org/licenses/MIT> or the Modified BSD license <LICENSE-BSD
// https://opensource.org/licenses/BSD-3-Clause>, at your option. This file may not be copied,
// modified, or distributed except according to those terms. Please review the Licences for the
// specific language governing permissions and limitations relating to use of the SAFE Network
// Software.
// This SAFE Network Software is licensed under the BSD-3-Clause license.
// Please see the LICENSE file for more details.

mod encryptor;
pub mod message;
Expand Down
11 changes: 4 additions & 7 deletions src/key_gen/outcome.rs
@@ -1,11 +1,8 @@
// Copyright 2020 MaidSafe.net limited.
// Copyright (c) 2022, MaidSafe.
// All rights reserved.
//
// This SAFE Network Software is licensed to you under the MIT license <LICENSE-MIT
// https://opensource.org/licenses/MIT> or the Modified BSD license <LICENSE-BSD
// https://opensource.org/licenses/BSD-3-Clause>, at your option. This file may not be copied,
// modified, or distributed except according to those terms. Please review the Licences for the
// specific language governing permissions and limitations relating to use of the SAFE Network
// Software.
// This SAFE Network Software is licensed under the BSD-3-Clause license.
// Please see the LICENSE file for more details.

use std::fmt::{self, Debug, Formatter};

Expand Down
11 changes: 4 additions & 7 deletions src/key_gen/rng_adapter.rs
@@ -1,11 +1,8 @@
// Copyright 2020 MaidSafe.net limited.
// Copyright (c) 2022, MaidSafe.
// All rights reserved.
//
// This SAFE Network Software is licensed to you under the MIT license <LICENSE-MIT
// https://opensource.org/licenses/MIT> or the Modified BSD license <LICENSE-BSD
// https://opensource.org/licenses/BSD-3-Clause>, at your option. This file may not be copied,
// modified, or distributed except according to those terms. Please review the Licences for the
// specific language governing permissions and limitations relating to use of the SAFE Network
// Software.
// This SAFE Network Software is licensed under the BSD-3-Clause license.
// Please see the LICENSE file for more details.

use rand::Rng;
use rand_core::RngCore;
Expand Down
13 changes: 5 additions & 8 deletions src/key_gen/tests.rs
@@ -1,11 +1,8 @@
// Copyright 2020 MaidSafe.net limited.
// Copyright (c) 2022, MaidSafe.
// All rights reserved.
//
// This SAFE Network Software is licensed to you under the MIT license <LICENSE-MIT
// https://opensource.org/licenses/MIT> or the Modified BSD license <LICENSE-BSD
// https://opensource.org/licenses/BSD-3-Clause>, at your option. This file may not be copied,
// modified, or distributed except according to those terms. Please review the Licences for the
// specific language governing permissions and limitations relating to use of the SAFE Network
// Software.
// This SAFE Network Software is licensed under the BSD-3-Clause license.
// Please see the LICENSE file for more details.

use crate::dev_utils::{create_ids, PeerId};
use crate::key_gen::{message::Message, Error, KeyGen, MessageAndTarget};
Expand Down Expand Up @@ -73,7 +70,7 @@ fn create_generators<R: RngCore>(

fn messaging<R: RngCore>(
mut rng: &mut R,
generators: &mut Vec<KeyGen>,
generators: &mut [KeyGen],
proposals: &mut Vec<MessageAndTarget>,
non_responsives: BTreeSet<u64>,
) {
Expand Down
11 changes: 4 additions & 7 deletions src/lib.rs
@@ -1,11 +1,8 @@
// Copyright 2020 MaidSafe.net limited.
// Copyright (c) 2022, MaidSafe.
// All rights reserved.
//
// This SAFE Network Software is licensed to you under the MIT license <LICENSE-MIT
// https://opensource.org/licenses/MIT> or the Modified BSD license <LICENSE-BSD
// https://opensource.org/licenses/BSD-3-Clause>, at your option. This file may not be copied,
// modified, or distributed except according to those terms. Please review the Licences for the
// specific language governing permissions and limitations relating to use of the SAFE Network
// Software.
// This SAFE Network Software is licensed under the BSD-3-Clause license.
// Please see the LICENSE file for more details.

#![doc(
html_logo_url = "https://raw.githubusercontent.com/maidsafe/QA/master/Images/maidsafe_logo.png",
Expand Down

0 comments on commit 661874b

Please sign in to comment.