Skip to content

Commit

Permalink
chore: Use inheritance to reduce copy-paste in Cargo.tomls (#7687)
Browse files Browse the repository at this point in the history
See #7674 for more details.
  • Loading branch information
akhi3030 authored and nikurt committed Nov 9, 2022
1 parent 7920351 commit 046bd14
Show file tree
Hide file tree
Showing 64 changed files with 201 additions and 197 deletions.
5 changes: 5 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -83,3 +83,8 @@ opt-level = 3
opt-level = 3
[profile.dev.package.sha2]
opt-level = 3

[workspace.package]
edition = "2021"
authors = ["Near Inc <hello@nearprotocol.com>"]
rust-version = "1.64.0"
6 changes: 3 additions & 3 deletions chain/chain-primitives/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[package]
name = "near-chain-primitives"
version = "0.0.0"
authors = ["Near Inc <hello@nearprotocol.com>"]
authors.workspace = true
publish = true
# Please update rust-toolchain.toml as well when changing version here:
rust-version = "1.64.0"
edition = "2021"
rust-version.workspace = true
edition.workspace = true
license = "MIT OR Apache-2.0"
repository = "https://github.com/near/nearcore"
description = "This crate hosts NEAR chain-related error types"
Expand Down
6 changes: 3 additions & 3 deletions chain/chain/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[package]
name = "near-chain"
version = "0.0.0"
authors = ["Near Inc <hello@nearprotocol.com>"]
authors.workspace = true
publish = false
# Please update rust-toolchain.toml as well when changing version here:
rust-version = "1.64.0"
edition = "2021"
rust-version.workspace = true
edition.workspace = true

[dependencies]
ansi_term = "0.12"
Expand Down
6 changes: 3 additions & 3 deletions chain/chunks-primitives/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[package]
name = "near-chunks-primitives"
version = "0.0.0"
authors = ["Near Inc <hello@nearprotocol.com>"]
authors.workspace = true
publish = true
# Please update rust-toolchain.toml as well when changing version here:
rust-version = "1.64.0"
edition = "2021"
rust-version.workspace = true
edition.workspace = true
license = "MIT OR Apache-2.0"
repository = "https://github.com/near/nearcore"
description = "This crate hosts NEAR chunks-related error types"
Expand Down
6 changes: 3 additions & 3 deletions chain/chunks/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[package]
name = "near-chunks"
version = "0.0.0"
authors = ["Near Inc <hello@nearprotocol.com>"]
authors.workspace = true
publish = false
# Please update rust-toolchain.toml as well when changing version here:
rust-version = "1.64.0"
edition = "2021"
rust-version.workspace = true
edition.workspace = true

[dependencies]
actix = "0.13.0"
Expand Down
6 changes: 3 additions & 3 deletions chain/client-primitives/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[package]
name = "near-client-primitives"
version = "0.0.0"
authors = ["Near Inc <hello@nearprotocol.com>"]
authors.workspace = true
publish = true
# Please update rust-toolchain.toml as well when changing version here:
rust-version = "1.64.0"
edition = "2021"
rust-version.workspace = true
edition.workspace = true
license = "MIT OR Apache-2.0"
repository = "https://github.com/near/nearcore"
description = "This crate hosts NEAR client-related error types"
Expand Down
6 changes: 3 additions & 3 deletions chain/client/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[package]
name = "near-client"
version = "0.0.0"
authors = ["Near Inc <hello@nearprotocol.com>"]
authors.workspace = true
publish = false
# Please update rust-toolchain.toml as well when changing version here:
rust-version = "1.64.0"
edition = "2021"
rust-version.workspace = true
edition.workspace = true

[dependencies]
ansi_term = "0.12"
Expand Down
6 changes: 3 additions & 3 deletions chain/epoch-manager/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[package]
name = "near-epoch-manager"
version = "0.0.0"
authors = ["Near Inc <hello@nearprotocol.com>"]
authors.workspace = true
publish = false
# Please update rust-toolchain.toml as well when changing version here:
rust-version = "1.64.0"
edition = "2021"
rust-version.workspace = true
edition.workspace = true


[dependencies]
Expand Down
6 changes: 3 additions & 3 deletions chain/indexer-primitives/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[package]
name = "near-indexer-primitives"
version = "0.0.0"
authors = ["Near Inc <hello@nearprotocol.com>"]
authors.workspace = true
publish = true
# Please update rust-toolchain.toml as well when changing version here:
rust-version = "1.64.0"
edition = "2021"
rust-version.workspace = true
edition.workspace = true
license = "MIT OR Apache-2.0"
repository = "https://github.com/near/nearcore"
description = "This crate hosts structures for the NEAR Indexer Framework types"
Expand Down
6 changes: 3 additions & 3 deletions chain/indexer/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[package]
name = "near-indexer"
version = "0.0.0"
authors = ["Near Inc <hello@nearprotocol.com>"]
authors.workspace = true
publish = false
# Please update rust-toolchain.toml as well when changing version here:
rust-version = "1.64.0"
edition = "2021"
rust-version.workspace = true
edition.workspace = true

[dependencies]
actix = "0.13.0"
Expand Down
6 changes: 3 additions & 3 deletions chain/jsonrpc-adversarial-primitives/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[package]
name = "near-jsonrpc-adversarial-primitives"
version = "0.0.0"
authors = ["Near Inc <hello@nearprotocol.com>"]
authors.workspace = true
publish = false
# Please update rust-toolchain.toml as well when changing version here:
rust-version = "1.64.0"
edition = "2021"
rust-version.workspace = true
edition.workspace = true

[dependencies]
serde = { version = "1", features = ["derive"] }
Expand Down
6 changes: 3 additions & 3 deletions chain/jsonrpc-primitives/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[package]
name = "near-jsonrpc-primitives"
version = "0.0.0"
authors = ["Near Inc <hello@nearprotocol.com>"]
authors.workspace = true
publish = true
# Please update rust-toolchain.toml as well when changing version here:
rust-version = "1.64.0"
edition = "2021"
rust-version.workspace = true
edition.workspace = true
license = "MIT OR Apache-2.0"
repository = "https://github.com/near/nearcore"
description = "This crate hosts structures for the NEAR JSON RPC Requests, Responses and Error types"
Expand Down
6 changes: 3 additions & 3 deletions chain/jsonrpc/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[package]
name = "near-jsonrpc"
version = "0.0.0"
authors = ["Near Inc <hello@nearprotocol.com>"]
authors.workspace = true
publish = false
# Please update rust-toolchain.toml as well when changing version here:
rust-version = "1.64.0"
edition = "2021"
rust-version.workspace = true
edition.workspace = true

[dependencies]
actix = "0.13.0"
Expand Down
6 changes: 3 additions & 3 deletions chain/jsonrpc/client/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[package]
name = "near-jsonrpc-client"
version = "0.0.0"
authors = ["Near Inc <hello@nearprotocol.com>"]
authors.workspace = true
publish = false
# Please update rust-toolchain.toml as well when changing version here:
rust-version = "1.64.0"
edition = "2021"
rust-version.workspace = true
edition.workspace = true

[dependencies]
awc = "3.0.0"
Expand Down
6 changes: 3 additions & 3 deletions chain/jsonrpc/fuzz/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[package]
name = "near-jsonrpc-fuzz"
version = "0.0.0"
authors = ["Near Inc <hello@nearprotocol.com>"]
authors.workspace = true
publish = false
# Please update rust-toolchain.toml as well when changing version here:
rust-version = "1.64.0"
edition = "2021"
rust-version.workspace = true
edition.workspace = true

[package.metadata]
cargo-fuzz = true
Expand Down
6 changes: 3 additions & 3 deletions chain/jsonrpc/jsonrpc-tests/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[package]
name = "near-jsonrpc-tests"
version = "0.0.0"
authors = ["Near Inc <hello@nearprotocol.com>"]
authors.workspace = true
publish = false
# Please update rust-toolchain.toml as well when changing version here:
rust-version = "1.64.0"
edition = "2021"
rust-version.workspace = true
edition.workspace = true

[dependencies]
actix = "0.13.0"
Expand Down
6 changes: 3 additions & 3 deletions chain/network-primitives/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[package]
name = "near-network-primitives"
version = "0.0.0"
authors = ["Near Inc <hello@nearprotocol.com>"]
edition = "2021"
authors.workspace = true
edition.workspace = true
# Please update rust-toolchain.toml as well when changing version here:
rust-version = "1.64.0"
rust-version.workspace = true
description = "This crate hosts NEAR network-related primitive types"
repository = "https://github.com/near/nearcore"
license = "MIT OR Apache-2.0"
Expand Down
6 changes: 3 additions & 3 deletions chain/network/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[package]
name = "near-network"
version = "0.0.0"
authors = ["Near Inc <hello@nearprotocol.com>"]
edition = "2021"
authors.workspace = true
edition.workspace = true
# Please update rust-toolchain.toml as well when changing version here:
rust-version = "1.64.0"
rust-version.workspace = true
publish = false

[build-dependencies]
Expand Down
6 changes: 3 additions & 3 deletions chain/pool/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
name = "near-pool"
version = "0.0.0"
license = "MIT OR Apache-2.0"
authors = ["Near Inc <hello@nearprotocol.com>"]
authors.workspace = true
publish = false
# Please update rust-toolchain.toml as well when changing version here:
rust-version = "1.64.0"
edition = "2021"
rust-version.workspace = true
edition.workspace = true

[dependencies]
borsh = "0.9"
Expand Down
6 changes: 3 additions & 3 deletions chain/rosetta-rpc/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[package]
name = "near-rosetta-rpc"
version = "0.0.0"
authors = ["Near Inc <hello@nearprotocol.com>"]
authors.workspace = true
publish = false
# Please update rust-toolchain.toml as well when changing version here:
rust-version = "1.64.0"
edition = "2021"
rust-version.workspace = true
edition.workspace = true

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Expand Down
6 changes: 3 additions & 3 deletions chain/telemetry/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[package]
name = "near-telemetry"
version = "0.0.0"
authors = ["Near Inc <hello@nearprotocol.com>"]
authors.workspace = true
publish = false
# Please update rust-toolchain.toml as well when changing version here:
rust-version = "1.64.0"
edition = "2021"
rust-version.workspace = true
edition.workspace = true

[dependencies]
actix = "0.13.0"
Expand Down
2 changes: 1 addition & 1 deletion core/account-id/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "near-account-id"
version = "0.0.0"
authors = ["Near Inc <hello@nearprotocol.com>"]
authors.workspace = true
publish = true
# This crate is published to crates.io with a semver API. Care must be taken
# when updaing its rust-version.
Expand Down
6 changes: 3 additions & 3 deletions core/account-id/fuzz/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
[package]
name = "near-account-id-fuzz"
version = "0.0.0"
authors = ["Near Inc <hello@nearprotocol.com>"]
authors.workspace = true
publish = false
# Please update rust-toolchain.toml as well when changing version here:
rust-version = "1.64.0"
edition = "2021"
rust-version.workspace = true
edition.workspace = true

[package.metadata]
cargo-fuzz = true
Expand Down
6 changes: 3 additions & 3 deletions core/chain-configs/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[package]
name = "near-chain-configs"
version = "0.0.0"
authors = ["Near Inc <hello@nearprotocol.com>"]
authors.workspace = true
publish = true
# Please update rust-toolchain.toml as well when changing version here:
rust-version = "1.64.0"
edition = "2021"
rust-version.workspace = true
edition.workspace = true
license = "MIT OR Apache-2.0"
repository = "https://github.com/near/nearcore"
description = "This crate provides typed interfaces to the NEAR Genesis and Chain Configs"
Expand Down
6 changes: 3 additions & 3 deletions core/crypto/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
name = "near-crypto"
version = "0.0.0"
license = "MIT OR Apache-2.0"
authors = ["Near Inc <hello@nearprotocol.com>"]
authors.workspace = true
publish = true
# Please update rust-toolchain.toml as well when changing version here:
rust-version = "1.64.0"
edition = "2021"
rust-version.workspace = true
edition.workspace = true
repository = "https://github.com/near/nearcore"
description = "This is an internal crate for common cryptographic types"

Expand Down
6 changes: 3 additions & 3 deletions core/o11y/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
[package]
name = "near-o11y"
version = "0.0.0"
authors = ["Near Inc <hello@nearprotocol.com>"]
authors.workspace = true
description = "Observability helpers for the near codebase"
edition = "2021"
edition.workspace = true
publish = false
readme = "README.md"
rust-version = "1.64.0"
rust-version.workspace = true

[dependencies]
atty = "0.2"
Expand Down
6 changes: 3 additions & 3 deletions core/primitives-core/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[package]
name = "near-primitives-core"
version = "0.0.0"
authors = ["Near Inc <hello@nearprotocol.com>"]
authors.workspace = true
publish = true
# Please update rust-toolchain.toml as well when changing version here:
rust-version = "1.64.0"
edition = "2021"
rust-version.workspace = true
edition.workspace = true
license = "MIT OR Apache-2.0"
repository = "https://github.com/near/nearcore"
description = """
Expand Down
Loading

0 comments on commit 046bd14

Please sign in to comment.