ChainSafe / ChainSafe/EthereumRPCSharp
EncodeList not working correctly
- Dominant language
- C#
- Stars
- 3
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Description
**Context**
I'm trying to test that if a encode a list of values, I get the expected decoded value.
**Problem**
This is what I'm trying to achieve:
```
List byteArrayList = new List();
byte[] byte1 = HexByteConvertorExtensions.HexToByteArray("0x");
byte[] byte2 = HexByteConvertorExtensions.HexToByteArray("0x");
byte[] byte3 = HexByteConvertorExtensions.HexToByteArray("0x");
byteArrayList.Add(byte1);
byteArrayList.Add(byte2);
byteArrayList.Add(byte3);
byte[] expectedEncoded2 = HexByteConvertorExtensions.HexToByteArray("0xc3808080");
byte[] encoded = RLP.EncodeList(byteArrayList.ToArray());
// Assert
Assert.AreEqual(expectedEncoded2, encoded);
```
I send a list to encode and then I expect that the result is the expected one. For assertions I'm using the test data that ethersjs uses for their RLP tests (https://github.com/ethers-io/ethers.js/blob/main/src.ts/_tests/test-rlp.ts), for example:

**Additional context**
I have this problem only with **EncodeList** method, because the method **EncodeElement** is working as expected.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.