mirror of
https://gitlab.com/pulsechaincom/lighthouse-pulse.git
synced 2024-12-28 14:57:17 +00:00
Make attester/proposer slashing builders test-only
They didn't do anything useful or safe for production.
This commit is contained in:
parent
9057b436f3
commit
dc221f3220
@ -9,9 +9,7 @@ use ssz::SignedRoot;
|
||||
use std::path::Path;
|
||||
use types::*;
|
||||
|
||||
use types::{
|
||||
attester_slashing::AttesterSlashingBuilder, proposer_slashing::ProposerSlashingBuilder,
|
||||
};
|
||||
use types::test_utils::{TestingAttesterSlashingBuilder, TestingProposerSlashingBuilder};
|
||||
use yaml_rust::Yaml;
|
||||
|
||||
mod config;
|
||||
@ -331,7 +329,7 @@ fn build_double_vote_attester_slashing(
|
||||
.expect("Unable to sign AttesterSlashing")
|
||||
};
|
||||
|
||||
AttesterSlashingBuilder::double_vote(validator_indices, signer)
|
||||
TestingAttesterSlashingBuilder::double_vote(validator_indices, signer)
|
||||
}
|
||||
|
||||
/// Builds an `ProposerSlashing` for some `validator_index`.
|
||||
@ -344,5 +342,5 @@ fn build_proposer_slashing(harness: &BeaconChainHarness, validator_index: u64) -
|
||||
.expect("Unable to sign AttesterSlashing")
|
||||
};
|
||||
|
||||
ProposerSlashingBuilder::double_vote(validator_index, signer, &harness.spec)
|
||||
TestingProposerSlashingBuilder::double_vote(validator_index, signer, &harness.spec)
|
||||
}
|
||||
|
@ -4,10 +4,6 @@ use serde_derive::Serialize;
|
||||
use ssz_derive::{Decode, Encode, TreeHash};
|
||||
use test_random_derive::TestRandom;
|
||||
|
||||
mod builder;
|
||||
|
||||
pub use builder::AttesterSlashingBuilder;
|
||||
|
||||
/// Two conflicting attestations.
|
||||
///
|
||||
/// Spec v0.4.0
|
||||
|
@ -5,10 +5,6 @@ use serde_derive::Serialize;
|
||||
use ssz_derive::{Decode, Encode, TreeHash};
|
||||
use test_random_derive::TestRandom;
|
||||
|
||||
mod builder;
|
||||
|
||||
pub use builder::ProposerSlashingBuilder;
|
||||
|
||||
/// Two conflicting proposals from the same proposer (validator).
|
||||
///
|
||||
/// Spec v0.4.0
|
||||
|
@ -2,9 +2,11 @@ mod generate_deterministic_keypairs;
|
||||
mod keypairs_file;
|
||||
mod test_random;
|
||||
mod testing_attestation_builder;
|
||||
mod testing_attester_slashing_builder;
|
||||
mod testing_beacon_block_builder;
|
||||
mod testing_beacon_state_builder;
|
||||
mod testing_deposit_builder;
|
||||
mod testing_proposer_slashing_builder;
|
||||
mod testing_transfer_builder;
|
||||
mod testing_voluntary_exit_builder;
|
||||
|
||||
@ -13,8 +15,10 @@ pub use keypairs_file::KeypairsFile;
|
||||
pub use rand::{prng::XorShiftRng, SeedableRng};
|
||||
pub use test_random::TestRandom;
|
||||
pub use testing_attestation_builder::TestingAttestationBuilder;
|
||||
pub use testing_attester_slashing_builder::TestingAttesterSlashingBuilder;
|
||||
pub use testing_beacon_block_builder::TestingBeaconBlockBuilder;
|
||||
pub use testing_beacon_state_builder::{keypairs_path, TestingBeaconStateBuilder};
|
||||
pub use testing_deposit_builder::TestingDepositBuilder;
|
||||
pub use testing_proposer_slashing_builder::TestingProposerSlashingBuilder;
|
||||
pub use testing_transfer_builder::TestingTransferBuilder;
|
||||
pub use testing_voluntary_exit_builder::TestingVoluntaryExitBuilder;
|
||||
|
@ -2,9 +2,9 @@ use crate::*;
|
||||
use ssz::TreeHash;
|
||||
|
||||
/// Builds an `AttesterSlashing`.
|
||||
pub struct AttesterSlashingBuilder();
|
||||
pub struct TestingAttesterSlashingBuilder();
|
||||
|
||||
impl AttesterSlashingBuilder {
|
||||
impl TestingAttesterSlashingBuilder {
|
||||
/// Builds an `AttesterSlashing` that is a double vote.
|
||||
///
|
||||
/// The `signer` function is used to sign the double-vote and accepts:
|
@ -1,9 +1,7 @@
|
||||
use crate::{
|
||||
attester_slashing::AttesterSlashingBuilder,
|
||||
proposer_slashing::ProposerSlashingBuilder,
|
||||
test_utils::{
|
||||
TestingAttestationBuilder, TestingDepositBuilder, TestingTransferBuilder,
|
||||
TestingVoluntaryExitBuilder,
|
||||
TestingAttestationBuilder, TestingAttesterSlashingBuilder, TestingDepositBuilder,
|
||||
TestingProposerSlashingBuilder, TestingTransferBuilder, TestingVoluntaryExitBuilder,
|
||||
},
|
||||
*,
|
||||
};
|
||||
@ -232,7 +230,7 @@ fn build_proposer_slashing(
|
||||
Signature::new(message, domain, secret_key)
|
||||
};
|
||||
|
||||
ProposerSlashingBuilder::double_vote(validator_index, signer, spec)
|
||||
TestingProposerSlashingBuilder::double_vote(validator_index, signer, spec)
|
||||
}
|
||||
|
||||
/// Builds an `AttesterSlashing` for some `validator_indices`.
|
||||
@ -253,5 +251,5 @@ fn build_double_vote_attester_slashing(
|
||||
Signature::new(message, domain, secret_keys[key_index])
|
||||
};
|
||||
|
||||
AttesterSlashingBuilder::double_vote(validator_indices, signer)
|
||||
TestingAttesterSlashingBuilder::double_vote(validator_indices, signer)
|
||||
}
|
||||
|
@ -2,9 +2,9 @@ use crate::*;
|
||||
use ssz::SignedRoot;
|
||||
|
||||
/// Builds a `ProposerSlashing`.
|
||||
pub struct ProposerSlashingBuilder();
|
||||
pub struct TestingProposerSlashingBuilder();
|
||||
|
||||
impl ProposerSlashingBuilder {
|
||||
impl TestingProposerSlashingBuilder {
|
||||
/// Builds a `ProposerSlashing` that is a double vote.
|
||||
///
|
||||
/// The `signer` function is used to sign the double-vote and accepts:
|
Loading…
Reference in New Issue
Block a user