Skip to content

Commit

Permalink
fix v value
Browse files Browse the repository at this point in the history
  • Loading branch information
JayT106 committed Jun 21, 2024
1 parent 51297c4 commit 2ad4540
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion core/lib/eth_signer/src/g_kms_signer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,14 @@ impl EthereumSigner for GKMSSigner {
.await
.map_err(|e| SignerError::SigningFailed(e.to_string()))?;

let adjusted_v = signature.v + raw_tx.chain_id * 2 + 35; // eip155
let _adjust_v_value = matches!(tx.transaction_type.map(|t| t.as_u64()), Some(0) | None);

let mut adjusted_v = 0;
if _adjust_v_value {
adjusted_v = signature.v + raw_tx.chain_id * 2 + 35; // eip155
} else {
adjusted_v = signature.v;
}
let r_h256 = H256::from_slice(signature.r.as_byte_slice());
let s_h256 = H256::from_slice(signature.s.as_byte_slice());

Expand Down

0 comments on commit 2ad4540

Please sign in to comment.