diff options
Diffstat (limited to 'rlp/decode_test.go')
-rw-r--r-- | rlp/decode_test.go | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/rlp/decode_test.go b/rlp/decode_test.go index d6b0611dd..408f1a5a9 100644 --- a/rlp/decode_test.go +++ b/rlp/decode_test.go @@ -24,6 +24,7 @@ import ( "io" "math/big" "reflect" + "strings" "testing" ) @@ -437,6 +438,11 @@ var decodeTests = []decodeTest{ error: "rlp: expected input string or byte for uint, decoding into (rlp.recstruct).Child.I", }, + // RawValue + {input: "01", ptr: new(RawValue), value: RawValue(unhex("01"))}, + {input: "82FFFF", ptr: new(RawValue), value: RawValue(unhex("82FFFF"))}, + {input: "C20102", ptr: new([]RawValue), value: []RawValue{unhex("01"), unhex("02")}}, + // pointers {input: "00", ptr: new(*[]byte), value: &[]byte{0}}, {input: "80", ptr: new(*uint), value: uintp(0)}, @@ -725,7 +731,7 @@ func encodeTestSlice(n uint) []byte { } func unhex(str string) []byte { - b, err := hex.DecodeString(str) + b, err := hex.DecodeString(strings.Replace(str, " ", "", -1)) if err != nil { panic(fmt.Sprintf("invalid hex string: %q", str)) } |