Skip to content

Commit 9e71edb

Browse files
authored
Use signature_hash to compute the sig hash (#3468)
* Use signature_hash to compute the sig hash * clippy
1 parent eaff747 commit 9e71edb

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

tee-worker/omni-executor/intent/executors/cross-chain/src/single_chain.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
use super::*;
2-
use alloy::consensus::transaction::RlpEcdsaEncodableTx;
32
use alloy::primitives::ChainId;
43
use executor_primitives::PumpxConfig;
54
use pumpx::methods::create_market_order_tx::CreateMarketOrderTxBody;
6-
use sp_core::keccak_256;
75
use tracing::{debug, error};
86

97
impl<BinanceClient: BinanceApi, SolanaClient: SolanaClientTrait>
@@ -263,10 +261,7 @@ impl<BinanceClient: BinanceApi, SolanaClient: SolanaClientTrait>
263261
.map_err(|_| error!("Failed to decode legacy tx"))?;
264262

265263
unsigned_tx.chain_id = Some(ChainId::from(chain_id));
266-
let mut rlp_encoded_tx = vec![];
267-
unsigned_tx.rlp_encode(&mut rlp_encoded_tx);
268-
269-
Ok(keccak_256(&rlp_encoded_tx).to_vec())
264+
Ok(unsigned_tx.signature_hash().to_vec())
270265
})
271266
.collect::<Result<Vec<Vec<u8>>, ()>>()?;
272267

0 commit comments

Comments
 (0)