Merge remote-tracking branch 'origin/master' into spec-v0.12

This commit is contained in:
Michael Sproul
2020-06-26 12:08:46 +10:00
34 changed files with 196 additions and 227 deletions

View File

@@ -10,20 +10,8 @@ use tree_hash_derive::TreeHash;
///
/// Spec v0.12.1
#[cfg_attr(feature = "arbitrary-fuzz", derive(arbitrary::Arbitrary))]
#[derive(
Derivative,
Debug,
PartialEq,
Eq,
Clone,
Serialize,
Deserialize,
Encode,
Decode,
TreeHash,
TestRandom,
)]
#[derivative(Hash(bound = "T: EthSpec"))]
#[derive(Derivative, Debug, Clone, Serialize, Deserialize, Encode, Decode, TreeHash, TestRandom)]
#[derivative(PartialEq, Eq, Hash(bound = "T: EthSpec"))]
#[serde(bound = "T: EthSpec")]
pub struct AttesterSlashing<T: EthSpec> {
pub attestation_1: IndexedAttestation<T>,

View File

@@ -1,4 +1,5 @@
use crate::{test_utils::TestRandom, AggregateSignature, AttestationData, EthSpec, VariableList};
use derivative::Derivative;
use serde_derive::{Deserialize, Serialize};
use ssz::Encode;
use ssz_derive::{Decode, Encode};
@@ -12,9 +13,8 @@ use tree_hash_derive::TreeHash;
///
/// Spec v0.12.1
#[cfg_attr(feature = "arbitrary-fuzz", derive(arbitrary::Arbitrary))]
#[derive(
Debug, PartialEq, Eq, Clone, Serialize, Deserialize, Encode, Decode, TreeHash, TestRandom,
)]
#[derive(Derivative, Debug, Clone, Serialize, Deserialize, Encode, Decode, TreeHash, TestRandom)]
#[derivative(PartialEq, Eq)] // to satisfy Clippy's lint about `Hash`
#[serde(bound = "T: EthSpec")]
pub struct IndexedAttestation<T: EthSpec> {
/// Lists validator registry indices, not committee indices.

View File

@@ -47,11 +47,11 @@ impl TestingAttesterSlashingBuilder {
};
let data_2 = if test_task == AttesterSlashingTestTask::NotSlashable {
AttestationData { ..data_1.clone() }
data_1.clone()
} else {
AttestationData {
target: checkpoint_2,
..data_1.clone()
..data_1
}
};