File tree 1 file changed +12
-2
lines changed
crates/anvil/src/eth/backend/mem
1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -2866,7 +2866,7 @@ pub fn transaction_build(
2866
2866
) -> AnyRpcTransaction {
2867
2867
if let TypedTransaction :: Deposit ( ref deposit_tx) = eth_transaction. transaction {
2868
2868
let DepositTransaction {
2869
- nonce : _ ,
2869
+ nonce,
2870
2870
source_hash,
2871
2871
from,
2872
2872
kind,
@@ -2892,7 +2892,17 @@ pub fn transaction_build(
2892
2892
let maybe_deposit_fields = OtherFields :: try_from ( ser) ;
2893
2893
2894
2894
match maybe_deposit_fields {
2895
- Ok ( fields) => {
2895
+ Ok ( mut fields) => {
2896
+ // Add zeroed signature fields for backwards compatibility
2897
+ // https://specs.optimism.io/protocol/deposits.html#the-deposited-transaction-type
2898
+ fields. insert ( "v" . to_string ( ) , serde_json:: to_value ( "0x0" ) . unwrap ( ) ) ;
2899
+ fields. insert ( "r" . to_string ( ) , serde_json:: to_value ( B256 :: ZERO ) . unwrap ( ) ) ;
2900
+ fields. insert ( String :: from ( "s" ) , serde_json:: to_value ( B256 :: ZERO ) . unwrap ( ) ) ;
2901
+ fields. insert (
2902
+ String :: from ( "nonce" ) ,
2903
+ serde_json:: to_value ( format ! ( "0x{nonce}" ) ) . unwrap ( ) ,
2904
+ ) ;
2905
+
2896
2906
let inner = UnknownTypedTransaction {
2897
2907
ty : AnyTxType ( DEPOSIT_TX_TYPE_ID ) ,
2898
2908
fields,
You can’t perform that action at this time.
0 commit comments