Skip to content

Commit

Permalink
Merge pull request #5 from umee-network/matt/add-wallet-error-handlin…
Browse files Browse the repository at this point in the history
…g-for-keplr-II

fix regression
  • Loading branch information
dreamcodez authored Feb 24, 2022
2 parents 299ec88 + 14036ce commit 886fd38
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lib/multisigHelpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,22 @@ const getMultisigAccount = async (address, client) => {
// is new, and has never submitted a transaction its pubkeys will not be
// available from a node. If the multisig was created with this instance
// of this tool its pubkey will be available in the fauna datastore
const accountOnChain = await client.getAccount(address);
let accountOnChain = await client.getAccount(address);
const chainId = await client.getChainId();

if (!accountOnChain || !accountOnChain.pubkey) {
console.log("No pubkey on chain for: ", address);
const res = await axios.get(`/api/chain/${chainId}/multisig/${address}`);

if (res.status !== 200) {
throw new Error("Multisig has no pubkey on node, and was not created using this tool.");
}
const pubkey = JSON.parse(res.data.pubkeyJSON);

if (!accountOnChain) {
accountOnChain = {};
}
accountOnChain.pubkey = pubkey;
}
return accountOnChain;
};
Expand Down

1 comment on commit 886fd38

@vercel
Copy link

@vercel vercel bot commented on 886fd38 Feb 24, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.