Update ProposerSlashing to v0.5.0

This commit is contained in:
Paul Hauner 2019-03-15 15:59:04 +11:00
parent 15c3e5eab5
commit dc2755c4ea
No known key found for this signature in database
GPG Key ID: D362883A9218FCC6
3 changed files with 14 additions and 14 deletions

View File

@ -1,6 +1,6 @@
use crate::test_utils::TestRandom;
use crate::*;
use bls::{Keypair, PublicKey, Signature};
use bls::{PublicKey, Signature};
use rand::RngCore;
use serde_derive::{Deserialize, Serialize};
use ssz::{SignedRoot, TreeHash};

View File

@ -1,4 +1,4 @@
use super::Proposal;
use super::BeaconBlockHeader;
use crate::test_utils::TestRandom;
use rand::RngCore;
use serde_derive::{Deserialize, Serialize};
@ -7,12 +7,12 @@ use test_random_derive::TestRandom;
/// Two conflicting proposals from the same proposer (validator).
///
/// Spec v0.4.0
/// Spec v0.5.0
#[derive(Debug, PartialEq, Clone, Serialize, Deserialize, Encode, Decode, TreeHash, TestRandom)]
pub struct ProposerSlashing {
pub proposer_index: u64,
pub proposal_1: Proposal,
pub proposal_2: Proposal,
pub proposal_1: BeaconBlockHeader,
pub proposal_2: BeaconBlockHeader,
}
#[cfg(test)]

View File

@ -22,20 +22,20 @@ impl TestingProposerSlashingBuilder {
F: Fn(u64, &[u8], Epoch, Domain) -> Signature,
{
let slot = Slot::new(0);
let shard = 0;
let hash_1 = Hash256::from([1; 32]);
let hash_2 = Hash256::from([2; 32]);
let mut proposal_1 = Proposal {
let mut proposal_1 = BeaconBlockHeader {
slot,
shard,
block_root: Hash256::from_low_u64_le(1),
previous_block_root: hash_1,
state_root: hash_1,
block_body_root: hash_1,
signature: Signature::empty_signature(),
};
let mut proposal_2 = Proposal {
slot,
shard,
block_root: Hash256::from_low_u64_le(2),
signature: Signature::empty_signature(),
let mut proposal_2 = BeaconBlockHeader {
previous_block_root: hash_2,
..proposal_1.clone()
};
proposal_1.signature = {