private void Decode() { var signedData = RLPDecoder.DecodeSigned(rlpSignedEncoded, numberOfEncodingElements); Data = signedData.Data; Signature = signedData.GetSignature(); }
public override Transaction1559 Decode(byte[] rplData) { if (rplData[0] == Type) { rplData = rplData.Skip(1).ToArray(); } var decodedList = RLP.RLP.Decode(rplData); var decodedData = new List <byte[]>(); var decodedElements = (RLPCollection)decodedList; var chainId = decodedElements[0].RLPData.ToBigIntegerFromRLPDecoded(); var nonce = decodedElements[1].RLPData.ToBigIntegerFromRLPDecoded(); var maxPriorityFeePerGas = decodedElements[2].RLPData.ToBigIntegerFromRLPDecoded(); var maxFeePerGas = decodedElements[3].RLPData.ToBigIntegerFromRLPDecoded(); var gasLimit = decodedElements[4].RLPData.ToBigIntegerFromRLPDecoded(); var receiverAddress = decodedElements[5].RLPData?.ToHex(true); var amount = decodedElements[6].RLPData.ToBigIntegerFromRLPDecoded(); var data = decodedElements[7].RLPData?.ToHex(true); var accessList = AccessListRLPEncoderDecoder.DecodeAccessList(decodedElements[8].RLPData); var signature = RLPDecoder.DecodeSignature(decodedElements, 9); return(new Transaction1559(chainId, nonce, maxPriorityFeePerGas, maxFeePerGas, gasLimit, receiverAddress, amount, data, accessList, signature)); }