Add attester/proposer slashing endpoints (#856)

* Remove deprecated api_spec.yaml

* add prototype for proposer slashing

* remove clippy warnings

* Add proposer_slashing API

* Prototype for attester slashing API call

* Fix logic error in operation pool

* Finish test for attester_slashing api call

* Clean proposer_slashing test

* Cargo fmt

* Remove useless to_string after format! macro

* Cargo fmt

* Update book with new api calls

* Re-enable proposer slashing verification

* Update book with appropriate test example

* Fix proposer_slashing test

* Update comments and tests for clearer code

* Remove extraneous comments

* Fix test

* Minor fix

* Address reviewer comments

Co-authored-by: pscott <30843220+pscott@users.noreply.github.com>
This commit is contained in:
Pawan Dhananjay
2020-02-14 17:05:18 +05:30
committed by GitHub
parent 7a880dd23c
commit 74c34d1602
6 changed files with 627 additions and 180 deletions

View File

@@ -377,7 +377,7 @@ impl<T: EthSpec> TestingBeaconBlockBuilder<T> {
/// Builds an `ProposerSlashing` for some `validator_index`.
///
/// Signs the message using a `BeaconChainHarness`.
fn build_proposer_slashing<T: EthSpec>(
pub fn build_proposer_slashing<T: EthSpec>(
test_task: ProposerSlashingTestTask,
validator_index: u64,
secret_key: &SecretKey,
@@ -396,7 +396,7 @@ fn build_proposer_slashing<T: EthSpec>(
/// Builds an `AttesterSlashing` for some `validator_indices`.
///
/// Signs the message using a `BeaconChainHarness`.
fn build_double_vote_attester_slashing<T: EthSpec>(
pub fn build_double_vote_attester_slashing<T: EthSpec>(
test_task: AttesterSlashingTestTask,
validator_indices: &[u64],
secret_keys: &[&SecretKey],