Skip to content

Commit

Permalink
fix(cosmos): the bootstrap block is not a simulation, either
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelfig committed Aug 21, 2021
1 parent 7dc25d2 commit c4e4727
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions golang/cosmos/vm/height.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ var committedHeight int64 = 0

// IsSimulation tells if we are simulating the transaction
func IsSimulation(ctx sdk.Context) bool {
// If we haven't committed yet, we're still in bootstrap.
if committedHeight == 0 {
return false
}
// Otherwise, if we already committed this block, we're in simulation.
return committedHeight == ctx.BlockHeight()
}

Expand Down

0 comments on commit c4e4727

Please sign in to comment.