Skip to content

Commit

Permalink
change error raised for invalid y_parity
Browse files Browse the repository at this point in the history
  • Loading branch information
obatirou committed Feb 13, 2025
1 parent 72bc5e0 commit be94cf6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cairo/ethereum/cancun/transactions.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ func recover_sender{
let y_parity = tx.value.access_list_transaction.value.y_parity;
let y_parity_is_zero = U256__eq__(y_parity, zero);
let y_parity_is_one = U256__eq__(y_parity, U256(new U256Struct(low=1, high=0)));
with_attr error_message("ValueError") {
with_attr error_message("InvalidSignatureError") {
assert (1 - y_parity_is_zero.value) * (1 - y_parity_is_one.value) = 0;
}
let hash = signing_hash_2930(tx.value.access_list_transaction);
Expand All @@ -312,7 +312,7 @@ func recover_sender{
let y_parity = tx.value.fee_market_transaction.value.y_parity;
let y_parity_is_zero = U256__eq__(y_parity, zero);
let y_parity_is_one = U256__eq__(y_parity, U256(new U256Struct(low=1, high=0)));
with_attr error_message("ValueError") {
with_attr error_message("InvalidSignatureError") {
assert (1 - y_parity_is_zero.value) * (1 - y_parity_is_one.value) = 0;
}

Expand All @@ -326,7 +326,7 @@ func recover_sender{
let y_parity = tx.value.blob_transaction.value.y_parity;
let y_parity_is_zero = U256__eq__(y_parity, zero);
let y_parity_is_one = U256__eq__(y_parity, U256(new U256Struct(low=1, high=0)));
with_attr error_message("ValueError") {
with_attr error_message("InvalidSignatureError") {
assert (1 - y_parity_is_zero.value) * (1 - y_parity_is_one.value) = 0;
}
let hash = signing_hash_4844(tx.value.blob_transaction);
Expand Down

0 comments on commit be94cf6

Please sign in to comment.