From 5d3a5fb8df45be3688bb9b49224ea2dbcb1e8c52 Mon Sep 17 00:00:00 2001 From: caglarkaya Date: Wed, 16 Oct 2024 21:15:52 +0300 Subject: [PATCH] add signature function to TxDeposit --- .github/workflows/ci.yml | 2 +- crates/consensus/src/transaction/deposit.rs | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1174edc8..8e7407e8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -138,7 +138,7 @@ jobs: cache-on-failure: true - run: cargo +stable clippy --workspace --all-targets --all-features env: - RUSTFLAGS: -Dwarnings + RUSTFLAGS: -D warnings docs: runs-on: ubuntu-latest diff --git a/crates/consensus/src/transaction/deposit.rs b/crates/consensus/src/transaction/deposit.rs index fa3676b2..492dbeff 100644 --- a/crates/consensus/src/transaction/deposit.rs +++ b/crates/consensus/src/transaction/deposit.rs @@ -1,7 +1,7 @@ use super::OpTxType; use alloy_consensus::Transaction; use alloy_eips::eip2930::AccessList; -use alloy_primitives::{Address, Bytes, ChainId, TxKind, B256, U256}; +use alloy_primitives::{Address, Bytes, ChainId, Parity, Signature, TxKind, B256, U256}; use alloy_rlp::{ Buf, BufMut, Decodable, Encodable, Error as DecodeError, Header, EMPTY_STRING_CODE, }; @@ -152,6 +152,12 @@ impl TxDeposit { inner_payload_length } } + + /// Returns the signature for the optimism deposit transactions, which don't include a + /// signature. + pub fn signature() -> Signature { + Signature::new(U256::ZERO, U256::ZERO, Parity::Parity(false)) + } } impl Transaction for TxDeposit {