Skip to content

Commit

Permalink
Merge pull request #952 from FactomProject/FD-1772_pokemon_reporting
Browse files Browse the repository at this point in the history
Fix some nil hash usages that were bogus.
  • Loading branch information
Matt York authored Jan 9, 2020
2 parents fb77419 + c312f86 commit bd09f18
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 27 deletions.
1 change: 0 additions & 1 deletion common/messages/electionMsgs/addLeaderInternal.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ type AddLeaderInternal struct {
ServerID interfaces.IHash // Hash of message acknowledged
DBHeight uint32 // Directory Block Height that owns this ack
Height uint32 // Height of this ack in this process list
// MessageHash interfaces.IHash
}

var _ interfaces.IMsg = (*AddLeaderInternal)(nil)
Expand Down
13 changes: 6 additions & 7 deletions common/messages/electionMsgs/eomSigInternal.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,11 @@ import (
//General acknowledge message
type EomSigInternal struct {
msgbase.MessageBase
NName string
SigType bool // True of EOM, False if DBSig
ServerID interfaces.IHash // Hash of message acknowledged
DBHeight uint32 // Directory Block Height that owns this ack
Height uint32 // Height of this ack in this process list
MessageHash interfaces.IHash
NName string
SigType bool // True of EOM, False if DBSig
ServerID interfaces.IHash // Hash of message acknowledged
DBHeight uint32 // Directory Block Height that owns this ack
Height uint32 // Height of this ack in this process list
}

var _ interfaces.IMsg = (*EomSigInternal)(nil)
Expand Down Expand Up @@ -239,7 +238,7 @@ func (m *EomSigInternal) GetRepeatHash() (rval interfaces.IHash) {
func (m *EomSigInternal) GetHash() (rval interfaces.IHash) {
defer func() { rval = primitives.CheckNil(rval, "EomSigInternal.GetHash") }()

return m.MessageHash
return m.GetMsgHash()
}

func (m *EomSigInternal) GetTimestamp() interfaces.Timestamp {
Expand Down
2 changes: 0 additions & 2 deletions common/messages/electionMsgs/fedVotePropose.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ type FedVoteProposalMsg struct {
Volunteer FedVoteVolunteerMsg

Signature interfaces.IFullSignature

messageHash interfaces.IHash
}

var _ interfaces.IMsg = (*FedVoteVolunteerMsg)(nil)
Expand Down
11 changes: 5 additions & 6 deletions common/messages/electionMsgs/removeAuditInternal.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,10 @@ import (
//General acknowledge message
type RemoveAuditInternal struct {
msgbase.MessageBase
NName string
ServerID interfaces.IHash // Hash of message acknowledged
DBHeight uint32 // Directory Block Height that owns this ack
Height uint32 // Height of this ack in this process list
MessageHash interfaces.IHash
NName string
ServerID interfaces.IHash // Hash of message acknowledged
DBHeight uint32 // Directory Block Height that owns this ack
Height uint32 // Height of this ack in this process list
}

var _ interfaces.IMsg = (*RemoveAuditInternal)(nil)
Expand Down Expand Up @@ -102,7 +101,7 @@ func (m *RemoveAuditInternal) GetRepeatHash() (rval interfaces.IHash) {
func (m *RemoveAuditInternal) GetHash() (rval interfaces.IHash) {
defer func() { rval = primitives.CheckNil(rval, "RemoveAuditInternal.GetHash") }()

return m.MessageHash
return m.GetMsgHash()
}

func (m *RemoveAuditInternal) GetTimestamp() interfaces.Timestamp {
Expand Down
12 changes: 6 additions & 6 deletions common/messages/electionMsgs/removeLeaderInternal.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,10 @@ import (
//General acknowledge message
type RemoveLeaderInternal struct {
msgbase.MessageBase
NName string
ServerID interfaces.IHash // Hash of message acknowledged
DBHeight uint32 // Directory Block Height that owns this ack
Height uint32 // Height of this ack in this process list
MessageHash interfaces.IHash
NName string
ServerID interfaces.IHash // Hash of message acknowledged
DBHeight uint32 // Directory Block Height that owns this ack
Height uint32 // Height of this ack in this process list
}

var _ interfaces.IMsg = (*RemoveLeaderInternal)(nil)
Expand Down Expand Up @@ -103,7 +102,8 @@ func (m *RemoveLeaderInternal) GetRepeatHash() (rval interfaces.IHash) {
func (m *RemoveLeaderInternal) GetHash() (rval interfaces.IHash) {
defer func() { rval = primitives.CheckNil(rval, "RemoveLeaderInternal.GetHash") }()

return m.MessageHash
return m.GetMsgHash()

}

func (m *RemoveLeaderInternal) GetTimestamp() interfaces.Timestamp {
Expand Down
9 changes: 4 additions & 5 deletions common/messages/electionMsgs/timeoutInternal.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,9 @@ var _ = state.MakeMap
//General acknowledge message
type TimeoutInternal struct {
msgbase.MessageBase
Name string
SigType bool // True for EOM, false for DBSig
DBHeight int
MessageHash interfaces.IHash
Name string
SigType bool // True for EOM, false for DBSig
DBHeight int
}

var _ interfaces.IMsg = (*TimeoutInternal)(nil)
Expand Down Expand Up @@ -261,7 +260,7 @@ func (m *TimeoutInternal) GetRepeatHash() (rval interfaces.IHash) {
func (m *TimeoutInternal) GetHash() (rval interfaces.IHash) {
defer func() { rval = primitives.CheckNil(rval, "TimeoutInternal.GetHash") }()

return m.MessageHash
return m.GetMsgHash()
}

func (m *TimeoutInternal) GetTimestamp() interfaces.Timestamp {
Expand Down

0 comments on commit bd09f18

Please sign in to comment.