Skip to content

Commit d5c83bb

Browse files
committed
fix nonce management for scenario deployment:
1 parent f105108 commit d5c83bb

2 files changed

Lines changed: 3 additions & 4 deletions

File tree

generator/generator.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,15 +134,13 @@ func (g *configBasedGenerator) deployAll() error {
134134
// Deploy sequentially to ensure proper nonce management
135135
for _, instance := range g.instances {
136136
// Deploy the scenario
137+
log.Printf("Deploying scenario %s", instance.Name)
137138
address := instance.Scenario.Deploy(g.config, g.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

generator/scenarios/base.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ func (c *ContractScenarioBase[T]) DeployScenario(config *config.LoadConfig, depl
186186
log.Printf("📤 Deployment transaction sent: %s", tx.Hash().Hex())
187187

188188
// Wait for the deployment transaction to be mined
189-
ctx, cancel := context.WithTimeout(context.Background(), 2*time.Minute)
189+
ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second)
190190
defer cancel()
191191

192192
receipt, err := bind.WaitMined(ctx, client, tx)
@@ -200,6 +200,7 @@ func (c *ContractScenarioBase[T]) DeployScenario(config *config.LoadConfig, depl
200200
}
201201

202202
log.Printf("✅ Deployment successful at block %d (gas used: %d)", receipt.BlockNumber.Uint64(), receipt.GasUsed)
203+
deployer.GetAndIncrementNonce()
203204

204205
// Bind contract instance using the provided bind function
205206
bindFunc := c.deployer.GetBindFunc()

0 commit comments

Comments
 (0)