Merge pull request #127 from drozdziak1/122-rust-2018

2018-ify everything
This commit is contained in:
Paul Hauner 2018-12-21 15:26:39 +11:00 committed by GitHub
commit 2c04d343e9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
26 changed files with 49 additions and 30 deletions

View File

@ -2,6 +2,7 @@
name = "lighthouse" name = "lighthouse"
version = "0.0.1" version = "0.0.1"
authors = ["Paul Hauner <paul@paulhauner.com>"] authors = ["Paul Hauner <paul@paulhauner.com>"]
edition = "2018"
[dependencies] [dependencies]
blake2-rfc = "0.2.18" blake2-rfc = "0.2.18"

View File

@ -2,6 +2,7 @@
name = "attestation_validation" name = "attestation_validation"
version = "0.1.0" version = "0.1.0"
authors = ["Paul Hauner <paul@paulhauner.com>"] authors = ["Paul Hauner <paul@paulhauner.com>"]
edition = "2018"
[dependencies] [dependencies]
bls = { path = "../utils/bls" } bls = { path = "../utils/bls" }

View File

@ -15,9 +15,9 @@ mod justified_slot;
mod shard_block; mod shard_block;
mod signature; mod signature;
pub use enums::{Invalid, Outcome, Error}; pub use crate::enums::{Invalid, Outcome, Error};
pub use block_inclusion::validate_attestation_for_block; pub use crate::block_inclusion::validate_attestation_for_block;
pub use justified_slot::validate_attestation_justified_slot; pub use crate::justified_slot::validate_attestation_justified_slot;
pub use justified_block::validate_attestation_justified_block_hash; pub use crate::justified_block::validate_attestation_justified_block_hash;
pub use signature::validate_attestation_signature; pub use crate::signature::validate_attestation_signature;
pub use shard_block::validate_attestation_data_shard_block_hash; pub use crate::shard_block::validate_attestation_data_shard_block_hash;

View File

@ -2,6 +2,7 @@
name = "chain" name = "chain"
version = "0.1.0" version = "0.1.0"
authors = ["Paul Hauner <paul@paulhauner.com>"] authors = ["Paul Hauner <paul@paulhauner.com>"]
edition = "2018"
[dependencies] [dependencies]
bls = { path = "../utils/bls" } bls = { path = "../utils/bls" }

View File

@ -14,11 +14,11 @@ mod stores;
mod transition; mod transition;
use db::ClientDB; use db::ClientDB;
use genesis::{genesis_states, Error as GenesisError}; use crate::genesis::{genesis_states, Error as GenesisError};
use maps::{generate_attester_and_proposer_maps, AttesterAndProposerMapError}; use crate::maps::{generate_attester_and_proposer_maps, AttesterAndProposerMapError};
use std::collections::HashMap; use std::collections::HashMap;
use std::sync::Arc; use std::sync::Arc;
use stores::BeaconChainStore; use crate::stores::BeaconChainStore;
use types::{ActiveState, AttesterMap, ChainConfig, CrystallizedState, Hash256, ProposerMap}; use types::{ActiveState, AttesterMap, ChainConfig, CrystallizedState, Hash256, ProposerMap};
#[derive(Debug, PartialEq)] #[derive(Debug, PartialEq)]

View File

@ -2,6 +2,7 @@
name = "naive_fork_choice" name = "naive_fork_choice"
version = "0.1.0" version = "0.1.0"
authors = ["Paul Hauner <paul@paulhauner.com>"] authors = ["Paul Hauner <paul@paulhauner.com>"]
edition = "2018"
[dependencies] [dependencies]
db = { path = "../../lighthouse/db" } db = { path = "../../lighthouse/db" }

View File

@ -2,6 +2,7 @@
name = "spec" name = "spec"
version = "0.1.0" version = "0.1.0"
authors = ["Paul Hauner <paul@paulhauner.com>"] authors = ["Paul Hauner <paul@paulhauner.com>"]
edition = "2018"
[dependencies] [dependencies]
types = { path = "../types" } types = { path = "../types" }

View File

@ -2,6 +2,7 @@
name = "state-transition" name = "state-transition"
version = "0.1.0" version = "0.1.0"
authors = ["Paul Hauner <paul@paulhauner.com>"] authors = ["Paul Hauner <paul@paulhauner.com>"]
edition = "2018"
[dependencies] [dependencies]
types = { path = "../types" } types = { path = "../types" }

View File

@ -2,6 +2,7 @@
name = "types" name = "types"
version = "0.1.0" version = "0.1.0"
authors = ["Paul Hauner <paul@paulhauner.com>"] authors = ["Paul Hauner <paul@paulhauner.com>"]
edition = "2018"
[dependencies] [dependencies]
bls = { path = "../utils/bls" } bls = { path = "../utils/bls" }

View File

@ -23,20 +23,20 @@ pub mod validator_registration;
use self::ethereum_types::{H160, H256, U256}; use self::ethereum_types::{H160, H256, U256};
use std::collections::HashMap; use std::collections::HashMap;
pub use active_state::ActiveState; pub use crate::active_state::ActiveState;
pub use attestation_data::AttestationData; pub use crate::attestation_data::AttestationData;
pub use attestation::Attestation; pub use crate::attestation::Attestation;
pub use beacon_block::BeaconBlock; pub use crate::beacon_block::BeaconBlock;
pub use beacon_state::BeaconState; pub use crate::beacon_state::BeaconState;
pub use chain_config::ChainConfig; pub use crate::chain_config::ChainConfig;
pub use crosslink_record::CrosslinkRecord; pub use crate::crosslink_record::CrosslinkRecord;
pub use crystallized_state::CrystallizedState; pub use crate::crystallized_state::CrystallizedState;
pub use fork_data::ForkData; pub use crate::fork_data::ForkData;
pub use pending_attestation_record::PendingAttestationRecord; pub use crate::pending_attestation_record::PendingAttestationRecord;
pub use shard_and_committee::ShardAndCommittee; pub use crate::shard_and_committee::ShardAndCommittee;
pub use special_record::{SpecialRecord, SpecialRecordKind}; pub use crate::special_record::{SpecialRecord, SpecialRecordKind};
pub use validator_record::{ValidatorRecord, ValidatorStatus}; pub use crate::validator_record::{ValidatorRecord, ValidatorStatus};
pub use validator_registration::ValidatorRegistration; pub use crate::validator_registration::ValidatorRegistration;
pub type Hash256 = H256; pub type Hash256 = H256;
pub type Address = H160; pub type Address = H160;

View File

@ -2,6 +2,7 @@
name = "bls" name = "bls"
version = "0.1.0" version = "0.1.0"
authors = ["Paul Hauner <paul@paulhauner.com>"] authors = ["Paul Hauner <paul@paulhauner.com>"]
edition = "2018"
[dependencies] [dependencies]
bls-aggregates = { git = "https://github.com/sigp/signature-schemes" } bls-aggregates = { git = "https://github.com/sigp/signature-schemes" }

View File

@ -2,7 +2,8 @@
name = "boolean-bitfield" name = "boolean-bitfield"
version = "0.1.0" version = "0.1.0"
authors = ["Paul Hauner <paul@paulhauner.com>"] authors = ["Paul Hauner <paul@paulhauner.com>"]
edition = "2018"
[dependencies] [dependencies]
ssz = { path = "../ssz" } ssz = { path = "../ssz" }
bit-vec = "0.5.0" bit-vec = "0.5.0"

View File

@ -2,6 +2,7 @@
name = "hashing" name = "hashing"
version = "0.1.0" version = "0.1.0"
authors = ["Paul Hauner <paul@paulhauner.com>"] authors = ["Paul Hauner <paul@paulhauner.com>"]
edition = "2018"
[dependencies] [dependencies]
tiny-keccak = "1.4.2" tiny-keccak = "1.4.2"

View File

@ -2,5 +2,6 @@
name = "honey-badger-split" name = "honey-badger-split"
version = "0.1.0" version = "0.1.0"
authors = ["Paul Hauner <paul@paulhauner.com>"] authors = ["Paul Hauner <paul@paulhauner.com>"]
edition = "2018"
[dependencies] [dependencies]

View File

@ -2,5 +2,6 @@
name = "slot-clock" name = "slot-clock"
version = "0.1.0" version = "0.1.0"
authors = ["Paul Hauner <paul@paulhauner.com>"] authors = ["Paul Hauner <paul@paulhauner.com>"]
edition = "2018"
[dependencies] [dependencies]

View File

@ -2,6 +2,7 @@
name = "ssz" name = "ssz"
version = "0.1.0" version = "0.1.0"
authors = ["Paul Hauner <paul@paulhauner.com>"] authors = ["Paul Hauner <paul@paulhauner.com>"]
edition = "2018"
[dependencies] [dependencies]
bytes = "0.4.9" bytes = "0.4.9"

View File

@ -16,8 +16,8 @@ pub mod encode;
mod impl_decode; mod impl_decode;
mod impl_encode; mod impl_encode;
pub use decode::{decode_ssz, decode_ssz_list, Decodable, DecodeError}; pub use crate::decode::{decode_ssz, decode_ssz_list, Decodable, DecodeError};
pub use encode::{Encodable, SszStream}; pub use crate::encode::{Encodable, SszStream};
pub const LENGTH_BYTES: usize = 4; pub const LENGTH_BYTES: usize = 4;
pub const MAX_LIST_SIZE: usize = 1 << (4 * 8); pub const MAX_LIST_SIZE: usize = 1 << (4 * 8);

View File

@ -2,6 +2,7 @@
name = "ssz_helpers" name = "ssz_helpers"
version = "0.1.0" version = "0.1.0"
authors = ["Paul Hauner <paul@paulhauner.com>"] authors = ["Paul Hauner <paul@paulhauner.com>"]
edition = "2018"
[dependencies] [dependencies]
bls = { path = "../bls" } bls = { path = "../bls" }

View File

@ -2,6 +2,7 @@
name = "vec_shuffle" name = "vec_shuffle"
version = "0.1.0" version = "0.1.0"
authors = ["Paul Hauner <paul@paulhauner.com>"] authors = ["Paul Hauner <paul@paulhauner.com>"]
edition = "2018"
[dependencies] [dependencies]
hashing = { path = "../hashing" } hashing = { path = "../hashing" }

View File

@ -2,6 +2,7 @@
name = "validator_change" name = "validator_change"
version = "0.1.0" version = "0.1.0"
authors = ["Paul Hauner <paul@paulhauner.com>"] authors = ["Paul Hauner <paul@paulhauner.com>"]
edition = "2018"
[dependencies] [dependencies]
bytes = "0.4.10" bytes = "0.4.10"

View File

@ -2,6 +2,7 @@
name = "validator_induction" name = "validator_induction"
version = "0.1.0" version = "0.1.0"
authors = ["Paul Hauner <paul@paulhauner.com>"] authors = ["Paul Hauner <paul@paulhauner.com>"]
edition = "2018"
[dependencies] [dependencies]
bls = { path = "../utils/bls" } bls = { path = "../utils/bls" }

View File

@ -4,4 +4,4 @@ extern crate types;
mod inductor; mod inductor;
pub use inductor::{ValidatorInductionError, ValidatorInductor}; pub use crate::inductor::{ValidatorInductionError, ValidatorInductor};

View File

@ -2,6 +2,7 @@
name = "validator_shuffling" name = "validator_shuffling"
version = "0.1.0" version = "0.1.0"
authors = ["Paul Hauner <paul@paulhauner.com>"] authors = ["Paul Hauner <paul@paulhauner.com>"]
edition = "2018"
[dependencies] [dependencies]
honey-badger-split = { path = "../utils/honey-badger-split" } honey-badger-split = { path = "../utils/honey-badger-split" }

View File

@ -4,4 +4,4 @@ extern crate vec_shuffle;
mod shuffle; mod shuffle;
pub use shuffle::{shard_and_committees_for_cycle, ValidatorAssignmentError}; pub use crate::shuffle::{shard_and_committees_for_cycle, ValidatorAssignmentError};

View File

@ -2,6 +2,7 @@
name = "db" name = "db"
version = "0.1.0" version = "0.1.0"
authors = ["Paul Hauner <paul@paulhauner.com>"] authors = ["Paul Hauner <paul@paulhauner.com>"]
edition = "2018"
[dependencies] [dependencies]
blake2-rfc = "0.2.18" blake2-rfc = "0.2.18"

View File

@ -13,7 +13,7 @@ mod config;
use std::path::PathBuf; use std::path::PathBuf;
use clap::{App, Arg}; use clap::{App, Arg};
use config::LighthouseConfig; use crate::config::LighthouseConfig;
use slog::Drain; use slog::Drain;
fn main() { fn main() {