-
Notifications
You must be signed in to change notification settings - Fork 828
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
E2E: wallet, transaction and chain improvements #7875
base: main
Are you sure you want to change the base?
Conversation
da27471
to
14a7704
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
okay, I can see how this will look like,
the ChainRunner and action trait need a bit more fine tuning wrt what's being stored etc.
the core logic should just be abstracted over the trait's types.
where the magic then comes in is with impls ov ChainRunner
for certain Action/Ctx types, this is where we then can add sugar for things like FnOnce() -> Future
etc
looks real good overall! i guess this can be an opinated topic, with no right or wrong way, so I'll just leave my opinion.
Things like this are being repeated over and over, in all scenarios across all nodes which in my opinion is unnecessary (...)
let tasks = TaskManager::current();
let exec = tasks.executor();
(...) I'd be curious on how you'd implement the scenario from 7552 PR which will (hopefully) be merged into main soon |
Thank you, Josh, and I appreciate the time you’ve invested in the reviews—it's incredibly helpful!
Since the TaskManager manages the current tokio main task, it must remain in scope throughout the test; otherwise, if it gets dropped, the entire environment would be affected as well. Previously, we handled this with code like: let (mut nodes, _tasks, _wallet) = setup(2).await?; Here, we returned the _tasks and effectively ignored them. I also wasn’t keen on the implicit naming of the setup function, which, while avoiding code duplication, obscures the underlying operations with a generic name, leaving unclear what it specifically does. So, I explored a different design, which admittedly leaves some boilerplate: let tasks = TaskManager::current();
let exec = tasks.executor(); However, this approach is more explicit and clarifies exactly what is happening during setup: let mut nodes = TestNetworkBuilder::<OptimismNode>::new(2, chain_spec, exec).build().await?; While I strive to apply the DRY (Don’t Repeat Yourself) principle wherever practical, I generally prefer explicit coding over obscuring details just to avoid duplicating logic. This stance is simply my personal preference, and I’m always eager to learn from differing viewpoints.
I guess we'll find out soon! I plan to rebase this PR on your commits once they are merged into the main branch. 🙃 |
I feel like there must be nuance here. Any abstraction is obscuring details by default. However, we are "obscuring" boilerplate code. In the context of building a readable test scenario, it adds no value being explicit like this imo. I'm horrible at naming, maybe
It needs to be in scope like you mentioned. |
042aa29
to
e417648
Compare
25f650b
to
bd37d52
Compare
b066f6b
to
94168cc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is great!
have a few nits and this needs a rebase because some types changed, should be trivial though
9a8f756
to
e842983
Compare
chore: lint fix: tests fix: tx req accesslist none fix: mut tx req fix: setup returns tasks so it doesnt get dropped fix: optimism test fix: optimism gas
Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
chore: lint fix: tests fix: tx req accesslist none fix: mut tx req fix: setup returns tasks so it doesnt get dropped fix: optimism test fix: optimism gas feat: TestNodeGenerator and TestNetworkBuilder and refactored a bit fix: type alias feat: chain builder feat: chain runner wip review: returing chained payloads from advance_many feat: runner using blanket impl feat: runner generic to N and removed action trait feat: pushing ctx to next futures storing the full clojure feat: action runner and action stream fix: doctest no run clippy fix: using type alias to chore: remove old file chore: ignore doctest fix: reducing time to sleep from 1 sec to 5 ms on blob test fix: rebase mistake
rebase corrections adding span to logs clippy troubleshooting still removed logs clippy fix: log clippy fix: test review omitting let binding smol fix fix: clippy
E2E improvements:
TransactionTestContext