Skip to content

Commit

Permalink
Merge PR cosmos#2644: Simulation: Print last block when there is an e…
Browse files Browse the repository at this point in the history
…rror

There was an off by one error in the log printing function previously
  • Loading branch information
ValarDragon authored and cwgoes committed Oct 31, 2018
1 parent db1f45a commit 6316e12
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion x/mock/simulation/random_simulate_blocks.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,11 +221,11 @@ func createBlockSimulator(testingMode bool, tb testing.TB, t *testing.T, event f
accounts []Account, header abci.Header, logWriter func(string)) (opCount int) {
for j := 0; j < blocksize; j++ {
logUpdate, futureOps, err := selectOp(r)(r, app, ctx, accounts, event)
logWriter(logUpdate)
if err != nil {
displayLogs()
tb.Fatalf("error on operation %d within block %d, %v", header.Height, opCount, err)
}
logWriter(logUpdate)

queueOperations(operationQueue, timeOperationQueue, futureOps)
if testingMode {
Expand Down
2 changes: 1 addition & 1 deletion x/mock/simulation/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ func logPrinter(testingmode bool, logs []*strings.Builder) func() {
for i := 0; i < len(logs); i++ {
// We're passed the last created block
if logs[i] == nil {
numLoggers = i - 1
numLoggers = i
break
}
}
Expand Down

0 comments on commit 6316e12

Please sign in to comment.