Skip to content

Commit

Permalink
Use coherent PublicKeyFormat in parse_slice (#4783)
Browse files Browse the repository at this point in the history
  • Loading branch information
sydhds authored Dec 16, 2024
1 parent c16701a commit cb2b13a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 2 additions & 0 deletions massa-execution-worker/src/active_history.rs
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,7 @@ mod test {
let state_changes_1 = StateChanges {
ledger_changes: Default::default(),
async_pool_changes: async_pool_changes_1,
deferred_call_changes: Default::default(),
pos_changes: Default::default(),
executed_ops_changes: Default::default(),
executed_denunciations_changes: Default::default(),
Expand All @@ -448,6 +449,7 @@ mod test {
let state_changes_2 = StateChanges {
ledger_changes: Default::default(),
async_pool_changes: async_pool_changes_2,
deferred_call_changes: Default::default(),
pos_changes: Default::default(),
executed_ops_changes: Default::default(),
executed_denunciations_changes: Default::default(),
Expand Down
5 changes: 1 addition & 4 deletions massa-execution-worker/src/interface_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -968,10 +968,7 @@ impl Interface for InterfaceImpl {
/// Address is the last 20 bytes of the hash of the public key.
fn evm_get_address_from_pubkey(&self, public_key_: &[u8]) -> Result<Vec<u8>> {
// parse the public key
let public_key = libsecp256k1::PublicKey::parse_slice(
public_key_,
Some(libsecp256k1::PublicKeyFormat::Raw),
)?;
let public_key = libsecp256k1::PublicKey::parse_slice(public_key_, None)?;

// compute the hash of the public key
let hash = sha3::Keccak256::digest(public_key.serialize());
Expand Down

0 comments on commit cb2b13a

Please sign in to comment.