Skip to content

Commit

Permalink
docs: update docs on parity (#477)
Browse files Browse the repository at this point in the history
  • Loading branch information
DaniPopes authored Jan 5, 2024
1 parent d6f12eb commit da03a5f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions crates/primitives/src/signature/parity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,16 +93,17 @@ impl Parity {
}
}

/// Converts an EIP-155 V value to a non-EIP-155 V value. This is a nop for
/// non-EIP-155 values.
/// Converts an EIP-155 V value to a non-EIP-155 V value.
///
/// This is a nop for non-EIP-155 values.
pub const fn strip_chain_id(&self) -> Self {
match *self {
Self::Eip155(v) => Self::NonEip155(v % 2 == 1),
this => this,
}
}

/// Applies EIP 155 to the V value.
/// Applies EIP-155 with the given chain ID.
pub const fn with_chain_id(self, chain_id: ChainId) -> Self {
let parity = match self {
Self::Eip155(v) => normalize_v_to_byte(v) == 1,
Expand Down

0 comments on commit da03a5f

Please sign in to comment.