[Bug] TransactionRequest conversions erase contract creation and can_build disagrees with build_unsigned
- Langage dominant
- Rust
- Étoiles
- 1.3k
- Forks
- 668
- Merge moyen
- 2 j 1 h
- PR mergées (30 j)
- 29
Description
### Component
network, json-rpc, rpc
### What version of Alloy are you on?
Alloy v2.1.1 (bce5f50d63bb7d6d9a3b5b455a9a4508bf9dcdc4)
### Operating System
Windows
### Describe the bug
`TransactionRequest` conversions from concrete transaction types erase `TxKind::Create`.
For a valid legacy deployment, `TransactionRequest::from_transaction(deployment)` preserves `Some(TxKind::Create)` and rebuilds the original transaction. In contrast, both `TypedTransaction::Legacy(deployment).into()` and signed `TxEnvelope::Legacy(...).into()` produce `to == None`.
For each lossy request:
- `can_build() == true`;
- `complete_preferred() == Err(vec!["to"])`;
- `build_unsigned()` returns an error.
`Some(TxKind::Create)` is the public representation needed to distinguish deployments from incomplete requests with `to == None`: https://github.com/alloy-rs/alloy/pull/3704
Expected: concrete conversion paths preserve `Some(TxKind::Create)`; readiness and build APIs agree.
Actual: valid deployments become incomplete requests which report themselves buildable and then fail to build.
Guide de contribution
Ouvrir le guide de contribution
Piste de recherche
Trace TransactionRequest::from_transaction, TypedTransaction::Legacy(...).into(), and signed TxEnvelope::Legacy(...).into() first, then compare their handling of deployment transactions. Verify the affected requests preserve Some(TxKind::Create), while can_build(), complete_preferred(), and build_unsigned() consistently agree that the request is ready.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- rust
- Domaine
- api, blockchain
- Type d'issue
- Bug
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Activité
- Calme
- Clarté
- Plutôt claire
- Accessibilité débutants
- 55/100