added some missing validations
This commit is contained in:
@@ -50,7 +50,6 @@ func TestAdAddress(t *testing.T) {
|
||||
t.Errorf("address did not decode correctly")
|
||||
t.FailNow()
|
||||
}
|
||||
|
||||
if !ad.Key.Equals(crypto.DerivePub(pr)) {
|
||||
t.Errorf("public key did not decode correctly")
|
||||
t.FailNow()
|
||||
|
||||
@@ -53,6 +53,10 @@ func TestOnionSkins_IntroAd(t *testing.T) {
|
||||
t.Errorf("relay rate did not decode correctly")
|
||||
t.FailNow()
|
||||
}
|
||||
if !intro.Expiry.Equal(in.Expiry) {
|
||||
t.Errorf("expiry did not decode correctly")
|
||||
t.FailNow()
|
||||
}
|
||||
if intro.AddrPort.String() != in.AddrPort.String() {
|
||||
t.Errorf("addrport did not decode correctly")
|
||||
t.FailNow()
|
||||
|
||||
@@ -43,6 +43,14 @@ func TestPeerAd(t *testing.T) {
|
||||
if peer, ok = onc.(*PeerAd); !ok {
|
||||
t.Fatal("did not unwrap expected type")
|
||||
}
|
||||
if peer.ID != pa.ID {
|
||||
t.Errorf("ID did not decode correctly")
|
||||
t.FailNow()
|
||||
}
|
||||
if !peer.Key.Equals(crypto.DerivePub(pr)) {
|
||||
t.Errorf("public key did not decode correctly")
|
||||
t.FailNow()
|
||||
}
|
||||
if !peer.Validate() {
|
||||
t.Fatalf("received PeerAd did not validate")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user