Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bugfix] limit wasm max gas with param #502

Merged
merged 3 commits into from
Jun 28, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
update comment
  • Loading branch information
yun-yeo committed Jun 14, 2021
commit 7a5852707b9ab04bd93fc5f98b11e9a97af8a14e
10 changes: 5 additions & 5 deletions x/wasm/keeper/contract.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ func (k Keeper) InstantiateContract(
k.getGasRemaining(ctx),
)

// add types.GasMultiplier to cause out of gas panic
// add types.GasMultiplier to occur out of gas panic
k.consumeGas(ctx, gasUsed+types.GasMultiplier, "Contract init")
if err != nil {
return nil, nil, sdkerrors.Wrap(types.ErrInstantiateFailed, err.Error())
Expand Down Expand Up @@ -230,7 +230,7 @@ func (k Keeper) ExecuteContract(
k.getGasRemaining(ctx),
)

// add types.GasMultiplier to cause out of gas panic
// add types.GasMultiplier to occur out of gas panic
k.consumeGas(ctx, gasUsed+types.GasMultiplier, "Contract Execution")
if err != nil {
return nil, sdkerrors.Wrap(types.ErrExecuteFailed, err.Error())
Expand Down Expand Up @@ -307,7 +307,7 @@ func (k Keeper) MigrateContract(
k.getGasRemaining(ctx),
)

// add types.GasMultiplier to cause out of gas panic
// add types.GasMultiplier to occur out of gas panic
k.consumeGas(ctx, gasUsed+types.GasMultiplier, "Contract Migration")
if err != nil {
return nil, sdkerrors.Wrap(types.ErrMigrationFailed, err.Error())
Expand Down Expand Up @@ -369,7 +369,7 @@ func (k Keeper) reply(
k.getGasRemaining(ctx),
)

// add types.GasMultiplier to cause out of gas panic
// add types.GasMultiplier to occur out of gas panic
k.consumeGas(ctx, gasUsed+types.GasMultiplier, "Contract Reply")
if err != nil {
return sdkerrors.Wrap(types.ErrReplyFailed, err.Error())
Expand Down Expand Up @@ -430,7 +430,7 @@ func (k Keeper) queryToContract(ctx sdk.Context, contractAddress sdk.AccAddress,
k.getGasRemaining(ctx),
)

// add types.GasMultiplier to cause out of gas panic
// add types.GasMultiplier to occur out of gas panic
k.consumeGas(ctx, gasUsed+types.GasMultiplier, "Contract Query")
if err != nil {
return nil, sdkerrors.Wrap(types.ErrContractQueryFailed, err.Error())
Expand Down