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

chore: refactor to use cosmossdk/math types #2104

Merged
merged 4 commits into from
Nov 29, 2023
Merged

Conversation

GAtom22
Copy link
Contributor

@GAtom22 GAtom22 commented Nov 29, 2023

Description


Closes #XXX

@@ -442,7 +443,7 @@
return nil, errorsmod.Wrapf(types.ErrGasOverflow, "message gas limit < leftover gas (%d < %d)", msg.Gas(), leftoverGas)
}

gasUsed := sdk.MaxDec(minimumGasUsed, sdk.NewDec(int64(temporaryGasUsed))).TruncateInt().Uint64()
gasUsed := math.LegacyMaxDec(minimumGasUsed, math.LegacyNewDec(int64(temporaryGasUsed))).TruncateInt().Uint64()

Check failure

Code scanning / gosec

Potential integer overflow by integer type conversion Error

Potential integer overflow by integer type conversion
@@ -430,7 +431,7 @@
// calculate a minimum amount of gas to be charged to sender if GasLimit
// is considerably higher than GasUsed to stay more aligned with Tendermint gas mechanics
// for more info https://github.com/evmos/ethermint/issues/1085
gasLimit := sdk.NewDec(int64(msg.Gas()))
gasLimit := math.LegacyNewDec(int64(msg.Gas()))

Check failure

Code scanning / gosec

Potential integer overflow by integer type conversion Error

Potential integer overflow by integer type conversion
@@ -64,7 +65,7 @@

// Observe which users define a gas limit >> gas used. Note, that
// gas_limit and gas_used are always > 0
gasLimit := sdk.NewDec(int64(tx.Gas()))
gasLimit := math.LegacyNewDec(int64(tx.Gas()))

Check failure

Code scanning / gosec

Potential integer overflow by integer type conversion Error

Potential integer overflow by integer type conversion
Copy link

codecov bot commented Nov 29, 2023

Codecov Report

Merging #2104 (a0f6371) into main (52949ce) will not change coverage.
The diff coverage is 86.84%.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #2104   +/-   ##
=======================================
  Coverage   69.02%   69.02%           
=======================================
  Files         301      301           
  Lines       23638    23638           
=======================================
  Hits        16317    16317           
  Misses       6433     6433           
  Partials      888      888           
Files Coverage Δ
app/ante/cosmos/fees.go 92.96% <100.00%> (ø)
app/ante/cosmos/min_price.go 90.74% <100.00%> (ø)
app/ante/evm/03_global_fee.go 100.00% <100.00%> (ø)
app/ante/evm/08_vesting.go 89.02% <100.00%> (ø)
app/ante/evm/fee_checker.go 100.00% <100.00%> (ø)
app/app.go 79.43% <100.00%> (ø)
app/upgrades/v11/upgrades.go 42.51% <100.00%> (ø)
app/upgrades/v12/upgrades.go 42.85% <100.00%> (ø)
app/upgrades/v9/upgrades.go 42.85% <100.00%> (ø)
app/upgrades/v9_1/upgrades.go 75.51% <100.00%> (ø)
... and 31 more

@github-actions github-actions bot added the tests label Nov 29, 2023
@GAtom22 GAtom22 marked this pull request as ready for review November 29, 2023 19:21
@GAtom22 GAtom22 requested a review from a team as a code owner November 29, 2023 19:21
@GAtom22 GAtom22 requested review from facs95, MalteHerrmann, Vvaradinov, fedekunze and 0xstepit and removed request for a team November 29, 2023 19:21
@fedekunze fedekunze merged commit 550201e into main Nov 29, 2023
39 of 40 checks passed
@fedekunze fedekunze deleted the GAtom22/use-math branch November 29, 2023 20:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants