-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCargo.toml
More file actions
80 lines (76 loc) · 3.04 KB
/
Copy pathCargo.toml
File metadata and controls
80 lines (76 loc) · 3.04 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
[workspace]
members = [".", "kernel-proto"]
# Lint/test default surface is the api package only — same idea as node CI
# (`-p node -p shared`): the generated kernel-proto crate is not on the
# clippy line. Identity tests for the carried .proto live in api.
default-members = ["."]
resolver = "2"
[package]
name = "api"
version = "0.1.0"
edition = "2021"
description = "zkCoins public REST API layer"
license = "MIT"
publish = false
# Register the `coverage_nightly` cfg so `#[cfg_attr(coverage_nightly,
# coverage(off))]` is not an `unexpected_cfgs` error under `-D warnings`.
# `cargo llvm-cov` injects this cfg.
[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = ["cfg(coverage_nightly)"] }
[dependencies]
# tonic 0.13.1 matches zk-coins/node (kernel-proto): last line whose
# tonic-build still owns prost codegen (`compile_protos`). 0.14 moved that
# to tonic-prost-build — two codegen paths for the same .proto are avoided.
# Client features only: no `router` (server add_service). Handler tests use
# a trait double, not an in-process tonic server.
axum = { version = "0.7.9", features = ["json"] }
tokio = { version = "1", features = [
"rt-multi-thread",
"macros",
"net",
"signal",
"sync",
"time",
] }
tonic = { version = "0.13.1", default-features = false, features = [
"codegen",
"prost",
"transport",
] }
# Richer-error envelope (`google.rpc.Status` + `ErrorInfo`) — same line as
# zk-coins/node so the API decodes the production wire shape the node packs.
tonic-types = "0.13.1"
prost = "0.13.5"
prost-types = "0.13.5"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
futures-util = "0.3"
async-trait = "0.1"
# SHA-256 for chal / request_hash / chan_bind / address binding (§1.1, §5.1).
sha2 = "0.10.9"
# CSPRNG for the api-local grant-revoke challenge nonce (§5.2) — no kernel
# Redeem exists for this action, so the api generates its own nonce here.
getrandom = "0.4"
# BIP-340 Schnorr — same line as zk-coins/node (`bitcoin` → secp256k1).
# Used only for OwnershipProof verification at the API edge.
bitcoin = { version = "0.32.5", default-features = false, features = [
"std",
"secp-recovery",
] }
# Bech32m for `zk` addresses (§1.7.7); same major as node workspace.
bech32 = "0.11"
# Generated kernel.v1 client stubs — separate crate so default clippy/test
# of `api` does not lint tonic-build output (result_large_err on Status).
kernel-proto = { path = "kernel-proto" }
[dev-dependencies]
# Same versions as node/Cargo.toml [dev-dependencies] where shared.
tower = { version = "0.5", features = ["util"] }
http-body-util = "0.1"
# Generated service and tonic router are test-target-only: resolver v2 keeps
# these features out of ordinary api library/binary builds.
kernel-proto = { path = "kernel-proto", features = ["test-server"] }
tonic = { version = "0.13.1", default-features = false, features = ["router"] }
hyper-util = { version = "0.1", features = ["tokio"] }
tokio = { version = "1", features = ["io-util"] }