Skip to content

refactor(cheatcodes): move script_wallets into Cheatcode #9104

@yash-atreya

Description

@yash-atreya
          lgtm, note on performance, would like us to revisit script wallets handling if we want to support scripting cheats in tests as well

Originally posted by @klkvr in #9087 (review)

#9087 intoduces cheatcodes that lets users add unlocked wallets to the forge environment not only in scripts but also in tests.

This works well for scripts but can lead to a performance lag when used in tests as we may clone the cheatcodes_config via Arc::make_mut(&mut state.config) to modify script_wallets

Possible solution: Move script_wallets into Cheatcodes and rename it to wallets. Add new API method wallets(&self, wallets) to the InspectorStackBuilder interface. Use that while initializing cheatcodes for tests and scripts.

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

Status
Completed

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions