fix: correct sender check fix

This commit is contained in:
Oleksandr Pravdyvyi 2025-07-25 19:46:23 +03:00
parent e0b1ec165c
commit c546af7865
No known key found for this signature in database
GPG Key ID: 9F8955C63C443871

View File

@ -148,7 +148,7 @@ impl SequencerCore {
{ {
let mut output = [0; 32]; let mut output = [0; 32];
let mut keccak_hasher = Keccak::v256(); let mut keccak_hasher = Keccak::v256();
keccak_hasher.update(&tx.transaction().signature.to_bytes()); keccak_hasher.update(&tx.transaction().public_key.to_sec1_bytes());
keccak_hasher.finalize(&mut output); keccak_hasher.finalize(&mut output);
if native_transfer_action.from != output { if native_transfer_action.from != output {
@ -228,22 +228,6 @@ impl SequencerCore {
let tx_hash = *mempool_tx.auth_tx.hash(); let tx_hash = *mempool_tx.auth_tx.hash();
for utxo_comm in utxo_commitments_created_hashes {
self.store
.utxo_commitments_store
.add_tx(&UTXOCommitment { hash: *utxo_comm });
}
for nullifier in nullifier_created_hashes.iter() {
self.store.nullifier_store.insert(UTXONullifier {
utxo_hash: *nullifier,
});
}
self.store
.pub_tx_store
.add_tx(mempool_tx.auth_tx.transaction());
//Balance check //Balance check
if let Ok(native_transfer_action) = if let Ok(native_transfer_action) =
serde_json::from_slice::<PublicNativeTokenSend>(execution_input) serde_json::from_slice::<PublicNativeTokenSend>(execution_input)
@ -271,6 +255,22 @@ impl SequencerCore {
} }
} }
for utxo_comm in utxo_commitments_created_hashes {
self.store
.utxo_commitments_store
.add_tx(&UTXOCommitment { hash: *utxo_comm });
}
for nullifier in nullifier_created_hashes.iter() {
self.store.nullifier_store.insert(UTXONullifier {
utxo_hash: *nullifier,
});
}
self.store
.pub_tx_store
.add_tx(mempool_tx.auth_tx.transaction());
Ok(()) Ok(())
} }