From ccef36d7b7141230e953f0f62c047a8e9a8bbd12 Mon Sep 17 00:00:00 2001 From: dndll Date: Mon, 13 Nov 2023 14:28:23 +0000 Subject: [PATCH] chore: fmt toml and rust --- Cargo.toml | 46 +++++++++++++++----------------- Makefile | 4 +++ contracts/blob-store/Cargo.toml | 18 ++++++------- crates/da-rpc-sys/Cargo.toml | 18 ++++++------- crates/da-rpc/Cargo.toml | 24 ++++++++--------- crates/erasure-commit/Cargo.toml | 24 ++++++++--------- crates/primitives/Cargo.toml | 16 +++++------ rust-toolchain.toml | 6 ++--- taplo.toml | 12 +++++++++ 9 files changed, 90 insertions(+), 78 deletions(-) create mode 100644 taplo.toml diff --git a/Cargo.toml b/Cargo.toml index 9e8aa47..ecba411 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,46 +1,42 @@ [profile.release] -codegen-units = 1 -opt-level = "z" -lto = true -debug = false -panic = "abort" +codegen-units = 1 +debug = false +lto = true +opt-level = "z" overflow-checks = true +panic = "abort" # [profile.dev] # debug = 0 [workspace.package] -version = "2.0.0" -authors = ["Pagoda "] +authors = [ "Pagoda " ] edition = "2021" +version = "2.0.0" [workspace] -members = ["crates/*", "contracts/*", "bin/*"] +members = [ "crates/*", "contracts/*", "bin/*" ] resolver = "2" [workspace.dependencies] # Nostd -borsh = { version = "0.10.3", default-features = false } -serde_with = { version = "3.4", default-features = false, features = [ - "hex", - "base64", - "macros", -] } -serde = { version = "1.0", default-features = false, features = ["derive"] } +borsh = { version = "0.10.3", default-features = false } +serde = { version = "1.0", default-features = false, features = [ "derive" ] } +serde_with = { version = "3.4", default-features = false, features = [ "hex", "base64", "macros" ] } # Std aware -eyre = "0.6" -log = "0.4" -rand = "0.8" -hex = "0.4" -serde_json = "1.0" -futures = "0.3" async-trait = "0.1" +eyre = "0.6" +futures = "0.3" +hex = "0.4" +log = "0.4" +rand = "0.8" +serde_json = "1.0" # NEAR -near-sdk = "4.0.0" -near-crypto = "0.17.0" -near-jsonrpc-client = "0.6.0" +near-crypto = "0.17.0" +near-jsonrpc-client = "0.6.0" near-jsonrpc-primitives = "0.17.0" -near-primitives = "0.17.0" +near-primitives = "0.17.0" +near-sdk = "4.0.0" near-sdk-contract-tools = "1.0.1" diff --git a/Makefile b/Makefile index 27dbbce..b048e7b 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,10 @@ TAG_PREFIX := us-docker.pkg.dev/pagoda-solutions-dev/rollup-data-availability IMAGE_TAG := 0.1.0 +format: + taplo format + cargo fmt --all + submodules: git submodule update --init --recursive .PHONY: submodules diff --git a/contracts/blob-store/Cargo.toml b/contracts/blob-store/Cargo.toml index 19512e7..3c4f96b 100644 --- a/contracts/blob-store/Cargo.toml +++ b/contracts/blob-store/Cargo.toml @@ -1,25 +1,25 @@ [package] -name = "near-da-blob-store" -version = { workspace = true } authors = { workspace = true } edition = { workspace = true } +name = "near-da-blob-store" +version = { workspace = true } [lib] -crate-type = ["cdylib"] +crate-type = [ "cdylib" ] [dependencies] +borsh = { workspace = true } near-sdk = { workspace = true } -borsh = { workspace = true } -uint = { version = "0.9.3", default-features = false } +uint = { version = "0.9.3", default-features = false } near-da-primitives = { path = "../../crates/primitives", default-features = false } [dev-dependencies] -near-workspaces = { version = "0.8.0", features = ["unstable"] } +near-workspaces = { version = "0.8.0", features = [ "unstable" ] } # FIXME: remove tilde -tokio = "~1.28" anyhow = "1.0.75" +tokio = "~1.28" [features] -default = ["std"] -std = ["near-da-primitives/std", "borsh/std", "uint/std"] +default = [ "std" ] +std = [ "near-da-primitives/std", "borsh/std", "uint/std" ] diff --git a/crates/da-rpc-sys/Cargo.toml b/crates/da-rpc-sys/Cargo.toml index 7b6f307..2f49fd7 100644 --- a/crates/da-rpc-sys/Cargo.toml +++ b/crates/da-rpc-sys/Cargo.toml @@ -1,25 +1,25 @@ [package] -name = "near-da-rpc-sys" -version.workspace = true authors.workspace = true edition.workspace = true +name = "near-da-rpc-sys" +version.workspace = true [lib] -crate-type = ["cdylib", "staticlib"] +crate-type = [ "cdylib", "staticlib" ] [dependencies] -libc = "*" +libc = "*" once_cell = "*" -tokio = { version = "1.0", features = ["full"] } +tokio = { version = "1.0", features = [ "full" ] } # TODO: move to eyre -anyhow = "*" +anyhow = "*" +da-rpc = { path = "../da-rpc", package = "near-da-rpc" } ffi_helpers = "*" -da-rpc = { path = "../da-rpc", package = "near-da-rpc" } -openssl = { version = "0.10", features = ["vendored"] } +openssl = { version = "0.10", features = [ "vendored" ] } [dev-dependencies] pretty_env_logger = "*" [build-dependencies] cbindgen = "*" -which = "*" +which = "*" diff --git a/crates/da-rpc/Cargo.toml b/crates/da-rpc/Cargo.toml index 7559a1b..3ddd9dd 100644 --- a/crates/da-rpc/Cargo.toml +++ b/crates/da-rpc/Cargo.toml @@ -1,30 +1,30 @@ [package] -name = "near-da-rpc" -version.workspace = true authors.workspace = true edition.workspace = true +name = "near-da-rpc" +version.workspace = true [dependencies] -log = { workspace = true } -eyre = { workspace = true } async-trait = { workspace = true } -tokio = { version = "1.0", features = ["full"] } -futures = { workspace = true } +eyre = { workspace = true } +futures = { workspace = true } +log = { workspace = true } +tokio = { version = "1.0", features = [ "full" ] } # Serialization -serde = { workspace = true, default-features = true } +serde = { workspace = true, default-features = true } serde_json = { workspace = true } serde_with = { workspace = true, default-features = true } -near-crypto = { workspace = true } -near-primitives = { workspace = true } -near-jsonrpc-client = { workspace = true } +near-crypto = { workspace = true } +near-da-primitives = { path = "../primitives" } +near-jsonrpc-client = { workspace = true } near-jsonrpc-primitives = { workspace = true } -near-da-primitives = { path = "../primitives" } +near-primitives = { workspace = true } [dev-dependencies] pretty_env_logger = "*" [build-dependencies] cbindgen = "*" -which = "*" +which = "*" diff --git a/crates/erasure-commit/Cargo.toml b/crates/erasure-commit/Cargo.toml index 9dc07a7..87c2ba6 100644 --- a/crates/erasure-commit/Cargo.toml +++ b/crates/erasure-commit/Cargo.toml @@ -1,22 +1,22 @@ [package] -name = "near-da-erasure-commit" -version.workspace = true authors.workspace = true edition.workspace = true +name = "near-da-erasure-commit" +version.workspace = true [dependencies] -borsh = { workspace = true } -serde_with = { workspace = true } -serde = { workspace = true } +borsh = { workspace = true } +hex = { workspace = true } +log = { workspace = true } near-primitives = { workspace = true } -log = { workspace = true } -rand = { workspace = true } -hex = { workspace = true } +rand = { workspace = true } +serde = { workspace = true } +serde_with = { workspace = true } +eyre = { workspace = true } +lambdaworks-crypto = "0.2" +lambdaworks-math = "0.2" +nalgebra = "*" reed-solomon-novelpoly = "1" -lambdaworks-math = "0.2" -lambdaworks-crypto = "0.2" -nalgebra = "*" -eyre = { workspace = true } [dev-dependencies] diff --git a/crates/primitives/Cargo.toml b/crates/primitives/Cargo.toml index f3bb4a5..2a9fd95 100644 --- a/crates/primitives/Cargo.toml +++ b/crates/primitives/Cargo.toml @@ -1,19 +1,19 @@ [package] -name = "near-da-primitives" -version.workspace = true authors.workspace = true edition.workspace = true +name = "near-da-primitives" +version.workspace = true [dependencies] -serde_with = { workspace = true } -serde = { workspace = true } -borsh = { workspace = true } +borsh = { workspace = true } near-primitives = { workspace = true, default-features = false, optional = true } +serde = { workspace = true } +serde_with = { workspace = true } [dev-dependencies] hex = { workspace = true } [features] -default = ["std", "crypto"] -std = ["serde_with/std", "serde/std", "borsh/std"] -crypto = ["near-primitives"] +crypto = [ "near-primitives" ] +default = [ "std", "crypto" ] +std = [ "serde_with/std", "serde/std", "borsh/std" ] diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 9928dc7..5685cde 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -2,6 +2,6 @@ # This specifies the version of Rust we use to build. # Individual crates in the workspace may support a lower version, as indicated by `rust-version` field in each crate's `Cargo.toml`. # The version specified below, should be at least as high as the maximum `rust-version` within the workspace. -channel = "1.72.0" -components = ["rustfmt", "rust-src"] -targets = ["wasm32-unknown-unknown"] +channel = "1.72.0" +components = [ "rustfmt", "rust-src" ] +targets = [ "wasm32-unknown-unknown" ] diff --git a/taplo.toml b/taplo.toml new file mode 100644 index 0000000..441d577 --- /dev/null +++ b/taplo.toml @@ -0,0 +1,12 @@ +exclude = [ ".direnv/**", "**/node_modules/**", "cdk-stack/**", "op-stack/**", "bin/light-client/**" ] +include = [ "**/*.toml" ] + +[formatting] +align_comments = false +align_entries = true +allowed_blank_lines = 1 +array_auto_collapse = true +array_auto_expand = true +column_width = 170 +compact_arrays = false +reorder_keys = true