Skip to content

Commit

Permalink
Merge pull request #19 from leapwallet/fix/ethwallet-sign-direct
Browse files Browse the repository at this point in the history
fix eth sign direct
  • Loading branch information
baryon2 authored Nov 11, 2023
2 parents 10652b9 + 6297560 commit c6802f3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@leapwallet/leap-keychain",
"version": "0.2.1",
"version": "0.2.2",
"description": "A javascript library for crypto key management",
"scripts": {
"test": "jest",
Expand Down
5 changes: 1 addition & 4 deletions src/key/eth-wallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ import { bip39Token, getBip39 } from '../crypto/bip39/bip39-token';
import { SignDoc } from 'cosmjs-types/cosmos/tx/v1beta1/tx';
import Container from 'typedi';

import { sha256Token } from '../crypto/hashes/hashes';

export class EthWallet {
private constructor(
private mnemonic: string,
Expand Down Expand Up @@ -132,8 +130,7 @@ export class EthWallet {
throw new Error(`Address ${signerAddress} not found in wallet`);
}

const sha256 = Container.get(sha256Token);
const hash = sha256(serializeSignDoc(signDoc));
const hash = serializeSignDoc(signDoc);

const rawSignature = this.sign(signerAddress, keccak256(Buffer.from(hash)));
const splitSignature = bytes.splitSignature(rawSignature);
Expand Down

0 comments on commit c6802f3

Please sign in to comment.