You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Deserializing a TxEnvelop produces a confusing error message: Error("data did not match any variant of untagged enum MaybeTaggedTxEnvelope", line: 0, column: 0) independently of the real error.
For example, this fails and there's no way to know why:
Did you get this JSON payload from a real RPC response? This transaction matches legacy transaction and for them we are expecting v as 27/28. If it's not the case for some endpoint, we can look into adapting this
we can def improve the error message by handrolling the deserde impl which would have the benefit of making this a lot more efficient, but would be a bit messy
I'm getting the same error on my base network provider with this code:
let block = provider.get_block_by_number(block_num, BlockTransactionsKind::Hashes).await?;
if let Some(block) = block {
let txs = block.transactions.as_hashes().unwrap();
for hash in txs {
let tx = provider.get_transaction_by_hash(*hash).await?;
println!("tx = {:#?}", tx)
}
Gives error:
Error: deserialization error: data did not match any variant of untagged enum MaybeTaggedTxEnvelope at line 1 column 888
Caused by:
data did not match any variant of untagged enum MaybeTaggedTxEnvelope at line 1 column 888
Component
serde
What version of Alloy are you on?
alloy v0.6.4
Operating System
Linux
Describe the bug
Deserializing a TxEnvelop produces a confusing error message:
Error("data did not match any variant of untagged enum MaybeTaggedTxEnvelope", line: 0, column: 0)
independently of the real error.For example, this fails and there's no way to know why:
I am not sure why, but the error disappears if you change from
"v": "0x1"
to"v": "0x1c"
.This test also fails because the hash length is 63 instead of 64, but the error reported makes it impossible to find it:
The text was updated successfully, but these errors were encountered: