channeldb/addr_test: add tests for invalid onion addresses
This commit is contained in:
parent
6a3e1423d2
commit
8af2473644
@ -84,6 +84,30 @@ var addrTests = []struct {
|
|||||||
},
|
},
|
||||||
serErr: "unable to encode",
|
serErr: "unable to encode",
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
expAddr: &tor.OnionAddr{
|
||||||
|
// Invalid suffix.
|
||||||
|
OnionService: "vww6ybal4bd7szmgncyruucpgfkqahzddi37ktceo3ah7ngmcopnpyyd.inion",
|
||||||
|
Port: 80,
|
||||||
|
},
|
||||||
|
serErr: "invalid suffix",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
expAddr: &tor.OnionAddr{
|
||||||
|
// Invalid length.
|
||||||
|
OnionService: "vww6ybal4bd7szmgncyruucpgfkqahzddi37ktceo3ah7ngmcopnpyy.onion",
|
||||||
|
Port: 80,
|
||||||
|
},
|
||||||
|
serErr: "unknown onion service length",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
expAddr: &tor.OnionAddr{
|
||||||
|
// Invalid encoding.
|
||||||
|
OnionService: "vww6ybal4bd7szmgncyruucpgfkqahzddi37ktceo3ah7ngmcopnpyyA.onion",
|
||||||
|
Port: 80,
|
||||||
|
},
|
||||||
|
serErr: "illegal base32",
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
// TestAddrSerialization tests that the serialization method used by channeldb
|
// TestAddrSerialization tests that the serialization method used by channeldb
|
||||||
|
Loading…
Reference in New Issue
Block a user