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

Tally Integration Error Handling #65

Open
0xzoz opened this issue Mar 9, 2022 · 0 comments
Open

Tally Integration Error Handling #65

0xzoz opened this issue Mar 9, 2022 · 0 comments

Comments

@0xzoz
Copy link
Contributor

0xzoz commented Mar 9, 2022

Changes introduced in PR 60 have side effects due to the differences in how Metamask and Tally handle querying of ethereum data. Where new Eth(ethereum).getAccounts(); in

async function requiresAuthDialog(ethereum) {
let [account, _] = await new Eth(ethereum).getAccounts();
return !account;
}

gives an error: code: 4100, message: 'The requested method and/or account has not been authorized by the user.' error. instead of an empty array.

The issue also arises in other sections of the eth.js file for multiple functions:

function withTrxWeb3(eth, fnTrxWeb3, fnEls) {
if (eth.trxEth) {
let res = fnTrxWeb3(eth.trxEth, eth.trxEth.trxPromise);
eth.trxEth.trxPromise = res;
return res;
} else {
return fnEls();
}
}

async function getNetworkId(eth) {
return withTrxWeb3(
eth,
(trxEth) => trxEth.net.getId(),
() => eth.defaultNetworkId
);
}

async function getAccounts(eth) {
return withTrxWeb3(
eth,
(trxEth) => trxEth.getAccounts(),
() => (eth.showAccount ? [eth.showAccount] : [])
);
}

A workaround needs to be put in place to address this. On the first pass, an attempt was made to capture with a try catch statement but this has consequences when sending transactions and handling state while using Tally.

0xzoz added a commit to 0xzoz/compound-components that referenced this issue Mar 28, 2022
0xzoz added a commit to 0xzoz/compound-components that referenced this issue Mar 28, 2022
torreyatcitty pushed a commit that referenced this issue Apr 1, 2022
* handle tally provider type

* Fix error handling issues - Issue #65

* Fix error handling issues - get Accounts - Issue #65

* Provide user warning when clicking Metamask and Tally is set to default

* fix translations

* Check translations issue

* fix translations

* fix translations

* Align modal text

* Align modal text

* Align modal text

* Align modal text

* Fix resfresh issue and wallet auto opening issue

* Remove redundant code

* Use chosen provider storage
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant