diff --git a/coin/Cargo.toml b/coin/Cargo.toml index a8ef301e..f5f07c60 100644 --- a/coin/Cargo.toml +++ b/coin/Cargo.toml @@ -1,14 +1,18 @@ [package] name = "serai-coin" version = "0.1.0" -description = "Abstract interface to represent a coin" +description = "An abstract interface representing a coin, along with implementations for various coins." license = "MIT" -repository = "https://github.com/serai-dex/serai" +repository = "https://github.com/serai-dex/serai/tree/develop/coin" authors = ["Luke Parker "] keywords = [] edition = "2021" publish = false +[package.metadata.docs.rs] +all-features = true +rustdoc-args = ["--cfg", "docsrs"] + [dependencies] async-trait = "0.1" thiserror = "1" @@ -38,4 +42,6 @@ serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" [features] -test = ["rand_core", "group", "serde", "serde_json"] +monero = [] +monero_test = ["rand_core", "group", "serde", "serde_json"] +test = ["monero_test"] diff --git a/coin/README.md b/coin/README.md new file mode 100644 index 00000000..7f055d5f --- /dev/null +++ b/coin/README.md @@ -0,0 +1,4 @@ +# Serai Coin + +An abstract interface representing a coin, along with implementations for +various coins. diff --git a/coin/src/lib.rs b/coin/src/lib.rs index bf19e388..0fa9c55d 100644 --- a/coin/src/lib.rs +++ b/coin/src/lib.rs @@ -8,7 +8,9 @@ use frost::{curve::Curve, FrostKeys, sign::PreprocessMachine}; pub(crate) mod utils; +#[cfg(feature = "monero")] pub mod monero; +#[cfg(feature = "monero")] pub use self::monero::Monero; #[derive(Clone, Error, Debug)] diff --git a/coins/ethereum/Cargo.toml b/coins/ethereum/Cargo.toml index 217b9f18..25ca79b0 100644 --- a/coins/ethereum/Cargo.toml +++ b/coins/ethereum/Cargo.toml @@ -3,8 +3,14 @@ name = "ethereum-serai" version = "0.1.0" description = "An Ethereum library supporting Schnorr signing and on-chain verification" license = "AGPL-3.0-only" +repository = "https://github.com/serai-dex/serai/tree/develop/coins/ethereum" authors = ["Luke Parker ", "Elizabeth Binks "] edition = "2021" +publish = false + +[package.metadata.docs.rs] +all-features = true +rustdoc-args = ["--cfg", "docsrs"] [dependencies] hex-literal = "0.3" @@ -24,8 +30,8 @@ eyre = "0.6" ethers = { version = "0.14", features = ["abigen", "ethers-solc"] } -[dev-dependencies] -tokio = { version = "1", features = ["macros"] } - [build-dependencies] ethers-solc = "0.14" + +[dev-dependencies] +tokio = { version = "1", features = ["macros"] } diff --git a/coins/monero/Cargo.toml b/coins/monero/Cargo.toml index 001de963..ccc1d5de 100644 --- a/coins/monero/Cargo.toml +++ b/coins/monero/Cargo.toml @@ -3,7 +3,7 @@ name = "monero-serai" version = "0.1.1-alpha" description = "A modern Monero transaction library" license = "MIT" -repository = "https://github.com/serai-dex/serai" +repository = "https://github.com/serai-dex/serai/tree/develop/coins/monero" authors = ["Luke Parker "] edition = "2021" @@ -48,12 +48,14 @@ monero-epee-bin-serde = "1.0" reqwest = { version = "0.11", features = ["json"] } -[features] -multisig = ["rand_chacha", "blake2", "transcript", "frost", "dleq"] - [build-dependencies] dalek-ff-group = { path = "../../crypto/dalek-ff-group", version = "0.1" } monero-generators = { path = "generators", version = "0.1" } [dev-dependencies] tokio = { version = "1", features = ["full"] } + +frost = { package = "modular-frost", path = "../../crypto/frost", version = "0.2", features = ["ed25519", "tests"] } + +[features] +multisig = ["rand_chacha", "blake2", "transcript", "frost", "dleq"] diff --git a/coins/monero/generators/Cargo.toml b/coins/monero/generators/Cargo.toml index 9e286dc9..0f626f17 100644 --- a/coins/monero/generators/Cargo.toml +++ b/coins/monero/generators/Cargo.toml @@ -3,7 +3,7 @@ name = "monero-generators" version = "0.1.1" description = "Monero's hash_to_point and generators" license = "MIT" -repository = "https://github.com/serai-dex/serai" +repository = "https://github.com/serai-dex/serai/tree/develop/coins/monero/generators" authors = ["Luke Parker "] edition = "2021" diff --git a/contracts/extension/Cargo.toml b/contracts/extension/Cargo.toml index 4d717cdf..9272659e 100644 --- a/contracts/extension/Cargo.toml +++ b/contracts/extension/Cargo.toml @@ -3,10 +3,15 @@ name = "serai-extension" version = "0.1.0" description = "An ink! extension for exposing Serai to ink" license = "AGPL-3.0-only" +repository = "https://github.com/serai-dex/serai/tree/develop/contracts/extension" authors = ["Luke Parker "] edition = "2021" publish = false +[package.metadata.docs.rs] +all-features = true +rustdoc-args = ["--cfg", "docsrs"] + [dependencies] scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } diff --git a/contracts/multisig/Cargo.toml b/contracts/multisig/Cargo.toml index 2b2e3565..6fb4d08b 100644 --- a/contracts/multisig/Cargo.toml +++ b/contracts/multisig/Cargo.toml @@ -3,10 +3,20 @@ name = "serai-multisig" version = "0.1.0" description = "An ink! tracker for Serai's current multisig" license = "AGPL-3.0-only" +repository = "https://github.com/serai-dex/serai/tree/develop/contracts/multisig" authors = ["Luke Parker "] edition = "2021" publish = false +[package.metadata.docs.rs] +all-features = true +rustdoc-args = ["--cfg", "docsrs"] + +[lib] +name = "serai_multisig" +path = "lib.rs" +crate-type = ["cdylib"] + [dependencies] scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2", default-features = false, features = ["derive"], optional = true } @@ -22,11 +32,6 @@ serai-extension = { path = "../extension", default-features = false } [dev-dependencies] lazy_static = "1" -[lib] -name = "serai_multisig" -path = "lib.rs" -crate-type = ["cdylib"] - [features] default = ["std"] std = [ diff --git a/crypto/dalek-ff-group/Cargo.toml b/crypto/dalek-ff-group/Cargo.toml index a1dd4720..df22f767 100644 --- a/crypto/dalek-ff-group/Cargo.toml +++ b/crypto/dalek-ff-group/Cargo.toml @@ -3,7 +3,7 @@ name = "dalek-ff-group" version = "0.1.5" description = "ff/group bindings around curve25519-dalek" license = "MIT" -repository = "https://github.com/serai-dex/serai" +repository = "https://github.com/serai-dex/serai/tree/develop/crypto/dalek-ff-group" authors = ["Luke Parker "] keywords = ["curve25519", "ed25519", "ristretto", "dalek", "group"] edition = "2021" diff --git a/crypto/dleq/Cargo.toml b/crypto/dleq/Cargo.toml index 4f66bf2e..99a0fa47 100644 --- a/crypto/dleq/Cargo.toml +++ b/crypto/dleq/Cargo.toml @@ -3,7 +3,7 @@ name = "dleq" version = "0.1.1" description = "Implementation of single and cross-curve Discrete Log Equality proofs" license = "MIT" -repository = "https://github.com/serai-dex/serai" +repository = "https://github.com/serai-dex/serai/tree/develop/crypto/dleq" authors = ["Luke Parker "] edition = "2021" diff --git a/crypto/ed448/Cargo.toml b/crypto/ed448/Cargo.toml index 95b25849..c7be3f75 100644 --- a/crypto/ed448/Cargo.toml +++ b/crypto/ed448/Cargo.toml @@ -3,7 +3,7 @@ name = "minimal-ed448" version = "0.1.1" description = "Unaudited, inefficient implementation of Ed448 in Rust" license = "MIT" -repository = "https://github.com/serai-dex/serai" +repository = "https://github.com/serai-dex/serai/tree/develop/crypto/ed448" authors = ["Luke Parker "] keywords = ["ed448", "ff", "group"] edition = "2021" diff --git a/crypto/frost/Cargo.toml b/crypto/frost/Cargo.toml index 52bb7d96..452ea429 100644 --- a/crypto/frost/Cargo.toml +++ b/crypto/frost/Cargo.toml @@ -3,7 +3,7 @@ name = "modular-frost" version = "0.2.4" description = "Modular implementation of FROST over ff/group" license = "MIT" -repository = "https://github.com/serai-dex/serai" +repository = "https://github.com/serai-dex/serai/tree/develop/crypto/frost" authors = ["Luke Parker "] keywords = ["frost", "multisig", "threshold"] edition = "2021" @@ -57,3 +57,5 @@ p256 = ["kp256", "dep:p256"] secp256k1 = ["kp256", "k256"] ed448 = ["sha3", "minimal-ed448"] + +tests = [] diff --git a/crypto/frost/src/lib.rs b/crypto/frost/src/lib.rs index 636f8315..7c6e3753 100644 --- a/crypto/frost/src/lib.rs +++ b/crypto/frost/src/lib.rs @@ -42,6 +42,7 @@ pub mod algorithm; pub mod sign; /// Tests for application-provided curves and algorithms. +#[cfg(any(test, feature = "tests"))] pub mod tests; // Validate a map of serialized values to have the expected included participants @@ -215,6 +216,7 @@ impl FrostCore { self.params } + #[cfg(any(test, feature = "tests"))] pub(crate) fn secret_share(&self) -> C::F { self.secret_share } diff --git a/crypto/frost/src/sign.rs b/crypto/frost/src/sign.rs index 4c19114e..a863a76a 100644 --- a/crypto/frost/src/sign.rs +++ b/crypto/frost/src/sign.rs @@ -431,6 +431,7 @@ impl> AlgorithmMachine { Ok(AlgorithmMachine { params: Params::new(algorithm, keys, included)? }) } + #[cfg(any(test, feature = "tests"))] pub(crate) fn unsafe_override_preprocess( self, preprocess: PreprocessPackage, diff --git a/crypto/frost/src/tests/vectors.rs b/crypto/frost/src/tests/vectors.rs index a1d4b3ee..747df6a1 100644 --- a/crypto/frost/src/tests/vectors.rs +++ b/crypto/frost/src/tests/vectors.rs @@ -35,7 +35,7 @@ pub struct Vectors { #[cfg(test)] impl From for Vectors { fn from(value: serde_json::Value) -> Vectors { - let to_str = |value: &serde_json::Value| dbg!(value).as_str().unwrap().to_string(); + let to_str = |value: &serde_json::Value| value.as_str().unwrap().to_string(); Vectors { threshold: u16::from_str(value["config"]["NUM_PARTICIPANTS"].as_str().unwrap()).unwrap(), diff --git a/crypto/multiexp/Cargo.toml b/crypto/multiexp/Cargo.toml index 1ef12d86..eb107626 100644 --- a/crypto/multiexp/Cargo.toml +++ b/crypto/multiexp/Cargo.toml @@ -3,7 +3,7 @@ name = "multiexp" version = "0.2.1" description = "Multiexponentation algorithms for ff/group" license = "MIT" -repository = "https://github.com/serai-dex/serai" +repository = "https://github.com/serai-dex/serai/tree/develop/crypto/multiexp" authors = ["Luke Parker "] keywords = ["multiexp", "ff", "group"] edition = "2021" diff --git a/crypto/transcript/Cargo.toml b/crypto/transcript/Cargo.toml index a31588a5..6cffcd94 100644 --- a/crypto/transcript/Cargo.toml +++ b/crypto/transcript/Cargo.toml @@ -3,7 +3,7 @@ name = "flexible-transcript" version = "0.1.3" description = "A simple transcript trait definition, along with viable options" license = "MIT" -repository = "https://github.com/serai-dex/serai" +repository = "https://github.com/serai-dex/serai/tree/develop/crypto/transcript" authors = ["Luke Parker "] keywords = ["transcript"] edition = "2021" diff --git a/processor/Cargo.toml b/processor/Cargo.toml index f11e39a6..2f01da0a 100644 --- a/processor/Cargo.toml +++ b/processor/Cargo.toml @@ -3,12 +3,16 @@ name = "serai-processor" version = "0.1.0" description = "Multichain processor premised on canonicity to reach distributed consensus automatically" license = "AGPL-3.0-only" -repository = "https://github.com/serai-dex/serai" +repository = "https://github.com/serai-dex/serai/tree/develop/processor" authors = ["Luke Parker "] keywords = [] edition = "2021" publish = false +[package.metadata.docs.rs] +all-features = true +rustdoc-args = ["--cfg", "docsrs"] + [dependencies] async-trait = "0.1" rand_core = "0.6" @@ -17,9 +21,9 @@ thiserror = "1" group = "0.12" transcript = { package = "flexible-transcript", path = "../crypto/transcript", features = ["recommended"] } -frost = { package = "modular-frost", path = "../crypto/frost", features = ["secp256k1", "ed25519"] } +frost = { package = "modular-frost", path = "../crypto/frost", features = ["ed25519"] } -serai-coin = { path = "../coin" } +serai-coin = { path = "../coin", features = ["monero"] } [dev-dependencies] hex = "0.4" @@ -27,4 +31,6 @@ hex = "0.4" futures = "0.3" tokio = { version = "1", features = ["full"] } -serai-coin = { path = "../coin", features = ["test"] } +frost = { package = "modular-frost", path = "../crypto/frost", features = ["ed25519", "tests"] } + +serai-coin = { path = "../coin", features = ["monero", "test"] } diff --git a/substrate/consensus/Cargo.toml b/substrate/consensus/Cargo.toml index 5296dcee..892b648e 100644 --- a/substrate/consensus/Cargo.toml +++ b/substrate/consensus/Cargo.toml @@ -3,10 +3,15 @@ name = "serai-consensus" version = "0.1.0" description = "Serai consensus module" license = "AGPL-3.0-only" +repository = "https://github.com/serai-dex/serai/tree/develop/substrate/consensus" authors = ["Luke Parker "] edition = "2021" publish = false +[package.metadata.docs.rs] +all-features = true +rustdoc-args = ["--cfg", "docsrs"] + [dependencies] sp-core = { git = "https://github.com/serai-dex/substrate" } sp-trie = { git = "https://github.com/serai-dex/substrate" } diff --git a/substrate/node/Cargo.toml b/substrate/node/Cargo.toml index cc0d2a09..f547281d 100644 --- a/substrate/node/Cargo.toml +++ b/substrate/node/Cargo.toml @@ -3,6 +3,7 @@ name = "serai-node" version = "0.1.0" description = "Serai network node, built over Substrate" license = "AGPL-3.0-only" +repository = "https://github.com/serai-dex/serai/tree/develop/substrate/node" authors = ["Luke Parker "] edition = "2021" publish = false diff --git a/substrate/runtime/Cargo.toml b/substrate/runtime/Cargo.toml index 1faeb370..507c6854 100644 --- a/substrate/runtime/Cargo.toml +++ b/substrate/runtime/Cargo.toml @@ -3,9 +3,13 @@ name = "serai-runtime" version = "0.1.0" description = "Serai network node runtime, built over Substrate" license = "AGPL-3.0-only" +repository = "https://github.com/serai-dex/serai/tree/develop/substrate/runtime" authors = ["Luke Parker "] edition = "2021" -publish = false + +[package.metadata.docs.rs] +all-features = true +rustdoc-args = ["--cfg", "docsrs"] [dependencies] hex-literal = { version = "0.3.4", optional = true }