Skip to content

RLP Tests

winsvega edited this page Jul 6, 2015 · 5 revisions

##RLP Test

Describes an rlp encoding using the .json file. The client should read the rlp byte stream, decode and check whether the contents match it's json representation. Then it should try do it reverse - encode json rlp representation into rlp byte stream and check whether it matches the given rlp byte stream.

If it is an invalid RLP byte stream in the test, then 'in' field would contain string 'INVALID'

Some RLP byte streams are expected to be generated by fuzz test suite. For those examples 'in' field would contain string 'VALID' as it means that rlp should be easily decoded.

RLP tests are located in in /RLPTest

###Basic structure

{  
   "rlpTest": {  
	"in": "dog", 
	"out": "83646f67"
   },

   "multilist": {
	"in": [ "zw", [ 4 ], 1 ], 
	"out": "c6827a77c10401"
   },

   "validRLP": {
	"in": "VALID",
	"out": "c7c0c1c0c3c0c1c0"
   },

   "invalidRLP": {
	"in": "INVALID",
	"out": "bf0f000000000000021111"
   },
   ...
}

###Sections

  • in - json representation of the rlp byte stream (*except values 'VALID' and 'INVALID')
  • out - rlp byte stream