mirror of
https://github.com/paradigmxyz/reth.git
synced 2026-02-17 10:22:32 -05:00
fix(evm): goerli coinbase (#2377)
This commit is contained in:
@@ -69,11 +69,12 @@ pub use revm_primitives::JumpMap;
|
||||
pub use serde_helper::JsonU256;
|
||||
pub use storage::StorageEntry;
|
||||
pub use transaction::{
|
||||
util::secp256k1::sign_message, AccessList, AccessListItem, AccessListWithGasUsed,
|
||||
FromRecoveredTransaction, IntoRecoveredTransaction, InvalidTransactionError, Signature,
|
||||
Transaction, TransactionKind, TransactionMeta, TransactionSigned, TransactionSignedEcRecovered,
|
||||
TransactionSignedNoHash, TxEip1559, TxEip2930, TxLegacy, TxType, EIP1559_TX_TYPE_ID,
|
||||
EIP2930_TX_TYPE_ID, LEGACY_TX_TYPE_ID,
|
||||
util::secp256k1::{recover_signer, sign_message},
|
||||
AccessList, AccessListItem, AccessListWithGasUsed, FromRecoveredTransaction,
|
||||
IntoRecoveredTransaction, InvalidTransactionError, Signature, Transaction, TransactionKind,
|
||||
TransactionMeta, TransactionSigned, TransactionSignedEcRecovered, TransactionSignedNoHash,
|
||||
TxEip1559, TxEip2930, TxLegacy, TxType, EIP1559_TX_TYPE_ID, EIP2930_TX_TYPE_ID,
|
||||
LEGACY_TX_TYPE_ID,
|
||||
};
|
||||
pub use withdrawal::Withdrawal;
|
||||
|
||||
|
||||
@@ -123,7 +123,7 @@ impl Signature {
|
||||
|
||||
// NOTE: we are removing error from underlying crypto library as it will restrain primitive
|
||||
// errors and we care only if recovery is passing or not.
|
||||
secp256k1::recover(&sig, hash.as_fixed_bytes()).ok()
|
||||
secp256k1::recover_signer(&sig, hash.as_fixed_bytes()).ok()
|
||||
}
|
||||
|
||||
/// Turn this signature into its byte
|
||||
|
||||
@@ -13,7 +13,7 @@ pub(crate) mod secp256k1 {
|
||||
pub(crate) use ::secp256k1::Error;
|
||||
|
||||
/// secp256k1 signer recovery
|
||||
pub(crate) fn recover(sig: &[u8; 65], msg: &[u8; 32]) -> Result<Address, Error> {
|
||||
pub fn recover_signer(sig: &[u8; 65], msg: &[u8; 32]) -> Result<Address, Error> {
|
||||
let sig =
|
||||
RecoverableSignature::from_compact(&sig[0..64], RecoveryId::from_i32(sig[64] as i32)?)?;
|
||||
|
||||
@@ -49,6 +49,6 @@ mod tests {
|
||||
let hash = hex!("47173285a8d7341e5e972fc677286384f802f8ef42a5ec5f03bbfa254cb01fad");
|
||||
let out: Address = hex!("c08b5542d177ac6686946920409741463a15dddb").into();
|
||||
|
||||
assert_eq!(secp256k1::recover(&sig, &hash), Ok(out));
|
||||
assert_eq!(secp256k1::recover_signer(&sig, &hash), Ok(out));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user