Skip to content

Commit

Permalink
Merge pull request #612 from acoglio/rlp-quasi-encodings
Browse files Browse the repository at this point in the history
Add more RLP invalid tests for non-optimal lengths.
  • Loading branch information
winsvega committed Jul 22, 2019
2 parents 516c8cc + 16806bf commit 2f23783
Showing 1 changed file with 47 additions and 6 deletions.
53 changes: 47 additions & 6 deletions RLPTests/invalidRLPTest.json
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
{
"int32Overflow": {
"in": "INVALID",
"in": "INVALID",
"out": "0xbf0f000000000000021111"
},

"int32Overflow2": {
"in": "INVALID",
"in": "INVALID",
"out": "0xff0f000000000000021111"
},

"wrongSizeList": {
"in": "INVALID",
"in": "INVALID",
"out": "0xf80180"
},

"wrongSizeList2": {
"in": "INVALID",
"in": "INVALID",
"out": "0xf80100"
},

"incorrectLengthInArray": {
"in": "INVALID",
"in": "INVALID",
"out": "0xb9002100dc2b275d0f74e8a53e6f4ec61b27f24278820be3f82ea2110e582081b0565df0"
},

"randomRLP": {
"in": "INVALID",
"in": "INVALID",
"out": "0xf861f83eb9002100dc2b275d0f74e8a53e6f4ec61b27f24278820be3f82ea2110e582081b0565df027b90015002d5ef8325ae4d034df55d4b58d0dfba64d61ddd17be00000b9001a00dae30907045a2f66fa36f2bb8aa9029cbb0b8a7b3b5c435ab331"
},

Expand All @@ -42,5 +42,46 @@
"bytesShouldBeSingleByte7F": {
"in": "INVALID",
"out": "0x817F"
},

"leadingZerosInLongLengthArray1": {
"in": "INVALID",
"out": "b90040000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f"
},

"leadingZerosInLongLengthArray2": {
"in": "INVALID",
"out": "b800"
},

"leadingZerosInLongLengthList1": {
"in": "INVALID",
"out": "fb00000040000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f"
},

"leadingZerosInLongLengthList2": {
"in": "INVALID",
"out": "f800"
},

"nonOptimalLongLengthArray1": {
"in": "INVALID",
"out": "b81000112233445566778899aabbccddeeff"
},

"nonOptimalLongLengthArray2": {
"in": "INVALID",
"out": "b801ff"
},

"nonOptimalLongLengthList1": {
"in": "INVALID",
"out": "f810000102030405060708090a0b0c0d0e0f"
},

"nonOptimalLongLengthList2": {
"in": "INVALID",
"out": "f803112233"
}

}

0 comments on commit 2f23783

Please sign in to comment.