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

Sdk modules management #3249

Merged
merged 6 commits into from
Jan 19, 2022
Merged

Sdk modules management #3249

merged 6 commits into from
Jan 19, 2022

Conversation

germartinez
Copy link
Member

@germartinez germartinez commented Jan 5, 2022

What it solves

Resolves #2797

How this PR fixes it

Uses the safe-core-sdk to call the methods getEnableModuleTx and getDisableModuleTx

How to test it

  • Check that the modules list is empty in Settings > Advanced
  • Create a new Spending Limit for the first time in Settings > Spending Limit
  • Check that a new Safe module was added to the list in Settings > Advanced
  • Remove that module using the actions in the right side of the modules table

@github-actions
Copy link

github-actions bot commented Jan 5, 2022

CLA Assistant Lite All Contributors have signed the CLA.

@github-actions
Copy link

github-actions bot commented Jan 5, 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

@coveralls
Copy link

coveralls commented Jan 5, 2022

Pull Request Test Coverage Report for Build 1719914404

  • 6 of 36 (16.67%) changed or added relevant lines in 5 files are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage decreased (-0.04%) to 31.986%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/logic/safe/utils/spendingLimits.ts 1 2 50.0%
src/routes/safe/components/Settings/Advanced/ModulesTable.tsx 2 4 50.0%
src/logic/safe/utils/modules.ts 2 7 28.57%
src/routes/safe/components/Settings/SpendingLimit/NewLimitModal/Review.tsx 0 10 0.0%
src/routes/safe/components/Settings/Advanced/RemoveModuleModal.tsx 1 13 7.69%
Files with Coverage Reduction New Missed Lines %
src/routes/safe/components/Settings/Advanced/ModulesTable.tsx 1 70.97%
Totals Coverage Status
Change from base Build 1718917186: -0.04%
Covered Lines: 3113
Relevant Lines: 8677

💛 - Coveralls

@github-actions
Copy link

github-actions bot commented Jan 5, 2022

Deployment links

🟠 Safe Rinkeby Safe Mainnet 🟣 Safe Polygon 🟡 Safe BSC Safe Arbitrum 🟢 Safe xDai

@github-actions
Copy link

github-actions bot commented Jan 5, 2022

E2E Tests Failed
Check the results here: https://github.com/gnosis/safe-react-e2e-tests/actions/runs/1661170640

Failed tests:

  • ❌ Read-only transaction creation and review Read-only transaction creation and review
  • ❌ Safe Balances Safe Balances
  • ❌ Application Layout Footer exists in the Welcome page and Settings

@katspaugh
Copy link
Member

It looks like dev departed from main a bit. You shouldn’t merge main into this branch. Dev is the base.

@@ -130,16 +148,16 @@ export const RemoveModuleModal = ({ onClose, selectedModulePair }: RemoveModuleM
{(txParameters, toggleEditMode) => {
return (
<>
<ModalHeader onClose={onClose} title="Remove Guard" />
<ModalHeader onClose={onClose} title="Remove Module" />
Copy link
Member

Choose a reason for hiding this comment

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

Good catch!

Copy link
Member

@katspaugh katspaugh left a comment

Choose a reason for hiding this comment

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

Code looks great!
I'm a little worried about the added async-await. Are those calls all try-catch'ed somewhere?
Please test with failing transactions (e.g. super low gas).

Copy link
Member

@iamacook iamacook left a comment

Choose a reason for hiding this comment

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

Looking good!

@francovenica
Copy link
Contributor

LGTM

Enabled the module
Added owners to the list
Used that owner to send funds through the module
Disabled the module and re enabled it again with the MC. The owner is still in the list (correct)
Removed all owners from the list
Add an owner once again, re enabling the module once again
Edited the allowance of those owners.
The allowance itself still works fine (the limit on how much can be sent, and actually limiting the owner to do it)

@katspaugh
Copy link
Member

@germartinez could you solve the git conflict and merge this? Thanks!

@github-actions
Copy link

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

@germartinez germartinez merged commit 37ca340 into dev Jan 19, 2022
@germartinez germartinez deleted the sdk-modules-management branch January 19, 2022 19:54
@github-actions github-actions bot locked and limited conversation to collaborators Jan 19, 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.

[Code SDK] Migrate the module management to SDK
6 participants