mirror of
https://github.com/go-i2p/go-i2p.git
synced 2025-07-06 06:24:20 -04:00
fix and test router info signature size
This commit is contained in:
@ -196,7 +196,7 @@ func (router_info RouterInfo) Options() (mapping Mapping) {
|
|||||||
func (router_info RouterInfo) Signature() (signature Signature) {
|
func (router_info RouterInfo) Signature() (signature Signature) {
|
||||||
head := router_info.optionsLocation()
|
head := router_info.optionsLocation()
|
||||||
size := head + router_info.optionsSize()
|
size := head + router_info.optionsSize()
|
||||||
signature = Signature(router_info[head+size : head+size+40])
|
signature = Signature(router_info[size : size+40])
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -135,6 +135,12 @@ func TestOptionsAreCorrect(t *testing.T) {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestSignatureIsCorrectSize(t *testing.T) {}
|
func TestSignatureIsCorrectSize(t *testing.T) {
|
||||||
|
assert := assert.New(t)
|
||||||
|
|
||||||
|
router_info := buildFullRouterInfo()
|
||||||
|
signature := router_info.Signature()
|
||||||
|
assert.Equal(40, len(signature))
|
||||||
|
}
|
||||||
|
|
||||||
func TestRouterIdentityIsCorrect(t *testing.T) {}
|
func TestRouterIdentityIsCorrect(t *testing.T) {}
|
||||||
|
Reference in New Issue
Block a user