Skip to content

Commit 27ff358

Browse files
committed
new deployer for each scenario
1 parent a840c77 commit 27ff358

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

generator/generator.go

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ type scenarioInstance struct {
3333
type configBasedGenerator struct {
3434
config *config.LoadConfig
3535
instances []*scenarioInstance
36-
deployer *types.Account
3736
sharedAccounts types.AccountPool // Shared account pool when using top-level config
3837
accountPools []types.AccountPool // All account pools (shared + scenario-specific)
3938
mu sync.RWMutex
@@ -133,16 +132,15 @@ func (g *configBasedGenerator) deployAll() error {
133132

134133
// Deploy sequentially to ensure proper nonce management
135134
for _, instance := range g.instances {
135+
// create a new deployer for each scenario
136+
deployer := types.GenerateAccounts(1)[0]
136137
// Deploy the scenario
137-
address := instance.Scenario.Deploy(g.config, g.deployer)
138+
address := instance.Scenario.Deploy(g.config, deployer)
138139
instance.Deployed = true
139140

140141
if address.Cmp(common.Address{}) != 0 {
141142
log.Printf("🚀 Deployed %s at address: %s\n", instance.Name, address.Hex())
142143
}
143-
144-
// Increment deployer nonce for next deployment
145-
g.deployer.GetAndIncrementNonce()
146144
}
147145

148146
return nil
@@ -202,7 +200,6 @@ func NewConfigBasedGenerator(cfg *config.LoadConfig) (Generator, error) {
202200
generator := &configBasedGenerator{
203201
config: cfg,
204202
instances: make([]*scenarioInstance, 0),
205-
deployer: types.GenerateAccounts(1)[0],
206203
}
207204

208205
// Step 1: Create scenarios

0 commit comments

Comments
 (0)