-
Notifications
You must be signed in to change notification settings - Fork 993
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add new crate "namada_core" for core types, storage_api, tx_env, vp_env
- Loading branch information
1 parent
8929369
commit b36c8a6
Showing
86 changed files
with
1,126 additions
and
902 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ resolver = "2" | |
|
||
members = [ | ||
"apps", | ||
"core", | ||
"proof_of_stake", | ||
"shared", | ||
"tests", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
[package] | ||
authors = ["Heliax AG <[email protected]>"] | ||
edition = "2021" | ||
license = "GPL-3.0" | ||
name = "namada_core" | ||
resolver = "2" | ||
version = "0.9.0" | ||
|
||
[features] | ||
default = [] | ||
ferveo-tpke = [ | ||
"ferveo", | ||
"tpke", | ||
"ark-ec", | ||
"rand_core", | ||
"rand", | ||
] | ||
# for integration tests and test utilies | ||
testing = [ | ||
"rand", | ||
"rand_core", | ||
] | ||
|
||
[dependencies] | ||
ark-ec = {version = "0.3", optional = true} | ||
# We switch off "blake2b" because it cannot be compiled to wasm | ||
# branch = "bat/arse-merkle-tree" | ||
arse-merkle-tree = {package = "sparse-merkle-tree", git = "https://github.com/heliaxdev/sparse-merkle-tree", rev = "04ad1eeb28901b57a7599bbe433b3822965dabe8", default-features = false, features = ["std", "borsh"]} | ||
bech32 = "0.8.0" | ||
borsh = "0.9.0" | ||
chrono = {version = "0.4.22", default-features = false, features = ["clock", "std"]} | ||
data-encoding = "2.3.2" | ||
derivative = "2.2.0" | ||
ed25519-consensus = "1.2.0" | ||
ferveo = {optional = true, git = "https://github.com/anoma/ferveo"} | ||
tpke = {package = "group-threshold-cryptography", optional = true, git = "https://github.com/anoma/ferveo"} | ||
ics23 = "0.7.0" | ||
itertools = "0.10.0" | ||
libsecp256k1 = {git = "https://github.com/heliaxdev/libsecp256k1", rev = "bbb3bd44a49db361f21d9db80f9a087c194c0ae9", default-features = false, features = ["std", "static-context"]} | ||
rand = {version = "0.8", optional = true} | ||
rand_core = {version = "0.6", optional = true} | ||
rust_decimal = "1.26.1" | ||
serde = {version = "1.0.125", features = ["derive"]} | ||
serde_json = "1.0.62" | ||
sha2 = "0.9.3" | ||
thiserror = "1.0.30" | ||
tracing = "0.1.30" | ||
zeroize = {version = "1.5.5", features = ["zeroize_derive"]} | ||
|
||
[dev-dependencies] | ||
assert_matches = "1.5.0" | ||
libsecp256k1 = {git = "https://github.com/heliaxdev/libsecp256k1", rev = "bbb3bd44a49db361f21d9db80f9a087c194c0ae9"} | ||
pretty_assertions = "0.7.2" | ||
# A fork with state machine testing | ||
proptest = {git = "https://github.com/heliaxdev/proptest", branch = "tomas/sm"} | ||
rand = {version = "0.8"} | ||
rand_core = {version = "0.6"} | ||
test-log = {version = "0.2.7", default-features = false, features = ["trace"]} | ||
tracing-subscriber = {version = "0.3.7", default-features = false, features = ["env-filter", "fmt"]} | ||
|
||
[build-dependencies] | ||
tonic-build = "0.6.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
use std::fs::read_to_string; | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
tzemanovic
Author
Member
|
||
use std::process::Command; | ||
use std::{env, str}; | ||
|
||
/// Path to the .proto source files, relative to `core` directory | ||
const PROTO_SRC: &str = "./proto"; | ||
|
||
/// The version should match the one we use in the `Makefile` | ||
const RUSTFMT_TOOLCHAIN_SRC: &str = "../rust-nightly-version"; | ||
|
||
fn main() { | ||
if let Ok(val) = env::var("COMPILE_PROTO") { | ||
if val.to_ascii_lowercase() == "false" { | ||
// Skip compiling proto files | ||
return; | ||
} | ||
} | ||
|
||
// Tell Cargo that if the given file changes, to rerun this build script. | ||
println!("cargo:rerun-if-changed={}", PROTO_SRC); | ||
|
||
let mut use_rustfmt = false; | ||
|
||
// The version should match the one we use in the `Makefile` | ||
if let Ok(rustfmt_toolchain) = read_to_string(RUSTFMT_TOOLCHAIN_SRC) { | ||
// Try to find the path to rustfmt. | ||
if let Ok(output) = Command::new("rustup") | ||
.args(&[ | ||
"which", | ||
"rustfmt", | ||
"--toolchain", | ||
rustfmt_toolchain.trim(), | ||
]) | ||
.output() | ||
{ | ||
if let Ok(rustfmt) = str::from_utf8(&output.stdout) { | ||
// Set the command to be used by tonic_build below to format the | ||
// generated files | ||
let rustfmt = rustfmt.trim(); | ||
if !rustfmt.is_empty() { | ||
println!("using rustfmt from path \"{}\"", rustfmt); | ||
env::set_var("RUSTFMT", rustfmt); | ||
use_rustfmt = true | ||
} | ||
} | ||
} | ||
} | ||
|
||
tonic_build::configure() | ||
.out_dir("src/proto/generated") | ||
.format(use_rustfmt) | ||
.protoc_arg("--experimental_allow_proto3_optional") | ||
.compile(&[format!("{}/types.proto", PROTO_SRC)], &[PROTO_SRC]) | ||
.unwrap(); | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
//! Governance library code | ||
/// governance parameters | ||
pub mod parameters; | ||
/// governance storage | ||
pub mod storage; |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
pub mod actions; | ||
pub mod storage; |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
//! The ledger modules | ||
pub mod gas; | ||
pub mod governance; | ||
#[cfg(feature = "ibc-rs")] | ||
pub mod ibc; | ||
pub mod parameters; | ||
pub mod storage; | ||
pub mod storage_api; | ||
pub mod tx_env; | ||
pub mod vp_env; |
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
//! The core public types, storage_api, VpEnv and TxEnv. | ||
#![doc(html_favicon_url = "https://dev.anoma.net/master/favicon.png")] | ||
#![doc(html_logo_url = "https://dev.anoma.net/master/rustdoc-logo.png")] | ||
#![warn(missing_docs)] | ||
#![deny(rustdoc::broken_intra_doc_links)] | ||
#![deny(rustdoc::private_intra_doc_links)] | ||
|
||
pub mod bytes; | ||
pub mod ledger; | ||
pub mod types; |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.
this should be moved from
shared/build.rs