@@ -199,6 +199,9 @@ func (am AppModule) OnChanOpenInit(
199
199
if committedHeight == ctx .BlockHeight () {
200
200
// We don't support simulation.
201
201
return nil
202
+ } else {
203
+ // The simulation was done, so now allow infinite gas.
204
+ ctx = ctx .WithGasMeter (sdk .NewInfiniteGasMeter ())
202
205
}
203
206
204
207
event := channelOpenInitEvent {
@@ -260,6 +263,9 @@ func (am AppModule) OnChanOpenTry(
260
263
if committedHeight == ctx .BlockHeight () {
261
264
// We don't support simulation.
262
265
return nil
266
+ } else {
267
+ // The simulation was done, so now allow infinite gas.
268
+ ctx = ctx .WithGasMeter (sdk .NewInfiniteGasMeter ())
263
269
}
264
270
265
271
event := channelOpenTryEvent {
@@ -313,6 +319,9 @@ func (am AppModule) OnChanOpenAck(
313
319
if committedHeight == ctx .BlockHeight () {
314
320
// We don't support simulation.
315
321
return nil
322
+ } else {
323
+ // The simulation was done, so now allow infinite gas.
324
+ ctx = ctx .WithGasMeter (sdk .NewInfiniteGasMeter ())
316
325
}
317
326
318
327
event := channelOpenAckEvent {
@@ -351,6 +360,9 @@ func (am AppModule) OnChanOpenConfirm(
351
360
if committedHeight == ctx .BlockHeight () {
352
361
// We don't support simulation.
353
362
return nil
363
+ } else {
364
+ // The simulation was done, so now allow infinite gas.
365
+ ctx = ctx .WithGasMeter (sdk .NewInfiniteGasMeter ())
354
366
}
355
367
356
368
event := channelOpenConfirmEvent {
@@ -389,6 +401,9 @@ func (am AppModule) OnChanCloseInit(
389
401
if committedHeight == ctx .BlockHeight () {
390
402
// We don't support simulation.
391
403
return nil
404
+ } else {
405
+ // The simulation was done, so now allow infinite gas.
406
+ ctx = ctx .WithGasMeter (sdk .NewInfiniteGasMeter ())
392
407
}
393
408
394
409
event := channelCloseInitEvent {
@@ -426,6 +441,9 @@ func (am AppModule) OnChanCloseConfirm(
426
441
if committedHeight == ctx .BlockHeight () {
427
442
// We don't support simulation.
428
443
return nil
444
+ } else {
445
+ // The simulation was done, so now allow infinite gas.
446
+ ctx = ctx .WithGasMeter (sdk .NewInfiniteGasMeter ())
429
447
}
430
448
431
449
event := channelCloseConfirmEvent {
@@ -461,6 +479,9 @@ func (am AppModule) OnRecvPacket(
461
479
if committedHeight == ctx .BlockHeight () {
462
480
// We don't support simulation.
463
481
return & sdk.Result {}, nil
482
+ } else {
483
+ // The simulation was done, so now allow infinite gas.
484
+ ctx = ctx .WithGasMeter (sdk .NewInfiniteGasMeter ())
464
485
}
465
486
466
487
// Sometimes we receive duplicate packets, just with a
@@ -511,6 +532,9 @@ func (am AppModule) OnAcknowledgementPacket(
511
532
if committedHeight == ctx .BlockHeight () {
512
533
// We don't support simulation.
513
534
return & sdk.Result {}, nil
535
+ } else {
536
+ // The simulation was done, so now allow infinite gas.
537
+ ctx = ctx .WithGasMeter (sdk .NewInfiniteGasMeter ())
514
538
}
515
539
516
540
event := acknowledgementPacketEvent {
@@ -552,6 +576,9 @@ func (am AppModule) OnTimeoutPacket(
552
576
if committedHeight == ctx .BlockHeight () {
553
577
// We don't support simulation.
554
578
return & sdk.Result {}, nil
579
+ } else {
580
+ // The simulation was done, so now allow infinite gas.
581
+ ctx = ctx .WithGasMeter (sdk .NewInfiniteGasMeter ())
555
582
}
556
583
557
584
event := timeoutPacketEvent {
0 commit comments