Quick fix on a pseudocode typo (#1106)

This commit is contained in:
terence tsao 2018-12-14 16:34:28 -08:00 committed by GitHub
parent 53749c49d0
commit 5c7539e2a1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View File

@ -13,8 +13,8 @@ import (
// included in the chain during the epoch.
//
// Spec pseudocode definition:
// this_epoch_attestations = [a for a in state.latest_attestations
// if state.slot - EPOCH_LENGTH <= a.data.slot < state.slot]
// [a for a in state.latest_attestations if state.slot - EPOCH_LENGTH <=
// a.data.slot < state.slot]
func Attestations(state *pb.BeaconState) []*pb.PendingAttestationRecord {
epochLength := params.BeaconConfig().EpochLength
var thisEpochAttestations []*pb.PendingAttestationRecord
@ -42,7 +42,7 @@ func Attestations(state *pb.BeaconState) []*pb.PendingAttestationRecord {
// Spec pseudocode definition:
// [a for a in this_epoch_attestations if a.data.epoch_boundary_root ==
// get_block_root(state, state.slot-EPOCH_LENGTH) and a.justified_slot ==
// if state.slot - EPOCH_LENGTH <= a.data.slot < state.slot]
// state.justified_slot]
func BoundaryAttestations(
state *pb.BeaconState,
thisEpochAttestations []*pb.PendingAttestationRecord,

View File

@ -10,7 +10,7 @@ import (
func TestEpochAttestations_ok(t *testing.T) {
if params.BeaconConfig().EpochLength != 64 {
t.Fatalf("EpochLength should be 64 for these tests to pass")
t.Errorf("EpochLength should be 64 for these tests to pass")
}
var pendingAttestations []*pb.PendingAttestationRecord
@ -63,7 +63,7 @@ func TestEpochAttestations_ok(t *testing.T) {
func TestEpochBoundaryAttestations(t *testing.T) {
if params.BeaconConfig().EpochLength != 64 {
t.Fatalf("EpochLength should be 64 for these tests to pass")
t.Errorf("EpochLength should be 64 for these tests to pass")
}
epochAttestations := []*pb.PendingAttestationRecord{