I have the following raw transaction string.
0x02f901d4018201ad8459682f008520b1298f878301be0a94a7b6cb932eecacd956454317d59c49aa317e3c5780b90164ec9b1d600000000000000000000000000000000000000000000000000000000000000060010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000007ffd99995d591bb5131970bbb0659a1560e008a9cc468cf8d17fa2f180f819b1e5b167f17db9a3ee0e84d298e8b46418ac0ce8c12990f24d85b6f6425490bcb4e288bcd72afb37d4515f6fd0d7c1d05e420dcc9680e367f026b15bcd74c2ca6b610478214c998e663ab1670337cf349161ef9b01bc68ae7edf33bf947ffaf678288c886aeab8682c3bd3a079884a68fc57449bb19bb80efb8dfa7a0e2f8f5025400a78c632c2903f7870c797cf5f14a145251d77bf6f16a600734278a8b2305d3179bf94271c4b92233d9634c9ba5c134f6f0c630d83c7b8bba39af97398fb886c001a0cca7c55c810b62cfb0033ddf84122d0624c3ad1cc5d8a27acc280773d5065c08a045778ce52c22bf68d98f2cdd0dc86e9821a4903f2ac777785714d3700c065b0c
Trying to decode like so:
var tx *types.Transaction
rawtx, err := hex.DecodeString(rawString[2:])
if err != nil {
log.Fatal(err)
}
rlp.DecodeBytes(rawtx, &tx)
fmt.Println(tx)
However this fails:
rlp: expected List
I've noticed this only seems to happen for non legacy transactions.
Would someone be able to point me in the correct direction?