Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

10 notify signing error #11

Merged
merged 2 commits into from
Nov 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
"jsx": true
},
"ecmaVersion": "latest",
"project": [
"./tsconfig.json"
],
"sourceType": "module"
},
"plugins": [
Expand All @@ -28,6 +31,7 @@
"rules": {
"@typescript-eslint/no-empty-interface": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-floating-promises": "error",
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/no-unused-vars": [
"warn",
Expand Down
2 changes: 1 addition & 1 deletion src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ const App = (_props: Props) => {
setMetricsIndex,
setGovernedParamsIndex,
setInstanceIds,
});
}).catch((err: Error) => console.error('got watchContract err', err));
Copy link
Contributor

Choose a reason for hiding this comment

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

Worth alerting here too? (Maybe if/when we get time we can add a toast instead of alert)

Copy link
Member Author

Choose a reason for hiding this comment

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

I figured if this part fails there's not anything they can do. for the signing error they can get more funds.

}, [
wallet,
mergeBrandToInfo,
Expand Down
2 changes: 1 addition & 1 deletion src/components/AcceptInvitation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export default function AcceptInvitation(props: Props) {
props.sourceContract,
props.description
);
walletUtils.sendOffer(offer);
void walletUtils.sendOffer(offer);
}}
>
Accept Invitation
Expand Down
2 changes: 1 addition & 1 deletion src/components/ProposeParamChange.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export default function ProposeParamChange(props: Props) {
paramPatch,
minutesUntilClose
);
walletUtils.sendOffer(offer);
void walletUtils.sendOffer(offer);
}

// XXX tell user when the storage node doesn't exist, i.e. invalid anchor
Expand Down
2 changes: 1 addition & 1 deletion src/components/ProposePauseOffers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export default function ProposePauseOffers(props: Props) {
toPause,
minutesUntilClose
);
walletUtils.sendOffer(offer);
void walletUtils.sendOffer(offer);
}

// styling examples https://tailwindcss-forms.vercel.app/
Expand Down
2 changes: 1 addition & 1 deletion src/components/questions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ export function VoteOnLatestQuestion(props: { ecOfferId: number }) {
[position],
data.questionHandle
);
walletUtils.sendOffer(offer);
void walletUtils.sendOffer(offer);
}
const {
closingRule: { deadline },
Expand Down
2 changes: 1 addition & 1 deletion src/govTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* XXX much/most of this is copied and could get out of sync.
* TODO: import them https://github.com/Agoric/agoric-sdk/issues/6343
*/
import { Amount, Brand } from '@agoric/ertp';
import { Amount } from '@agoric/ertp';
import { Ratio } from '@agoric/zoe/src/contractSupport';

// Endo with boardId marshaling
Expand Down
2 changes: 1 addition & 1 deletion src/lib/chainInfo.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Bech32Config, ChainInfo, Currency } from '@keplr-wallet/types';
import type { Bech32Config, Currency } from '@keplr-wallet/types';

export const AGORIC_COIN_TYPE = 564;
export const COSMOS_COIN_TYPE = 118;
Expand Down
3 changes: 2 additions & 1 deletion src/lib/wallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { SigningStargateClient as AmbientClient } from '@cosmjs/stargate';
import { ERef } from '@endo/eventual-send';
import { ChainInfo, Keplr } from '@keplr-wallet/types';
import React, { useContext, useEffect, useState } from 'react';
import { notifyError } from 'utils/displayFunctions.js';
import { suggestChain } from './chainInfo.js';
import { makeInteractiveSigner } from './keyManagement.js';
import { boardSlottingMarshaller, networkConfigUrl, RpcUtils } from './rpc';
Expand Down Expand Up @@ -186,7 +187,7 @@ export const makeWalletUtils = async (rpcUtils: RpcUtils, keplr: Keplr) => {
console.log('submitting spend action', capData, 'for offer', offer);
const message = JSON.stringify(capData);

return chainKit.signer.submitSpendAction(message);
return chainKit.signer.submitSpendAction(message).catch(notifyError);
},
};
};
Expand Down
5 changes: 5 additions & 0 deletions src/utils/displayFunctions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ import { IST_ICON } from 'assets/assets';
import type { BrandInfo } from 'store/app';
import { wellKnownBrands } from 'config';

export const notifyError = err => {
console.log(err);
window.alert(err);
Copy link
Member

Choose a reason for hiding this comment

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

Not alert(err.message)?

Copy link
Member Author

Choose a reason for hiding this comment

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

That would omit "Error: ".
Screen Shot 2022-11-04 at 7 36 09 AM

Copy link
Member

Choose a reason for hiding this comment

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

ok. I was worried about [Object object] or some such. thanks for the detail.

};

const getLogoForBrandPetname = (brandPetname: string) => {
switch (brandPetname) {
case 'IST':
Expand Down