Skip to content

Commit

Permalink
[FRE-1157] Fix ethermint signing (#397)
Browse files Browse the repository at this point in the history
  • Loading branch information
codingki authored Oct 30, 2024
1 parent 308b997 commit 329da2d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 14 deletions.
8 changes: 4 additions & 4 deletions packages/client/src/proto-signing/pubkey.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,10 @@ export function makePubkeyAnyFromAccount(
chainId?: string,
) {
const algo = `${account.algo}`;

// Some impl use `eth_secp256k1` and some use `ethsecp256k1`, so we check for both
const isEthSecp256k1 = algo === "eth_secp256k1" || algo === "ethsecp256k1";

const pubkey = isEthSecp256k1
const isEthermint = chainId?.includes("shido") || chainId?.includes("dymension");
const pubkey = (isEthSecp256k1 || isEthermint)
? encodeEthSecp256k1Pubkey(account.pubkey)
: encodeSecp256k1Pubkey(account.pubkey);

Expand All @@ -32,13 +31,14 @@ export function makePubkeyAnyFromAccount(

export function encodePubkeyToAny(pubkey: Pubkey, chainId?: string): Any {
if (isEthSecp256k1Pubkey(pubkey)) {
const isEthermint = chainId?.includes("shido") || chainId?.includes("dymension");
const pubkeyProto = PubKey.fromPartial({
key: fromBase64(pubkey.value),
});
let typeUrl = "";
if (chainId?.includes("injective")) {
typeUrl = "/injective.crypto.v1beta1.ethsecp256k1.PubKey";
} else {
} else if (isEthermint) {
typeUrl = "/ethermint.crypto.v1.ethsecp256k1.PubKey";
}
return Any.fromPartial({
Expand Down
10 changes: 0 additions & 10 deletions packages/widget-v2/src/devMode/loadWidget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,6 @@ const DevMode = () => {
settings={{
slippage: 5,
}}
filter={{
source: {
"cosmoshub-4": undefined,
"osmosis-1": undefined,
},
destination: {
"cosmoshub-4": ["uatom"],
"osmosis-1": undefined,
}
}}
/>
<Column>
<button onClick={() => toggleTheme()}>
Expand Down

0 comments on commit 329da2d

Please sign in to comment.