diff --git a/tools/gasmonitor/README.md b/tools/gasmonitor/README.md index 1af6de9761..f6869632b2 100644 --- a/tools/gasmonitor/README.md +++ b/tools/gasmonitor/README.md @@ -13,12 +13,11 @@ When creating a `testnode`, set the gas consumption trace decorator as an `appOption` with the specific key. ```go - cfg := testnode.DefaultConfig() + cfg := testnode.DefaultConfig() dec := gasmonitor.NewDecorator() - // store the gas monitor to read from after execution + // store the gas monitor to read from after execution s.gasMonitor = dec cfg.AppOptions.Set(gasmonitor.AppOptionsKey, dec) -``` ### Saving Traces diff --git a/tools/gasmonitor/gas_monitor.go b/tools/gasmonitor/gas_monitor.go index 65f24fc778..8a97a8f753 100644 --- a/tools/gasmonitor/gas_monitor.go +++ b/tools/gasmonitor/gas_monitor.go @@ -43,7 +43,7 @@ func (d *Decorator) SaveJSON() error { return json.NewEncoder(file).Encode(d.Traces) } -// NewMonitoredGasMeter wraps the provided context's gas meter with a monitored +// NewGasConsumptionTrace wraps the provided context's gas meter with a monitored // version. func NewGasConsumptionTrace(ctx sdk.Context, tx sdk.Tx) (*GasConsumptionTrace, sdk.Context) { meter := ctx.GasMeter() @@ -106,8 +106,8 @@ func (gm *GasConsumptionTrace) RefundGas(amount sdk.Gas, descriptor string) { gm.GasMeter.RefundGas(amount, descriptor) } -// AnteHandle replaces the gas meter with the provided context with one that -// monitors the amount of gas consumed it fulfills the ante.Decorator interface. +// AnteHandle replaces the gas meter in the provided context with one that +// monitors the amount of gas consumed. It fulfills the ante.Decorator interface. func (d *Decorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, next sdk.AnteHandler) (newCtx sdk.Context, err error) { if ctx.IsCheckTx() || ctx.IsReCheckTx() { return next(ctx, tx, simulate)