Skip to content

Commit

Permalink
add signature function to TxDeposit
Browse files Browse the repository at this point in the history
  • Loading branch information
caglaryucekaya committed Oct 16, 2024
1 parent 20eb162 commit 5d3a5fb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 7 additions & 1 deletion crates/consensus/src/transaction/deposit.rs
Original file line number Diff line number Diff line change
@@ -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,
};
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 5d3a5fb

Please sign in to comment.