Merge PR #2644: Simulation: Print last block when there is an error
There was an off by one error in the log printing function previously
This commit is contained in:
parent
db1f45a3a9
commit
6316e1241e
|
@ -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 {
|
||||
|
|
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue