Esempio n. 1
0
func NewRoundMeasure(node *sign.Node, firstRound int) *RoundMeasure {
	dbg.Lvlf3("Making new roundmeasure %+v", node)
	round := &RoundMeasure{}
	round.RoundStamperListener = conode.NewRoundStamperListener(node)
	round.Type = RoundMeasureType
	round.firstRound = firstRound
	return round
}
Esempio n. 2
0
func TestStampListener(t *testing.T) {
	dbg.TestOutput(testing.Verbose(), 4)
	peer1, peer2 := createPeers()

	round1 := conode.NewRoundStamperListener(peer1.Node)
	round2, err := sign.NewRoundFromType(conode.RoundStamperListenerType, peer1.Node)

	if err != nil {
		dbg.Fatal("Error when creating round:", err)
	}

	dbg.Lvlf2("Round1: %+v", round1)
	dbg.Lvlf2("Round2: %+v", round2)
	name1, name2 := round1.Name, round2.(*conode.RoundStamperListener).Name
	if name1 != name2 {
		t.Fatal("Hostname of first round is", name1, "and should be equal to", name2)
	}
	peer1.Close()
	peer2.Close()
}
Esempio n. 3
0
func NewRoundStats(node *sign.Node) *RoundStats {
	round := &RoundStats{}
	round.RoundStamperListener = conode.NewRoundStamperListener(node)
	return round
}