Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(evm): diff signer on tx2 and tx3 #2022

Merged
merged 2 commits into from
Jun 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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