Commit Graph

8 Commits

Author SHA1 Message Date
Felix Lange
a829a56587 rlp: add Stream.Raw 2015-03-21 00:49:31 +01:00
Felix Lange
965c9babe3 rlp: fix encoding of one element strings and byte slices
The encoder was missing a special case for one element strings whose
element is below 0x7f. Such strings must be encoded as a single byte
without a string header.
2015-03-19 12:15:43 +01:00
Felix Lange
cb009a5c4d rlp: don't panic for nil *big.Int
All other pointer types can handle nil just fine.
2015-03-17 23:49:49 +01:00
obscuren
76fa75b394 wip 2015-02-13 15:35:54 +01:00
Felix Lange
b94f85de22 rlp: add Flat 2015-02-11 19:28:56 +01:00
Felix Lange
8c3095faf0 rlp: fix encoding of arrays with byte element type 2015-02-06 00:00:36 +01:00
Felix Lange
fc92abec2c rlp: allow encoding non-empty interface values
This needs to be supported because []someInterface does occur sometimes.

Funny enough, the fix involves changes to the decoder. makeDecoder
cannot return an error for non-empty interfaces anymore because the type
cache builds both decoder and writer. Do the check at 'runtime' instead.
2015-01-15 23:35:26 +01:00
Felix Lange
552f5b2693 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.
2015-01-15 11:00:19 +01:00