aboutsummaryrefslogtreecommitdiffstats
path: root/rlp/decode_test.go
diff options
context:
space:
mode:
authorFelix Lange <fjl@twurst.com>2017-03-07 19:37:53 +0800
committerFelix Lange <fjl@twurst.com>2017-03-07 19:45:12 +0800
commiteee96a5bb7439ccee583d23e53be018fe7c35cfb (patch)
tree93e027d5c6456eb87b8d2e1e13977251bc500b2f /rlp/decode_test.go
parent667cd518ceada7084698c8ea11d966db9f9e674a (diff)
downloadgo-tangerine-eee96a5bb7439ccee583d23e53be018fe7c35cfb.tar.gz
go-tangerine-eee96a5bb7439ccee583d23e53be018fe7c35cfb.tar.zst
go-tangerine-eee96a5bb7439ccee583d23e53be018fe7c35cfb.zip
rlp: add support for "-" struct tag
Diffstat (limited to 'rlp/decode_test.go')
-rw-r--r--rlp/decode_test.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/rlp/decode_test.go b/rlp/decode_test.go
index 2d465b74d..d762e195d 100644
--- a/rlp/decode_test.go
+++ b/rlp/decode_test.go
@@ -339,6 +339,12 @@ var (
)
)
+type hasIgnoredField struct {
+ A uint
+ B uint `rlp:"-"`
+ C uint
+}
+
var decodeTests = []decodeTest{
// booleans
{input: "01", ptr: new(bool), value: true},
@@ -490,6 +496,13 @@ var decodeTests = []decodeTest{
value: tailRaw{A: 1, Tail: []RawValue{}},
},
+ // struct tag "-"
+ {
+ input: "C20102",
+ ptr: new(hasIgnoredField),
+ value: hasIgnoredField{A: 1, C: 2},
+ },
+
// RawValue
{input: "01", ptr: new(RawValue), value: RawValue(unhex("01"))},
{input: "82FFFF", ptr: new(RawValue), value: RawValue(unhex("82FFFF"))},