mirror of
https://github.com/sigp/lighthouse.git
synced 2026-05-09 03:17:55 +00:00
Merge spec into types crate.
Also remove some pre-2018 `extern crate` calls.
This commit is contained in:
@@ -6,7 +6,6 @@ edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
bls = { path = "../utils/bls" }
|
||||
spec = { path = "../spec" }
|
||||
ssz = { path = "../utils/ssz" }
|
||||
types = { path = "../types" }
|
||||
validator_induction = { path = "../validator_induction" }
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
use spec::ChainSpec;
|
||||
use types::{BeaconBlock, BeaconBlockBody, Eth1Data, Hash256};
|
||||
use types::{BeaconBlock, BeaconBlockBody, ChainSpec, Eth1Data, Hash256};
|
||||
|
||||
/// Generate a genesis BeaconBlock.
|
||||
pub fn genesis_beacon_block(state_root: Hash256, spec: &ChainSpec) -> BeaconBlock {
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
use spec::ChainSpec;
|
||||
use types::{BeaconState, Crosslink, Fork};
|
||||
use types::{BeaconState, ChainSpec, Crosslink, Fork};
|
||||
use validator_shuffling::{shard_and_committees_for_cycle, ValidatorAssignmentError};
|
||||
|
||||
#[derive(Debug, PartialEq)]
|
||||
|
||||
@@ -1,8 +1,3 @@
|
||||
extern crate spec;
|
||||
extern crate types;
|
||||
extern crate validator_induction;
|
||||
extern crate validator_shuffling;
|
||||
|
||||
mod beacon_block;
|
||||
mod beacon_state;
|
||||
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
[package]
|
||||
name = "spec"
|
||||
version = "0.1.0"
|
||||
authors = ["Paul Hauner <paul@paulhauner.com>"]
|
||||
edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
bls = { path = "../utils/bls" }
|
||||
types = { path = "../types" }
|
||||
@@ -25,6 +25,7 @@ pub mod proposer_slashing;
|
||||
pub mod shard_committee;
|
||||
pub mod shard_reassignment_record;
|
||||
pub mod slashable_vote_data;
|
||||
pub mod spec;
|
||||
pub mod special_record;
|
||||
pub mod validator;
|
||||
pub mod validator_registry;
|
||||
@@ -54,6 +55,7 @@ pub use crate::proposal_signed_data::ProposalSignedData;
|
||||
pub use crate::proposer_slashing::ProposerSlashing;
|
||||
pub use crate::shard_committee::ShardCommittee;
|
||||
pub use crate::slashable_vote_data::SlashableVoteData;
|
||||
pub use crate::spec::ChainSpec;
|
||||
pub use crate::special_record::{SpecialRecord, SpecialRecordKind};
|
||||
pub use crate::validator::{StatusFlags as ValidatorStatusFlags, Validator};
|
||||
pub use crate::validator_registry_delta_block::ValidatorRegistryDeltaBlock;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
use super::ChainSpec;
|
||||
use bls::{Keypair, PublicKey, SecretKey, Signature};
|
||||
|
||||
use types::{Address, Eth1Data, Hash256, Validator};
|
||||
use crate::{Address, Eth1Data, Hash256, Validator};
|
||||
|
||||
/// The size of a validators deposit in GWei.
|
||||
pub const DEPOSIT_GWEI: u64 = 32_000_000_000;
|
||||
@@ -1,10 +1,7 @@
|
||||
extern crate bls;
|
||||
extern crate types;
|
||||
|
||||
mod foundation;
|
||||
|
||||
use crate::{Address, Eth1Data, Hash256, Validator};
|
||||
use bls::Signature;
|
||||
use types::{Address, Eth1Data, Hash256, Validator};
|
||||
|
||||
#[derive(PartialEq, Debug)]
|
||||
pub struct ChainSpec {
|
||||
@@ -8,4 +8,3 @@ edition = "2018"
|
||||
bls = { path = "../utils/bls" }
|
||||
hashing = { path = "../utils/hashing" }
|
||||
types = { path = "../types" }
|
||||
spec = { path = "../spec" }
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
use bls::verify_proof_of_possession;
|
||||
use spec::ChainSpec;
|
||||
use types::{BeaconState, Deposit, Validator};
|
||||
use types::{BeaconState, ChainSpec, Deposit, Validator};
|
||||
|
||||
#[derive(Debug, PartialEq, Clone)]
|
||||
pub enum ValidatorInductionError {
|
||||
|
||||
@@ -1,8 +1,3 @@
|
||||
extern crate bls;
|
||||
extern crate hashing;
|
||||
extern crate spec;
|
||||
extern crate types;
|
||||
|
||||
mod inductor;
|
||||
|
||||
pub use crate::inductor::{process_deposit, ValidatorInductionError};
|
||||
|
||||
@@ -6,6 +6,5 @@ edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
honey-badger-split = { path = "../utils/honey-badger-split" }
|
||||
spec = { path = "../spec" }
|
||||
types = { path = "../types" }
|
||||
vec_shuffle = { path = "../utils/vec_shuffle" }
|
||||
|
||||
@@ -1,8 +1,3 @@
|
||||
extern crate honey_badger_split;
|
||||
extern crate spec;
|
||||
extern crate types;
|
||||
extern crate vec_shuffle;
|
||||
|
||||
mod shuffle;
|
||||
|
||||
pub use crate::shuffle::{shard_and_committees_for_cycle, ValidatorAssignmentError};
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
use std::cmp::min;
|
||||
|
||||
use honey_badger_split::SplitExt;
|
||||
use spec::ChainSpec;
|
||||
use types::validator_registry::get_active_validator_indices;
|
||||
use types::{validator_registry::get_active_validator_indices, ChainSpec};
|
||||
use types::{ShardCommittee, Validator};
|
||||
use vec_shuffle::{shuffle, ShuffleErr};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user