Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add signature function to TxDeposit #174

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading