temp fix for enabling travis

pull/5/head
Richard Liu 7 years ago
parent 1e513669e3
commit 7bd78e56a2
  1. 2
      aws-code/dial.go
  2. 2
      aws-code/listen.go
  3. 6
      consensus/consensus_leader.go
  4. 10
      consensus/consensus_validator.go

@ -6,7 +6,7 @@ import (
"net" "net"
) )
func main() { func dialMain() { // TODO: temp fix to unblock test
conn, err := net.Dial("tcp", ":9000") conn, err := net.Dial("tcp", ":9000")
if err != nil { if err != nil {
panic(err) panic(err)

@ -7,7 +7,7 @@ import (
"time" "time"
) )
func main() { func listenMain() { // TODO: temp fix to unblock test
ln, err := net.Listen("tcp", "localhost:9000") ln, err := net.Listen("tcp", "localhost:9000")
if err != nil { if err != nil {
panic(err) panic(err)

@ -39,17 +39,17 @@ func (consensus *Consensus) ProcessMessageLeader(message []byte) {
log.Printf("[Leader] Received and processing message: %s\n", msgType) log.Printf("[Leader] Received and processing message: %s\n", msgType)
switch msgType { switch msgType {
case ANNOUNCE: case ANNOUNCE:
log.Println("Unexpected message type: %s", msgType) log.Printf("Unexpected message type: %s", msgType)
case COMMIT: case COMMIT:
consensus.processCommitMessage(payload) consensus.processCommitMessage(payload)
case CHALLENGE: case CHALLENGE:
log.Println("Unexpected message type: %s", msgType) log.Printf("Unexpected message type: %s", msgType)
case RESPONSE: case RESPONSE:
consensus.processResponseMessage(payload) consensus.processResponseMessage(payload)
case START_CONSENSUS: case START_CONSENSUS:
consensus.processStartConsensusMessage(payload) consensus.processStartConsensusMessage(payload)
default: default:
log.Println("Unexpected message type: %s", msgType) log.Printf("Unexpected message type: %s", msgType)
} }
} }

@ -1,10 +1,10 @@
package consensus package consensus
import ( import (
"harmony-benchmark/p2p"
"log"
"bytes" "bytes"
"encoding/binary" "encoding/binary"
"harmony-benchmark/p2p"
"log"
) )
// Validator's consensus message dispatcher // Validator's consensus message dispatcher
@ -24,13 +24,13 @@ func (consensus *Consensus) ProcessMessageValidator(message []byte) {
case ANNOUNCE: case ANNOUNCE:
consensus.processAnnounceMessage(payload) consensus.processAnnounceMessage(payload)
case COMMIT: case COMMIT:
log.Println("Unexpected message type: %s", msgType) log.Printf("Unexpected message type: %s", msgType)
case CHALLENGE: case CHALLENGE:
consensus.processChallengeMessage(payload) consensus.processChallengeMessage(payload)
case RESPONSE: case RESPONSE:
log.Println("Unexpected message type: %s", msgType) log.Printf("Unexpected message type: %s", msgType)
default: default:
log.Println("Unexpected message type: %s", msgType) log.Printf("Unexpected message type: %s", msgType)
} }
} }

Loading…
Cancel
Save