-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathCargo.toml
More file actions
158 lines (146 loc) · 5.85 KB
/
Copy pathCargo.toml
File metadata and controls
158 lines (146 loc) · 5.85 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
[workspace]
# Resolver v3 is the recommended resolver for edition-2024 packages
# (stabilised in Rust 1.84). It tightens the unification rules for
# `--no-default-features` builds, matching how CI checks the SDK.
resolver = "3"
members = [
"crates/aptos-sdk",
"crates/aptos-sdk-macros",
]
# NOTE: default-members is the complete list of binaries that form the "production Aptos codebase". These members should
# never include crates that require fuzzing features or test features. These are the crates we want built with no extra
# test-only code included.
#
# For more, see the "Conditional compilation for tests" section in documentation/coding_guidelines.md.
default-members = [
"crates/aptos-sdk",
]
# All workspace members should inherit these keys
# for package declarations.
[workspace.package]
authors = ["Aptos Labs <opensource@aptoslabs.com>"]
edition = "2024"
homepage = "https://aptoslabs.com"
license = "Apache-2.0"
publish = false
repository = "https://github.com/aptos-labs/aptos-rust-sdk"
rust-version = "1.95.0"
# Centralised lint configuration. Member crates inherit this block via
# `[lints] workspace = true`. Stabilised in Rust 1.74; replaces the older
# pattern of putting `#![warn(...)]` / `#![allow(...)]` attributes in each
# crate's `lib.rs`, which the borrow checker / rustfmt / clippy could not
# all consistently observe.
[workspace.lints.rust]
unsafe_code = "forbid"
missing_docs = "warn"
missing_debug_implementations = "warn"
unreachable_pub = "warn"
# Modern rust-2018 idioms (idiom suggestions like `use crate::...` over
# `extern crate ...`, anonymous-lifetime warnings, etc.). Kept at warn so
# the build still succeeds against newer idiom proposals in nightly.
rust_2018_idioms = { level = "warn", priority = -1 }
[workspace.lints.clippy]
pedantic = { level = "warn", priority = -1 }
# Pedantic-lint exceptions: these are intentionally allowed because they
# fire on patterns that are correct, idiomatic in an SDK codebase, or
# stylistically preferred here. Each `allow` corresponds to a clippy
# lint that introduces noise without improving correctness in this
# repository.
must_use_candidate = "allow"
match_same_arms = "allow"
# Numeric casts in API surface and demo code are intentional and
# bounded (balances printed in APT, sizes that fit in u32 mantissa, etc.).
cast_precision_loss = "allow"
cast_possible_wrap = "allow"
cast_possible_truncation = "allow"
cast_sign_loss = "allow"
# Examples and tests sometimes use very-similar names (sender / sender2,
# pk / pk_bytes); the alternative names are worse for readability.
similar_names = "allow"
# Underscore-prefixed bindings are deliberate "kept around for clarity"
# placeholders in examples.
used_underscore_binding = "allow"
# `let foo = ...; struct Bar; ...` is the dominant pattern for inline
# helpers in tests and examples; banning it harms readability.
items_after_statements = "allow"
# We intentionally use unbuffered std::io in a few examples and tests
# where the surrounding code does its own batching / line-based printing.
unbuffered_bytes = "allow"
# Doc-comment markdown lint fires on every external identifier; the
# codebase has already migrated all reasonable callouts to backticks
# but examples and prose still trip it.
doc_markdown = "allow"
# Function-length and struct-bool-count are stylistic; example programs
# and the codegen CLI have a few long functions / config structs by design.
too_many_lines = "allow"
struct_excessive_bools = "allow"
# Numeric-literal underscore separators are not consistently used in the
# crate; turning them into hard errors via -D warnings is noise.
unreadable_literal = "allow"
# `#[ignore]` without a `= "reason"` argument: the e2e tests use bare
# `#[ignore]` to gate network-dependent tests; the reason is documented
# in the module-level comment of `tests/e2e/mod.rs`.
needless_pass_by_value = "allow"
# Many e2e tests use plain `#[ignore]`; the gating rationale is in the
# module-level docs, not a per-test attribute argument.
ignore_without_reason = "allow"
# `async` functions with no `await` are common in trait implementations
# whose signatures must be `async fn` regardless of internal awaits.
unused_async = "allow"
# A handful of futures inside async tests temporarily hold large local
# state. None of them are awaited in hot paths so the size warning is
# noise.
large_futures = "allow"
[workspace.dependencies]
# Internal crate dependencies.
# Please do not add any test features here: they should be declared by the individual crate.
aptos-sdk = { version = "0.6.0", path = "crates/aptos-sdk" }
aptos-sdk-macros = { version = "0.3.0", path = "crates/aptos-sdk-macros" }
# External crate dependencies.
# Please do not add any test features here: they should be declared by the individual crate.
anyhow = "1.0.103"
arbitrary = { version = "1.4.1", features = ["derive"] }
aptos-bcs = "0.1.4"
aws-lc-sys = "0.39.0"
const-hex = { version = "1.17.0", features = ["serde"] }
proc-macro2 = "1.0.94"
proptest = "1.6.0"
proptest-derive = "0.5.1"
quote = "1.0.40"
reqwest = { version = "0.13.2", features = ["json"] }
serde = { version = "1.0.219", features = ["derive"] }
serde_json = { version = "1.0.140", features = [
"preserve_order",
"arbitrary_precision",
] } # Note: arbitrary_precision is required to parse u256 in JSON
thiserror = "2.0.18"
trybuild = "1.0.104"
tokio = { version = "1.44.1", features = ["macros"] }
url = "2.5.4"
[profile.release]
debug = false
overflow-checks = true
lto = "thin"
# The performance build is not currently recommended
# for production deployments. It has not been widely tested.
[profile.performance]
inherits = "release"
opt-level = 3
debug = true
overflow-checks = true
lto = "thin"
codegen-units = 1
[profile.cli]
inherits = "release"
debug = false
opt-level = "z"
lto = "thin"
strip = true
codegen-units = 1
[profile.ci]
inherits = "release"
debug = "line-tables-only"
overflow-checks = true
debug-assertions = true
[profile.bench]
debug = true