Skip to content

Commit

Permalink
Update to the latest runtime
Browse files Browse the repository at this point in the history
  • Loading branch information
osuketh committed Feb 28, 2019
1 parent 67c0a61 commit 957e658
Show file tree
Hide file tree
Showing 14 changed files with 278 additions and 376 deletions.
68 changes: 8 additions & 60 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

38 changes: 16 additions & 22 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "zero-chain"
version = "0.9.0"
authors = ["Parity Technologies <admin@parity.io>"]
authors = ["Osuke Sudo<dish230@gmail.com>"]
build = "build.rs"
edition = "2018"

Expand All @@ -14,39 +14,37 @@ error-chain = "0.12"
futures = "0.1"
ctrlc = { version = "3.0", features = ["termination"] }
log = "0.4"
tokio = "0.1.7"
tokio = "0.1"
exit-future = "0.1"
parking_lot = "0.4"
parking_lot = "0.7.1"
hex-literal = "0.1"
slog = "^2"
parity-codec = { version = "3.0" }
trie-root = { git = "https://github.com/paritytech/trie" }
parity-codec = "3.0"
trie-root = "0.11.0"
sr-io = { git = "https://github.com/paritytech/substrate" }
substrate-cli = { git = "https://github.com/paritytech/substrate" }
substrate-primitives = { git = "https://github.com/paritytech/substrate" }
primitives = { package = "substrate-primitives", git = "https://github.com/paritytech/substrate" }
substrate-executor = { git = "https://github.com/paritytech/substrate" }
substrate-service = { git = "https://github.com/paritytech/substrate" }
substrate-inherents = { git = "https://github.com/paritytech/substrate" }
substrate-transaction-pool = { git = "https://github.com/paritytech/substrate" }
substrate-network = { git = "https://github.com/paritytech/substrate" }
substrate-consensus-aura = { git = "https://github.com/paritytech/substrate" }
inherents = { package = "substrate-inherents", git = "https://github.com/paritytech/substrate" }
transaction-pool = { package = "substrate-transaction-pool", git = "https://github.com/paritytech/substrate" }
network = { package = "substrate-network", git = "https://github.com/paritytech/substrate" }
consensus = { package = "substrate-consensus-aura", git = "https://github.com/paritytech/substrate" }
substrate-client = { git = "https://github.com/paritytech/substrate", default-features = false }
substrate-basic-authorship = { git = "https://github.com/paritytech/substrate" }
basic-authorship = { package = "substrate-basic-authorship", git = "https://github.com/paritytech/substrate" }
node-executor = { git = "https://github.com/paritytech/substrate" }

bellman-verifier = { path = "bellman-verifier"}
zero-chain-demo = { path = "demo" }
zero-chain-crypto = { path = "crypto" }
demo = { package = "zero-chain-demo", path = "demo" }
zcrypto = { package = "zero-chain-crypto", path = "crypto" }
jubjub = { path = "jubjub" }
zero-chain-pairing = { path = "pairing" }
zero-chain-primitives = { path = "primitives" }
zpairing = { package = "zero-chain-pairing", path = "pairing" }
zprimitives = { package = "zero-chain-primitives", path = "primitives" }
proofs = { package = "zero-chain-proofs", path = "proofs" }
zero-chain-runtime = { path = "runtime" }

structopt = "0.2.13"

[build-dependencies]
vergen = "2"
vergen = "3"

[workspace]
members = [
Expand All @@ -60,7 +58,3 @@ members = [
"jubjub",
]
exclude = [ "runtime/wasm", ]

[profile.release]
# Substrate runtime requires unwinding.
panic = "unwind"
27 changes: 2 additions & 25 deletions build.rs
Original file line number Diff line number Diff line change
@@ -1,31 +1,8 @@
// Copyright 2015-2018 Parity Technologies (UK) Ltd.
// This file is part of Substrate.

// Substrate is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.

// Substrate is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.

// You should have received a copy of the GNU General Public License
// along with Substrate. If not, see <http://www.gnu.org/licenses/>.

extern crate vergen;

use vergen::{ConstantsFlags, Vergen};
use vergen::{ConstantsFlags, generate_cargo_keys};

const ERROR_MSG: &'static str = "Failed to generate metadata files";

fn main() {
let vergen = Vergen::new(ConstantsFlags::all()).expect(ERROR_MSG);

for (k, v) in vergen.build_info() {
println!("cargo:rustc-env={}={}", k.name(), v);
}

generate_cargo_keys(ConstantsFlags::all()).expect(ERROR_MSG);
println!("cargo:rerun-if-changed=.git/HEAD");
}
2 changes: 1 addition & 1 deletion init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ rustup target add wasm32-unknown-unknown --toolchain nightly

# Install wasm-gc. It's useful for stripping slimming down wasm binaries.
command -v wasm-gc || \
cargo +nightly install --git https://github.com/alexcrichton/wasm-gc --force
cargo +nightly install --git https://github.com/alexcrichton/wasm-gc --force
2 changes: 2 additions & 0 deletions primitives/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ rand = { version = "0.4", default-features = false }
fixed-hash = { version = "0.3.0", default-features = false }
lazy_static = "1"
substrate-primitives = { git = "https://github.com/paritytech/substrate", default-features = false }
runtime-primitives = { package = "sr-primitives", git = "https://github.com/paritytech/substrate", default-features = false }

[dependencies.blake2-rfc]
git = "https://github.com/gtank/blake2-rfc"
Expand All @@ -41,4 +42,5 @@ std = [
"blake2-rfc/std",
"fixed-hash/std",
"substrate-primitives/std",
"runtime-primitives/std"
]
19 changes: 19 additions & 0 deletions primitives/src/signature.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
use serde::{Serialize, Serializer, Deserialize, Deserializer};
use fixed_hash::construct_fixed_hash;
use jubjub::redjubjub;
use runtime_primitives::traits::{Verify, Lazy};
use crate::account_id::AccountId;
use jubjub::curve::FixedGenerators;
use pairing::bls12_381::Bls12;
use crate::JUBJUB;

#[cfg(feature = "std")]
use substrate_primitives::bytes;
Expand All @@ -14,6 +19,20 @@ construct_fixed_hash! {

pub type Signature = H512;

// impl Verify for Signature {
// type Signer = AccountId;
// fn verify<L: Lazy<[u8]>>(&self, mut msg: L, signer: &Self::Signer) -> bool {
// let sig = self.into_signature().unwrap();
// let p_g = FixedGenerators::SpendingKeyGenerator;

// match signer.into_payment_address() {
// Some(vk) => return vk.verify(msg, &sig, p_g, &JUBJUB),
// None => return false
// }

// }
// }

#[cfg(feature = "std")]
impl Serialize for H512 {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
Expand Down
Loading

0 comments on commit 957e658

Please sign in to comment.