Skip to content

Commit

Permalink
CHORE-1170: Add license headers (#1172)
Browse files Browse the repository at this point in the history
* CHORE-1170: Add license script.

* CHORE-1170: Add license header where missing.

* CHORE-1170: Only do the diff on modified files, not deleted or added

* CHORE-1170: Add modified files since taken.

* CHORE-1170: Exclude deleted, include everything else.

* CHORE-1170: More files

* CHORE-1170: Change back to master
  • Loading branch information
aakoshh authored Dec 1, 2022
1 parent 792010d commit dd79a13
Show file tree
Hide file tree
Showing 234 changed files with 430 additions and 3 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ jobs:
with:
command: fmt
args: -- --check
- name: Check license headers
run: make license

cargo:
needs: [rustfmt]
runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -131,7 +134,7 @@ jobs:
uses: actions-rs/cargo@844f36862e911db73fe0815f00a4a2602c279505 # v1.0.3
with:
command: cache
args: --autoclean
args: --autoclean
- name: Getting Cargo Cache Size
if: ${{ matrix.push }}
uses: actions-rs/cargo@844f36862e911db73fe0815f00a4a2602c279505 # v1.0.3
Expand Down
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ build:
clean:
cargo clean

lint: clean
lint: license clean
cargo fmt --all
cargo clippy --all -- -D warnings -A clippy::upper_case_acronyms

license:
./scripts/add_license.sh
2 changes: 2 additions & 0 deletions fvm/src/account_actor.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2021-2023 Protocol Labs
// SPDX-License-Identifier: Apache-2.0, MIT
//! This module contains the minimal logic for the FVM to handle account actor
//! auto-creation (on first transfer).
//!
Expand Down
1 change: 1 addition & 0 deletions fvm/src/blockstore/buffered.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Copyright 2021-2023 Protocol Labs
// Copyright 2019-2022 ChainSafe Systems
// SPDX-License-Identifier: Apache-2.0, MIT

Expand Down
2 changes: 2 additions & 0 deletions fvm/src/blockstore/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2021-2023 Protocol Labs
// SPDX-License-Identifier: Apache-2.0, MIT
//! Private blockstores for use in the FVM.
mod buffered;
Expand Down
2 changes: 2 additions & 0 deletions fvm/src/call_manager/backtrace.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2021-2023 Protocol Labs
// SPDX-License-Identifier: Apache-2.0, MIT
use std::fmt::Display;

use fvm_shared::address::Address;
Expand Down
2 changes: 2 additions & 0 deletions fvm/src/call_manager/default.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2021-2023 Protocol Labs
// SPDX-License-Identifier: Apache-2.0, MIT
use std::mem;

use anyhow::{anyhow, Context};
Expand Down
2 changes: 2 additions & 0 deletions fvm/src/call_manager/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2021-2023 Protocol Labs
// SPDX-License-Identifier: Apache-2.0, MIT
use cid::Cid;
use fvm_shared::address::Address;
use fvm_shared::econ::TokenAmount;
Expand Down
2 changes: 2 additions & 0 deletions fvm/src/executor/default.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2021-2023 Protocol Labs
// SPDX-License-Identifier: Apache-2.0, MIT
use std::ops::{Deref, DerefMut};
use std::result::Result as StdResult;

Expand Down
2 changes: 2 additions & 0 deletions fvm/src/executor/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2021-2023 Protocol Labs
// SPDX-License-Identifier: Apache-2.0, MIT
mod default;
mod threaded;

Expand Down
2 changes: 2 additions & 0 deletions fvm/src/executor/threaded.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2021-2023 Protocol Labs
// SPDX-License-Identifier: Apache-2.0, MIT
use anyhow::anyhow;
use cid::Cid;
use fvm_shared::message::Message;
Expand Down
2 changes: 2 additions & 0 deletions fvm/src/externs/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2021-2023 Protocol Labs
// SPDX-License-Identifier: Apache-2.0, MIT
//! This module contains the logic to invoke the node by traversing Boundary A.
use cid::Cid;
Expand Down
1 change: 1 addition & 0 deletions fvm/src/gas/charge.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Copyright 2021-2023 Protocol Labs
// Copyright 2019-2022 ChainSafe Systems
// SPDX-License-Identifier: Apache-2.0, MIT

Expand Down
1 change: 1 addition & 0 deletions fvm/src/gas/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Copyright 2021-2023 Protocol Labs
// Copyright 2019-2022 ChainSafe Systems
// SPDX-License-Identifier: Apache-2.0, MIT

Expand Down
2 changes: 2 additions & 0 deletions fvm/src/gas/outputs.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2021-2023 Protocol Labs
// SPDX-License-Identifier: Apache-2.0, MIT
use std::convert::TryFrom;

use fvm_shared::bigint::BigInt;
Expand Down
1 change: 1 addition & 0 deletions fvm/src/gas/price_list.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Copyright 2021-2023 Protocol Labs
// Copyright 2019-2022 ChainSafe Systems
// SPDX-License-Identifier: Apache-2.0, MIT

Expand Down
2 changes: 2 additions & 0 deletions fvm/src/init_actor.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2021-2023 Protocol Labs
// SPDX-License-Identifier: Apache-2.0, MIT
//! This module contains the types and functions to process the init actor's state.
//! It does not contain the logic of the init actor: that lives on-chain as a WASM actor.
//!
Expand Down
2 changes: 2 additions & 0 deletions fvm/src/kernel/blocks.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2021-2023 Protocol Labs
// SPDX-License-Identifier: Apache-2.0, MIT
use std::convert::TryInto;
use std::rc::Rc;

Expand Down
2 changes: 2 additions & 0 deletions fvm/src/kernel/default.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2021-2023 Protocol Labs
// SPDX-License-Identifier: Apache-2.0, MIT
use std::collections::BTreeMap;
use std::convert::{TryFrom, TryInto};
use std::panic::{self, UnwindSafe};
Expand Down
2 changes: 2 additions & 0 deletions fvm/src/kernel/error.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2021-2023 Protocol Labs
// SPDX-License-Identifier: Apache-2.0, MIT
use std::fmt::Display;

use derive_more::Display;
Expand Down
2 changes: 2 additions & 0 deletions fvm/src/kernel/hash.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2021-2023 Protocol Labs
// SPDX-License-Identifier: Apache-2.0, MIT
use multihash::derive::Multihash;
use multihash::{Blake2b256, Blake2b512, Keccak256, Ripemd160, Sha2_256};

Expand Down
2 changes: 2 additions & 0 deletions fvm/src/kernel/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2021-2023 Protocol Labs
// SPDX-License-Identifier: Apache-2.0, MIT
pub use blocks::{Block, BlockId, BlockRegistry, BlockStat};
use cid::Cid;
use fvm_shared::address::Address;
Expand Down
2 changes: 2 additions & 0 deletions fvm/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2021-2023 Protocol Labs
// SPDX-License-Identifier: Apache-2.0, MIT
//! (Proper package docs coming shortly; for now this is a holding pen for items
//! we must mention).
//!
Expand Down
2 changes: 2 additions & 0 deletions fvm/src/machine/boxed.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2021-2023 Protocol Labs
// SPDX-License-Identifier: Apache-2.0, MIT
use cid::Cid;
use fvm_shared::address::Address;
use fvm_shared::econ::TokenAmount;
Expand Down
2 changes: 2 additions & 0 deletions fvm/src/machine/default.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2021-2023 Protocol Labs
// SPDX-License-Identifier: Apache-2.0, MIT
use std::ops::RangeInclusive;

use anyhow::{anyhow, Context as _};
Expand Down
2 changes: 2 additions & 0 deletions fvm/src/machine/engine.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2021-2023 Protocol Labs
// SPDX-License-Identifier: Apache-2.0, MIT
use std::any::{Any, TypeId};
use std::collections::hash_map::Entry::{Occupied, Vacant};
use std::collections::HashMap;
Expand Down
2 changes: 2 additions & 0 deletions fvm/src/machine/limiter.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2021-2023 Protocol Labs
// SPDX-License-Identifier: Apache-2.0, MIT
use wasmtime::ResourceLimiter;

use crate::machine::NetworkConfig;
Expand Down
2 changes: 2 additions & 0 deletions fvm/src/machine/manifest.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2021-2023 Protocol Labs
// SPDX-License-Identifier: Apache-2.0, MIT
use std::collections::{HashMap, HashSet};

use anyhow::{anyhow, Context};
Expand Down
2 changes: 2 additions & 0 deletions fvm/src/machine/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2021-2023 Protocol Labs
// SPDX-License-Identifier: Apache-2.0, MIT
use cid::Cid;
use derive_more::{Deref, DerefMut};
use fvm_ipld_blockstore::Blockstore;
Expand Down
1 change: 1 addition & 0 deletions fvm/src/state_tree.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Copyright 2021-2023 Protocol Labs
// Copyright 2019-2022 ChainSafe Systems
// SPDX-License-Identifier: Apache-2.0, MIT

Expand Down
2 changes: 2 additions & 0 deletions fvm/src/syscalls/actor.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2021-2023 Protocol Labs
// SPDX-License-Identifier: Apache-2.0, MIT
use anyhow::{anyhow, Context as _};
use fvm_shared::{sys, ActorID};

Expand Down
2 changes: 2 additions & 0 deletions fvm/src/syscalls/bind.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2021-2023 Protocol Labs
// SPDX-License-Identifier: Apache-2.0, MIT
use std::mem;

use fvm_shared::error::ErrorNumber;
Expand Down
2 changes: 2 additions & 0 deletions fvm/src/syscalls/context.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2021-2023 Protocol Labs
// SPDX-License-Identifier: Apache-2.0, MIT
use std::io::Cursor;
use std::ops::{Deref, DerefMut};
use std::panic;
Expand Down
2 changes: 2 additions & 0 deletions fvm/src/syscalls/crypto.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2021-2023 Protocol Labs
// SPDX-License-Identifier: Apache-2.0, MIT
use std::cmp;

use anyhow::{anyhow, Context as _};
Expand Down
2 changes: 2 additions & 0 deletions fvm/src/syscalls/debug.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2021-2023 Protocol Labs
// SPDX-License-Identifier: Apache-2.0, MIT
use crate::kernel::{ClassifyResult, Result};
use crate::syscalls::context::Context;
use crate::Kernel;
Expand Down
2 changes: 2 additions & 0 deletions fvm/src/syscalls/error.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2021-2023 Protocol Labs
// SPDX-License-Identifier: Apache-2.0, MIT
//! This module contains code used to convert errors to and from wasmtime traps.
use std::sync::Mutex;

Expand Down
2 changes: 2 additions & 0 deletions fvm/src/syscalls/event.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2021-2023 Protocol Labs
// SPDX-License-Identifier: Apache-2.0, MIT
use fvm_shared::event::ActorEvent;

use super::Context;
Expand Down
2 changes: 2 additions & 0 deletions fvm/src/syscalls/gas.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2021-2023 Protocol Labs
// SPDX-License-Identifier: Apache-2.0, MIT
use std::str;

use super::Context;
Expand Down
2 changes: 2 additions & 0 deletions fvm/src/syscalls/ipld.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2021-2023 Protocol Labs
// SPDX-License-Identifier: Apache-2.0, MIT
use fvm_shared::sys;

use super::Context;
Expand Down
2 changes: 2 additions & 0 deletions fvm/src/syscalls/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2021-2023 Protocol Labs
// SPDX-License-Identifier: Apache-2.0, MIT
use std::mem;

use anyhow::{anyhow, Context as _};
Expand Down
2 changes: 2 additions & 0 deletions fvm/src/syscalls/network.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2021-2023 Protocol Labs
// SPDX-License-Identifier: Apache-2.0, MIT
use anyhow::Context as _;
use fvm_shared::sys;
use fvm_shared::sys::out::network::NetworkContext;
Expand Down
2 changes: 2 additions & 0 deletions fvm/src/syscalls/rand.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2021-2023 Protocol Labs
// SPDX-License-Identifier: Apache-2.0, MIT
use fvm_shared::randomness::RANDOMNESS_LENGTH;

use super::Context;
Expand Down
2 changes: 2 additions & 0 deletions fvm/src/syscalls/send.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2021-2023 Protocol Labs
// SPDX-License-Identifier: Apache-2.0, MIT
use anyhow::Context as _;
use fvm_shared::address::Address;
use fvm_shared::econ::TokenAmount;
Expand Down
2 changes: 2 additions & 0 deletions fvm/src/syscalls/sself.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2021-2023 Protocol Labs
// SPDX-License-Identifier: Apache-2.0, MIT
use anyhow::Context as _;
use fvm_shared::sys;

Expand Down
2 changes: 2 additions & 0 deletions fvm/src/syscalls/vm.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2021-2023 Protocol Labs
// SPDX-License-Identifier: Apache-2.0, MIT
use fvm_shared::error::ExitCode;
use fvm_shared::sys::out::vm::MessageContext;
use fvm_shared::sys::SyscallSafe;
Expand Down
2 changes: 2 additions & 0 deletions fvm/src/system_actor.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2021-2023 Protocol Labs
// SPDX-License-Identifier: Apache-2.0, MIT
use anyhow::Context;
use cid::Cid;
use fvm_ipld_blockstore::Blockstore;
Expand Down
2 changes: 2 additions & 0 deletions fvm/src/trace/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2021-2023 Protocol Labs
// SPDX-License-Identifier: Apache-2.0, MIT
use fvm_ipld_encoding::RawBytes;
use fvm_shared::address::Address;
use fvm_shared::econ::TokenAmount;
Expand Down
2 changes: 2 additions & 0 deletions fvm/tests/default_kernel/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2021-2023 Protocol Labs
// SPDX-License-Identifier: Apache-2.0, MIT
use std::cell::RefCell;
use std::rc::Rc;

Expand Down
2 changes: 2 additions & 0 deletions fvm/tests/default_kernel/ops.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2021-2023 Protocol Labs
// SPDX-License-Identifier: Apache-2.0, MIT
use super::*;

mod ipld {
Expand Down
2 changes: 2 additions & 0 deletions fvm/tests/dummy.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2021-2023 Protocol Labs
// SPDX-License-Identifier: Apache-2.0, MIT
use std::borrow::Borrow;
use std::cell::RefCell;
use std::rc::Rc;
Expand Down
2 changes: 2 additions & 0 deletions fvm/tests/fvm.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2021-2023 Protocol Labs
// SPDX-License-Identifier: Apache-2.0, MIT
mod default_kernel;
mod dummy;

Expand Down
1 change: 1 addition & 0 deletions ipld/amt/benches/amt_benchmark.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Copyright 2021-2023 Protocol Labs
// Copyright 2019-2022 ChainSafe Systems
// SPDX-License-Identifier: Apache-2.0, MIT

Expand Down
1 change: 1 addition & 0 deletions ipld/amt/fuzz/fuzz_targets/equivalence.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Copyright 2021-2023 Protocol Labs
// Copyright 2019-2022 ChainSafe Systems
// SPDX-License-Identifier: Apache-2.0, MIT

Expand Down
1 change: 1 addition & 0 deletions ipld/amt/src/amt.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Copyright 2021-2023 Protocol Labs
// Copyright 2019-2022 ChainSafe Systems
// SPDX-License-Identifier: Apache-2.0, MIT

Expand Down
1 change: 1 addition & 0 deletions ipld/amt/src/error.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Copyright 2021-2023 Protocol Labs
// Copyright 2019-2022 ChainSafe Systems
// SPDX-License-Identifier: Apache-2.0, MIT

Expand Down
1 change: 1 addition & 0 deletions ipld/amt/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Copyright 2021-2023 Protocol Labs
// Copyright 2019-2022 ChainSafe Systems
// SPDX-License-Identifier: Apache-2.0, MIT

Expand Down
1 change: 1 addition & 0 deletions ipld/amt/src/node.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Copyright 2021-2023 Protocol Labs
// Copyright 2019-2022 ChainSafe Systems
// SPDX-License-Identifier: Apache-2.0, MIT

Expand Down
1 change: 1 addition & 0 deletions ipld/amt/src/root.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Copyright 2021-2023 Protocol Labs
// Copyright 2019-2022 ChainSafe Systems
// SPDX-License-Identifier: Apache-2.0, MIT

Expand Down
1 change: 1 addition & 0 deletions ipld/amt/src/value_mut.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Copyright 2021-2023 Protocol Labs
// Copyright 2019-2022 ChainSafe Systems
// SPDX-License-Identifier: Apache-2.0, MIT

Expand Down
1 change: 1 addition & 0 deletions ipld/amt/tests/amt_tests.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Copyright 2021-2023 Protocol Labs
// Copyright 2019-2022 ChainSafe Systems
// SPDX-License-Identifier: Apache-2.0, MIT

Expand Down
1 change: 1 addition & 0 deletions ipld/bitfield/benches/benchmarks/examples.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Copyright 2021-2023 Protocol Labs
// Copyright 2019-2022 ChainSafe Systems
// SPDX-License-Identifier: Apache-2.0, MIT

Expand Down
1 change: 1 addition & 0 deletions ipld/bitfield/benches/benchmarks/main.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Copyright 2021-2023 Protocol Labs
// Copyright 2019-2022 ChainSafe Systems
// SPDX-License-Identifier: Apache-2.0, MIT

Expand Down
1 change: 1 addition & 0 deletions ipld/bitfield/src/iter/combine.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Copyright 2021-2023 Protocol Labs
// Copyright 2019-2022 ChainSafe Systems
// SPDX-License-Identifier: Apache-2.0, MIT

Expand Down
1 change: 1 addition & 0 deletions ipld/bitfield/src/iter/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Copyright 2021-2023 Protocol Labs
// Copyright 2019-2022 ChainSafe Systems
// SPDX-License-Identifier: Apache-2.0, MIT

Expand Down
1 change: 1 addition & 0 deletions ipld/bitfield/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Copyright 2021-2023 Protocol Labs
// Copyright 2019-2022 ChainSafe Systems
// SPDX-License-Identifier: Apache-2.0, MIT

Expand Down
2 changes: 2 additions & 0 deletions ipld/bitfield/src/ops.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2021-2023 Protocol Labs
// SPDX-License-Identifier: Apache-2.0, MIT
use std::ops::{BitAnd, BitAndAssign, BitOr, BitOrAssign, BitXor, BitXorAssign, Sub, SubAssign};

use crate::{BitField, RangeIterator};
Expand Down
Loading

0 comments on commit dd79a13

Please sign in to comment.