reth_node_core::rpc::compat::transaction

Function from_primitive_signature

pub fn from_primitive_signature(
    signature: Signature,
    tx_type: TxType,
    chain_id: Option<u64>,
) -> Signature
Expand description

Creates a new rpc signature from a legacy primitive signature.

The tx type is used to determine whether or not to use the chain_id to compute the signature’s recovery id.

If the transaction is a legacy transaction, it will use the chain_id to compute the signature’s recovery id. If the transaction is a typed transaction, it will set the v value to 0 or 1 depending on the signature’s odd_y_parity.