Align Block and State Field Names with Spec (#628)

This commit is contained in:
terence tsao
2018-10-09 19:34:50 -07:00
committed by GitHub
parent 3e8a450e0f
commit efeb6976d1
35 changed files with 800 additions and 651 deletions

View File

@@ -113,8 +113,8 @@ func (a *Attester) run(attester pb.AttesterServiceClient, validator pb.Validator
attestReq := &pb.AttestRequest{
Attestation: &pbp2p.AggregatedAttestation{
Slot: latestBeaconBlock.GetSlotNumber(),
ShardId: a.shardID,
Slot: latestBeaconBlock.GetSlot(),
Shard: a.shardID,
AttesterBitfield: attesterBitfield,
ShardBlockHash: latestBlockHash[:], // Is a stub for actual shard blockhash.
AggregateSig: []uint64{}, // TODO(258): Need Signature verification scheme/library

View File

@@ -98,7 +98,7 @@ func TestAttesterLoop(t *testing.T) {
att.run(mockServiceAttester, mockServiceValidator)
<-exitRoutine
}()
att.assignmentChan <- &pbp2p.BeaconBlock{SlotNumber: 33}
att.assignmentChan <- &pbp2p.BeaconBlock{Slot: 33}
att.cancel()
exitRoutine <- true
@@ -174,7 +174,7 @@ func TestAttesterErrorCantAttestHead(t *testing.T) {
<-exitRoutine
}()
att.assignmentChan <- &pbp2p.BeaconBlock{SlotNumber: 999}
att.assignmentChan <- &pbp2p.BeaconBlock{Slot: 999}
att.cancel()
exitRoutine <- true
@@ -208,7 +208,7 @@ func TestAttesterErrorCantGetShardID(t *testing.T) {
<-exitRoutine
}()
att.assignmentChan <- &pbp2p.BeaconBlock{SlotNumber: 999}
att.assignmentChan <- &pbp2p.BeaconBlock{Slot: 999}
att.cancel()
exitRoutine <- true
@@ -248,7 +248,7 @@ func TestAttesterErrorCantGetAttesterIndex(t *testing.T) {
<-exitRoutine
}()
att.assignmentChan <- &pbp2p.BeaconBlock{SlotNumber: 999}
att.assignmentChan <- &pbp2p.BeaconBlock{Slot: 999}
att.cancel()
exitRoutine <- true

View File

@@ -173,7 +173,7 @@ func (p *Proposer) run(done <-chan struct{}, client pb.ProposerServiceClient) {
req := &pb.ProposeRequest{
ParentHash: latestBlockHash[:],
// TODO(#511): Fix to be the actual, timebased slot number instead.
SlotNumber: latestBeaconBlock.GetSlotNumber() + 1,
SlotNumber: latestBeaconBlock.GetSlot() + 1,
RandaoReveal: []byte{},
AttestationBitmask: bitmask,
Timestamp: ptypes.TimestampNow(),

View File

@@ -129,7 +129,7 @@ func TestProposerReceiveBeaconBlock(t *testing.T) {
p.run(doneChan, mockServiceClient)
<-exitRoutine
}()
p.assignmentChan <- &pbp2p.BeaconBlock{SlotNumber: 5}
p.assignmentChan <- &pbp2p.BeaconBlock{Slot: 5}
doneChan <- struct{}{}
exitRoutine <- true
@@ -219,7 +219,7 @@ func TestFullProposalOfBlock(t *testing.T) {
attestation := &pbp2p.AggregatedAttestation{AttesterBitfield: []byte{'c'}}
p.attestationChan <- attestation
p.assignmentChan <- &pbp2p.BeaconBlock{SlotNumber: 5}
p.assignmentChan <- &pbp2p.BeaconBlock{Slot: 5}
doneChan <- struct{}{}
doneChan <- struct{}{}
@@ -265,7 +265,7 @@ func TestProposerServiceErrors(t *testing.T) {
p.attestationChan <- &pbp2p.AggregatedAttestation{}
p.assignmentChan <- nil
p.assignmentChan <- &pbp2p.BeaconBlock{SlotNumber: 9}
p.assignmentChan <- &pbp2p.BeaconBlock{Slot: 9}
doneChan <- struct{}{}
doneChan <- struct{}{}