• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

safe-global / safe-modules / 8109131706
100%
master: 85%

Build:
Build:
LAST BUILD BRANCH: main
DEFAULT BRANCH: master
Ran 01 Mar 2024 09:18AM UTC
Jobs 1
Files 11
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

01 Mar 2024 09:17AM UTC coverage: 76.498%. Remained the same
8109131706

push

github

web-flow
Add an E2E test for nested Safes in 4337 context (#273)

This PR adds an E2E test case for nested Safe transaction execution in
the 4337 Context. The test uses the following ownership structure:

![image](https://github.com/safe-global/safe-modules/assets/16622558/3e420068-3d3b-4db4-91f6-3da4febc350e)

I implemented helper classes representing the Safe ownership tree with
two node types: Safe and EOA. The tests also required functions to find
an execution path and build the user operation from the execution path.
The alternative would've been to do everything imperatively, but using
those functions, we could theoretically represent arbitrary ownership
structure, find an execution path (currently, the function doesn't find
the most optimal one) and generate a user operation.

The current algorithm works as follows (thanks to @nlordell for the
help):
1. **Finding an execution path:** It does a DFS on the tree until it
finds the first Executor node. We consider an executor node a leaf safe
owned by an EOA. In the context of the ownership structure on the
screenshot, the executor would be the leftmost Leaf Safe. The execution
path is represented by an array ordered from the root node to the
executor node.
2. **Building the user operation:** Using the execution path and our
desired `SafeTransaction` (the one executed with `execTransaction`), we
recursively sign the transaction with all the node owners in the
execution path. After that, we re-encode the `SafeTransaction` for the
next node with a call to the preceding node in the execution path and do
the signing again. It stops when we reach the starting node (the node
before the executor 4337 Safe). After that, we encode and send the
SafeTransaction in a User Operation.

- Implements #251 
- I also had to bring quite some code for executing regular Safe
transactions from the `safe-smart-account` repo

I tried to document the code as much as possible, but somehow, I feel it... (continued)

41 of 68 branches covered (60.29%)

Branch coverage included in aggregate %.

125 of 149 relevant lines covered (83.89%)

8.6 hits per line

Jobs
ID Job ID Ran Files Coverage
1 8109131706.1 01 Mar 2024 09:18AM UTC 0
76.5
GitHub Action Run
Source Files on build 8109131706
Detailed source file information is not available for this build.
  • Back to Repo
  • bd7b7564 on github
  • Prev Build on main (#7990141270)
  • Next Build on main (#8109203945)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc