From c4e472748b4eed4f7ad9650a5904a526e0c2e214 Mon Sep 17 00:00:00 2001 From: Michael FIG Date: Sat, 21 Aug 2021 16:29:56 -0600 Subject: [PATCH] fix(cosmos): the bootstrap block is not a simulation, either --- golang/cosmos/vm/height.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/golang/cosmos/vm/height.go b/golang/cosmos/vm/height.go index ad5d2e3f18e..c76fd8bede3 100644 --- a/golang/cosmos/vm/height.go +++ b/golang/cosmos/vm/height.go @@ -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() }