MetaMask / metamask-mobile

Mobile web browser providing access to websites that use the Ethereum blockchain
https://metamask.io
Other
2.18k stars 1.12k forks source link

chore: use getShares contract method from stake-sdk for unstake all flow #12295

Open nickewansmith opened 1 week ago

nickewansmith commented 1 week ago

Description

  1. What is the reason for the change?

There was a quick fix for there being a share left in the vault after a user attempts to unstake all shares. This PR adds the long-term fix and upgrades the stake-sdk which added a new getShares method on the contract.

  1. What is the improvement/solution?

We are now using the stake-sdk to access the getShares contract method instead of creating the interface on the fly.

Related issues

Fixes: https://consensyssoftware.atlassian.net/browse/STAKE-871

Manual testing steps

  1. Attempt to unstake all shares and all of them should unstake, leaving no option to unstake anymore.
  2. There should be no change from before, as we only change the source we get the contract method from

Screenshots/Recordings

Before

After

https://github.com/user-attachments/assets/b9e7af8b-c421-482c-b3e2-d15982681520

Pre-merge author checklist

Pre-merge reviewer checklist

github-actions[bot] commented 1 week ago

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

socket-security[bot] commented 1 week ago

New and removed dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/@metamask/stake-sdk@0.3.0 network 0 169 kB metamaskbot

🚮 Removed packages: npm/@metamask/stake-sdk@0.2.13

View full report↗︎

github-actions[bot] commented 4 days ago

https://bitrise.io/ Bitrise

❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌

Commit hash: d0d9f4f28edf0a396823ccd6b825db9ddd785be5 Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/35ace655-d2cd-4581-a70d-dbeb3d123060

[!NOTE]

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

[!TIP]

  • Check the documentation if you have any doubts on how to understand the failure on bitrise
github-actions[bot] commented 4 days ago

https://bitrise.io/ Bitrise

✅✅✅ pr_smoke_e2e_pipeline passed on Bitrise! ✅✅✅

Commit hash: 37387254ef958778a34e607ecdbb76605e0370cd Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/4397c551-202c-411d-8232-69d7f042de40

[!NOTE]

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request
github-actions[bot] commented 4 days ago

https://bitrise.io/ Bitrise

✅✅✅ pr_smoke_e2e_pipeline passed on Bitrise! ✅✅✅

Commit hash: 3cf84c82791db348d339b88dcc7f45e8f2d338e1 Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/51cca2c8-2848-48d4-ba63-1115487f32d5

[!NOTE]

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request
github-actions[bot] commented 12 hours ago

https://bitrise.io/ Bitrise

❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌

Commit hash: e56cd0df3a47ae07c0108caee68faaab4a330a0b Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/e9ea9e10-5bf1-44d0-b4a7-de61e185ed8b

[!NOTE]

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

[!TIP]

  • Check the documentation if you have any doubts on how to understand the failure on bitrise
sonarcloud[bot] commented 12 hours ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
100.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarQube Cloud