Skip to content

Commit

Permalink
fix(evm): diff signer on tx2 and tx3 (#2022)
Browse files Browse the repository at this point in the history
* log

* map access_list correctly
  • Loading branch information
canonbrother authored Jun 2, 2023
1 parent 11e307e commit 01dd520
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/ain-evm/src/transaction/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ impl TryFrom<TransactionV2> for SignedTx {
action: tx.action,
value: tx.value,
input: tx.input.clone(),
access_list: vec![],
access_list: tx.access_list.clone(),
};
let signing_message = libsecp256k1::Message::parse_slice(&msg.hash()[..]).unwrap();
let hash = H256::from(signing_message.serialize());
Expand All @@ -150,7 +150,7 @@ impl TryFrom<TransactionV2> for SignedTx {
action: tx.action,
value: tx.value,
input: tx.input.clone(),
access_list: vec![],
access_list: tx.access_list.clone(),
};
let signing_message = libsecp256k1::Message::parse_slice(&msg.hash()[..]).unwrap();
let hash = H256::from(signing_message.serialize());
Expand Down
2 changes: 2 additions & 0 deletions lib/ain-grpc/src/rpc/eth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -476,6 +476,7 @@ impl MetachainRPCServer for MetachainRPCModule {
}
}
};
debug!(target:"rpc","[send_transaction] from: {:?}", from);

let chain_id = ain_cpp_imports::get_chain_id()
.map_err(|e| Error::Custom(format!("ain_cpp_imports::get_chain_id error : {e:?}")))?;
Expand Down Expand Up @@ -673,6 +674,7 @@ fn sign(
address: H160,
message: TransactionMessage,
) -> Result<TransactionV2, Box<dyn std::error::Error>> {
debug!("sign address {:#x}", address);
let key_id = address.as_fixed_bytes().to_owned();
let priv_key = get_eth_priv_key(key_id).unwrap();
let secret_key = SecretKey::parse(&priv_key).unwrap();
Expand Down

0 comments on commit 01dd520

Please sign in to comment.