[package]
name = "commonware-consensus"
edition.workspace = true
publish = true
version.workspace = true
license.workspace = true
description = "Order opaque messages in a Byzantine environment."
readme = "README.md"
homepage.workspace = true
repository = "https://github.com/commonwarexyz/monorepo/tree/main/consensus"
documentation = "https://docs.rs/commonware-consensus"

[lints]
workspace = true

[dependencies]
arbitrary = { workspace = true, optional = true, features = ["derive"] }
bytes.workspace = true
cfg-if.workspace = true
commonware-broadcast.workspace = true
commonware-codec.workspace = true
commonware-cryptography.workspace = true
commonware-math = { workspace = true, optional = true }
commonware-resolver.workspace = true
commonware-utils.workspace = true
futures.workspace = true
rand.workspace = true
thiserror.workspace = true

[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
commonware-macros.workspace = true
commonware-p2p.workspace = true
commonware-runtime.workspace = true
commonware-storage = { workspace = true, features = ["std"] }
pin-project.workspace = true
prometheus-client.workspace = true
rand_distr.workspace = true
tracing.workspace = true

[dev-dependencies]
commonware-conformance.workspace = true
commonware-consensus = { path = ".", features = ["mocks"] }
commonware-math.workspace = true
commonware-resolver = { workspace = true, features = ["mocks"] }
rstest.workspace = true
tracing-subscriber.workspace = true

[package.metadata.cargo-udeps.ignore]
development = ["commonware-consensus"]

[lib]
bench = false
crate-type = ["rlib", "cdylib"]

[features]
mocks = [ "commonware-cryptography/mocks" ]
fuzz = [ "dep:commonware-math", "mocks" ]
arbitrary = [
	"commonware-codec/arbitrary",
	"commonware-cryptography/arbitrary",
	"commonware-math/arbitrary",
	"commonware-p2p/arbitrary",
	"commonware-resolver/arbitrary",
	"commonware-storage/arbitrary",
	"commonware-utils/arbitrary",
	"dep:arbitrary",
]
