diff options
author | Jeffrey Wilcke <jeffrey@ethereum.org> | 2015-09-11 03:02:16 +0800 |
---|---|---|
committer | Jeffrey Wilcke <jeffrey@ethereum.org> | 2015-09-11 03:02:16 +0800 |
commit | 62bbf8a09e7304611f57fb7eea92911cf52e6229 (patch) | |
tree | 28df8021441aedf31fa76646e81b024e0cf9d099 /rlp/decode_test.go | |
parent | 90f1fe0ed2399f90f01c09e61e244121ef7d148a (diff) | |
parent | fc8b246109760714a838f4be163cca1dbb998163 (diff) | |
download | dexon-62bbf8a09e7304611f57fb7eea92911cf52e6229.tar dexon-62bbf8a09e7304611f57fb7eea92911cf52e6229.tar.gz dexon-62bbf8a09e7304611f57fb7eea92911cf52e6229.tar.bz2 dexon-62bbf8a09e7304611f57fb7eea92911cf52e6229.tar.lz dexon-62bbf8a09e7304611f57fb7eea92911cf52e6229.tar.xz dexon-62bbf8a09e7304611f57fb7eea92911cf52e6229.tar.zst dexon-62bbf8a09e7304611f57fb7eea92911cf52e6229.zip |
Merge pull request #1778 from fjl/rlp-trie-changes
rlp: precursor changes for trie, p2p
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)) } |