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

Handle Tally provider type #67

Merged
merged 15 commits into from
Apr 1, 2022

Conversation

0xzoz
Copy link
Contributor

@0xzoz 0xzoz commented Mar 9, 2022

Fix issue #66 - Tally provider was not correctly being captured. Fix to properly track Tally provider.

@0xzoz 0xzoz changed the title handle tally provider type Handle Tally provider type Mar 9, 2022
Copy link
Contributor

@torreyatcitty torreyatcitty left a comment

Choose a reason for hiding this comment

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

Made a couple small comments but I noticed you added a bunch of try/catches across a chunk of the functions. Were you seeing exceptions being thrown in all of these functions?

if (provider.constructor.name === 'InpageBridge') {
return 3;
} else {
return 3;
Copy link
Contributor

Choose a reason for hiding this comment

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

is this intentional to return 3 on both of these conditions? if so we can probably remove the check for InpageBridge above.

return 3;
}
} else {
return null;
Copy link
Contributor

Choose a reason for hiding this comment

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

Here we probably want to return 3 instead of null? would not recommend to return a non number from this function lest something that uses it may crash.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

A lot of this is actually redundant code. I have removed it in e2b169b

@0xzoz
Copy link
Contributor Author

0xzoz commented Mar 30, 2022

Yes @torreyatcitty . I think it is because web3-eth is using wallet_requestPermissions for permission requests which Tally has not yet implemented. A code: 4100, message: 'The requested method and/or account has not been authorized by the user. error occurs preventing the next steps from executing.

@@ -158,7 +158,7 @@ function subscribeToTryConnect(app, eth, globEthereum, defaultNetworkId) {

// We'll try to set to the user's last chosen provider, otherwise
// defaulting to Web3.
let providerType = Number(storage('chosenProvider').get(PROVIDER_TYPE_WEB3));
let providerType = providerTypeId(globEthereum);
Copy link
Contributor

Choose a reason for hiding this comment

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

Would recommend using the chosenProvider option first and then pass in the provider type id as the default value.

let providerType = Number(storage('chosenProvider').get(providerTypeId(globEthereum)));

Copy link
Contributor Author

@0xzoz 0xzoz Mar 31, 2022

Choose a reason for hiding this comment

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

Awesome! Appreciate your eyes on this. You know this codebase. Change made here 416209e

Copy link
Contributor

@torreyatcitty torreyatcitty left a comment

Choose a reason for hiding this comment

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

One last comment but everything else looks good.

Copy link
Contributor

@torreyatcitty torreyatcitty left a comment

Choose a reason for hiding this comment

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

LGTM

@torreyatcitty torreyatcitty merged commit e07cd9f into compound-finance:master Apr 1, 2022
@0xzoz
Copy link
Contributor Author

0xzoz commented Apr 1, 2022

Thanks @torreyatcitty. Could you let me know when this gets merged into the palisade frontend?

@torreyatcitty
Copy link
Contributor

Thanks @torreyatcitty. Could you let me know when this gets merged into the palisade frontend?

@0xzoz can you verify on one of these deployed endpoints?

They correspond to a build from this PR: compound-finance/palisade#19
which has your changes

@0xzoz
Copy link
Contributor Author

0xzoz commented Apr 4, 2022

@torreyatcitty LGTM. Tested on Brave and Chrome.

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

Successfully merging this pull request may close these issues.

2 participants