fix and test router info signature size

This commit is contained in:
Hayden Parker
2016-07-02 18:07:11 -07:00
parent c12a16109c
commit b4728abdee
2 changed files with 8 additions and 2 deletions

View File

@ -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
} }

View File

@ -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) {}