Skip to content

Commit

Permalink
🐛 Fix invalid desmos proof format
Browse files Browse the repository at this point in the history
  • Loading branch information
williamchong committed Dec 31, 2021
1 parent 6ac03bc commit 90ffd9b
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions store/modules/actions/authCore.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,11 +163,14 @@ export async function signAuthCoreAddressProof({ state }) {
if (!state.cosmosProvider) throw new Error('COSMOS_WALLET_NOT_INITED');
const { cosmosProvider } = state;
const [cosmosAddress] = await cosmosProvider.getAddresses();
const plaintext = Buffer.from(cosmosAddress).toString('hex');
const { signatures, signed } = await cosmosProvider.directSign(plaintext);
const { signatures, signed } = await cosmosProvider.directSign(cosmosAddress);
const plaintext = Buffer.from(signed).toString('hex');
const [{ signature, pub_key: pubKey }] = signatures;
const signatureHex = Buffer.from(signature, 'base64').toString('hex');
const proof = {
plain_text: signed,
...signatures[0],
plain_text: plaintext,
pub_key: pubKey,
signature: signatureHex,
};
return formatDesmosChainLinkProof(cosmosAddress, proof);
}

0 comments on commit 90ffd9b

Please # to comment.