rlp: add functions for encoding
I'm reasonably confident that the encoding matches the output of ethutil.Encode for values that it supports. Some of the tests have been adpated from the Ethereum testing repository. There are still TODOs in the code.
This commit is contained in:
@ -329,15 +329,9 @@ type field struct {
|
||||
}
|
||||
|
||||
func makeStructDecoder(typ reflect.Type) (decoder, error) {
|
||||
var fields []field
|
||||
for i := 0; i < typ.NumField(); i++ {
|
||||
if f := typ.Field(i); f.PkgPath == "" { // exported
|
||||
info, err := cachedTypeInfo1(f.Type)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
fields = append(fields, field{i, info})
|
||||
}
|
||||
fields, err := structFields(typ)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
dec := func(s *Stream, val reflect.Value) (err error) {
|
||||
if _, err = s.List(); err != nil {
|
||||
|
Reference in New Issue
Block a user