Added trie tests, value tests

This commit is contained in:
obscuren
2014-02-15 13:21:11 +01:00
parent 5883446b21
commit 07c12f0b92
3 changed files with 103 additions and 3 deletions

View File

@ -60,6 +60,10 @@ func (val *Value) Uint() uint64 {
return uint64(Val)
} else if Val, ok := val.Val.(uint64); ok {
return Val
} else if Val, ok := val.Val.(int); ok {
return uint64(Val)
} else if Val, ok := val.Val.(uint); ok {
return uint64(Val)
} else if Val, ok := val.Val.([]byte); ok {
return ReadVarint(bytes.NewReader(Val))
}