fix(signers): aws eip712 does not use eip155 (#1309)

* fix(signers): aws eip712 does not use eip155

* chore: update changelog

* chore: lints

Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>
This commit is contained in:
Luke Tchang 2022-05-25 14:15:00 -07:00 committed by GitHub
parent 799660bd26
commit 4d9916570f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 3 deletions

View File

@ -4,6 +4,7 @@
### Unreleased
- AWS EIP712 data signing no longer signs with EIP155
- Added Cronos testnet to etherscan options [1276](https://github.com/gakonst/ethers-rs/pull/1276)
- Fix parsing of a pending block
[1272](https://github.com/gakonst/ethers-rs/pull/1272)

View File

@ -251,11 +251,14 @@ impl<'a> super::Signer for AwsSigner<'a> {
&self,
payload: &T,
) -> Result<EthSig, Self::Error> {
let hash = payload.encode_eip712().map_err(|e| Self::Error::Eip712Error(e.to_string()))?;
let digest =
payload.encode_eip712().map_err(|e| Self::Error::Eip712Error(e.to_string()))?;
let digest = self.sign_digest_with_eip155(hash.into(), self.chain_id).await?;
let sig = self.sign_digest(digest).await?;
let sig = utils::rsig_from_digest_bytes_trial_recovery(&sig, digest, &self.pubkey);
let sig = rsig_to_ethsig(&sig);
Ok(digest)
Ok(sig)
}
fn address(&self) -> Address {