Skip to content
This repository has been archived by the owner on Nov 10, 2023. It is now read-only.

fix: Crash if spending limit module is not deployed on a chain #3890

Merged
merged 2 commits into from
May 23, 2022

Conversation

usame-algan
Copy link
Member

@usame-algan usame-algan commented May 18, 2022

What it solves

Resolves #3889

How this PR fixes it

  • getAllowanceModuleDeployment can't throw. It instead returns undefined if the module is not deployed on a network. Instead of manually throwing on our side, we handle the undefined value.
  • getSpendingLimitModuleAddress can return string | undefined instead of just string

How to test it

  1. Open one of these Safes: arb1:0x2EBA2F2F1D599E9E2920ce4B70b1B881e76db82E, aurora:0xDBe6f953a53eE0Eb7D28101e123D7bf6553638eb
  2. Observe the app not crashing

@github-actions
Copy link

CLA Assistant Lite All Contributors have signed the CLA.

@github-actions
Copy link

github-actions bot commented May 18, 2022

ESLint Summary View Full Report

Annotations are provided inline on the Files Changed tab. You can also see all annotations that were generated on the annotations page.

Type Occurrences Fixable
Errors 0 0
Warnings 0 0
Ignored 0 N/A
  • Result: ✅ success
  • Annotations: 0 total

Report generated by eslint-plus-action

@github-actions
Copy link

Deployment links

🟠 Rinkeby Mainnet 🟣 Polygon 🟡 BSC Arbitrum 🟢 Gnosis Chain

@usame-algan usame-algan marked this pull request as ready for review May 18, 2022 15:53
@usame-algan usame-algan force-pushed the fix-spending-limit-throw branch from 6e0ae9c to 9a809e9 Compare May 18, 2022 15:54
@coveralls
Copy link

coveralls commented May 18, 2022

Pull Request Test Coverage Report for Build 2370733318

  • 1 of 12 (8.33%) changed or added relevant lines in 6 files are covered.
  • 4 unchanged lines in 3 files lost coverage.
  • Overall coverage decreased (-0.04%) to 36.973%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/logic/contracts/spendingLimitContracts.ts 1 2 50.0%
src/routes/safe/components/Balances/SendModal/screens/ReviewSendFundsTx/index.tsx 0 1 0.0%
src/routes/safe/components/Settings/SpendingLimit/RemoveLimitModal.tsx 0 1 0.0%
src/logic/safe/transactions/allowance.ts 0 2 0.0%
src/logic/safe/utils/spendingLimits.ts 0 2 0.0%
src/routes/safe/components/Settings/SpendingLimit/NewLimitModal/Review.tsx 0 4 0.0%
Files with Coverage Reduction New Missed Lines %
src/logic/safe/utils/spendingLimits.ts 1 17.24%
src/routes/safe/components/Settings/SpendingLimit/NewLimitModal/Review.tsx 1 0%
src/logic/safe/transactions/allowance.ts 2 0%
Totals Coverage Status
Change from base Build 2370107230: -0.04%
Covered Lines: 3894
Relevant Lines: 9572

💛 - Coveralls

@francovenica
Copy link
Contributor

The safes load fine, so that part is fixed.

I'm getting this error while loading a safe in bnb and gno chains. The safes load fine despite the error in the console. The error pops up in the console with every polling (every 15 secs)
Let me know if it is related to this ticket or not
Safes:
bnb:0x91e11585c114129f3Ec940Aa648A4ac13668d0c2
gno:0xB8d760a90a5ed54D3c2b3EFC231277e99188642A
image

@usame-algan
Copy link
Member Author

Let me know if it is related to this ticket or not

It seems that the web3 object was undefined. I tested both safes without getting the error so I would say it is unrelated to these changes.

@iamacook
Copy link
Member

It seems that the web3 object was undefined. I tested both safes without getting the error so I would say it is unrelated to these changes.

This is very likely related to the issue we were experiencing yesterday before the hotfix.

@francovenica
Copy link
Contributor

If the issues are unrelated we can pass this one to QA done.

@usame-algan usame-algan merged commit f56e0f6 into dev May 23, 2022
@usame-algan usame-algan deleted the fix-spending-limit-throw branch May 23, 2022 13:47
@github-actions github-actions bot locked and limited conversation to collaborators May 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can not add some existing safes on Arbitrum
4 participants