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

fix: do not offer executing unsigned txs with connected wallet #4598

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

schmanu
Copy link
Member

@schmanu schmanu commented Dec 3, 2024

What it solves

We currently offer executing unsigned txs through the connected wallet whilst having a subaccount opened.

How this PR fixes it

Only adds the connected wallet as option if the transaction is already fully signed or the wallet is an owner.

How to test it

  1. Open a 1/n Subaccount whose parent is owned by the connected wallet
  2. Create a new tx with the current Safes nonce
  3. Select to Execute the tx directly
  4. Observe that the connected wallet is not offered
  5. Now only Sign the tx
  6. When signed, click execute
  7. Observe that the connected wallet is now an option

Checklist

  • I've tested the branch on mobile 📱
  • I've documented how it affects the analytics (if at all) 📊
  • I've written a unit/e2e test for it (if applicable) 🧑‍💻

@schmanu schmanu requested a review from iamacook December 3, 2024 14:12
Copy link

github-actions bot commented Dec 3, 2024

Copy link

github-actions bot commented Dec 3, 2024

📦 Next.js Bundle Analysis for safe-wallet-web

This analysis was generated by the Next.js Bundle Analysis action. 🤖

⚠️ Global Bundle Size Increased

Page Size (compressed)
global 1005.99 KB (🟡 +3 B)
Details

The global bundle is the javascript bundle that loads alongside every page. It is in its own category because its impact is much higher - an increase to its size means that every page on your website loads slower, and a decrease means every page loads faster.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

If you want further insight into what is behind the changes, give @next/bundle-analyzer a try!

Copy link

github-actions bot commented Dec 3, 2024

Coverage report

Caution

Test run failed

St.
Category Percentage Covered / Total
🟡 Statements
73.66% (-0.01% 🔻)
14337/19465
🔴 Branches
51.79% (-0.02% 🔻)
3516/6789
🔴 Functions 57.08% 2081/3646
🟡 Lines
75.25% (-0.01% 🔻)
13027/17312
Show files with reduced coverage 🔻
St.
File Statements Branches Functions Lines
🟢
... / index.tsx
82.22% (-1.87% 🔻)
78.26% (-6.74% 🔻)
71.43%
83.33% (-2.03% 🔻)
🟢
... / useTxPendingStatuses.ts
77.5% (-0.83% 🔻)
64.06% (-1.56% 🔻)
68.18%
86.41% (-0.97% 🔻)

Test suite run failed

Failed tests: 1/1662. Failed suites: 1/226.
  ● SafeWalletProvider › EIP-5792 › wallet_getCallsStatus › should return a confirmed transaction if blockNumber/gasUsed are hex

    expect(received).toStrictEqual(expected) // deep equality

    - Expected  - 1
    + Received  + 1

    @@ -5,11 +5,11 @@
          "receipts": Array [
            Object {
              "blockHash": "0xa",
              "blockNumber": "0x7",
              "chainId": "0x1",
    -         "gasUsed": "0xC",
    +         "gasUsed": "0xc",
              "logs": Array [],
              "status": "0x1",
              "transactionHash": "0x123",
            },
          ],

      653 |         expect(sdk.getBySafeTxHash).toHaveBeenCalledWith(params[0])
      654 |         expect(sdk.proxy).toHaveBeenCalledWith('eth_getTransactionReceipt', params)
    > 655 |         expect(status).toStrictEqual({
          |                        ^
      656 |           id: 1,
      657 |           jsonrpc: '2.0',
      658 |           result: {

      at Object.toStrictEqual (src/services/safe-wallet-provider/index.test.ts:655:24)

Report generated by 🧪jest coverage report action from d719480

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.

You should pull from dev to fix the tests.

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.

We also need to consider delegates. I am now no longer able to propose a nested transaction when connected as a parent delegate to a child.

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.

After discussion, and considering we purposely excluded other signing cases such as spending limites, recovery, roles, etc., we will disregard delegates. If requested, we will revisit it later

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.

3 participants