-
Notifications
You must be signed in to change notification settings - Fork 561
fix: don't revert gas refund logic when transaction reverted #751
Conversation
0f7b548
to
9c87cb6
Compare
Codecov Report
@@ Coverage Diff @@
## main #751 +/- ##
==========================================
+ Coverage 55.84% 55.86% +0.01%
==========================================
Files 64 64
Lines 5857 5859 +2
==========================================
+ Hits 3271 3273 +2
Misses 2386 2386
Partials 200 200
|
x/evm/types/compiled_contract.go
Outdated
// CompiledContract2 support json format of newer solc | ||
type CompiledContract2 struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rename this struct
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remoevd.
x/evm/handler_test.go
Outdated
return crypto.CreateAddress(suite.from, nonce) | ||
} | ||
|
||
func (suite *EvmTestSuite) TestGasWhenReverted() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we refactor this test? it's not maintainable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I realize we don't need a special contract to reproduce the contract revert, so I changed it to the existing erc20 contract, is it good now?
Apply suggestions from code review changelog
08bbde4
to
948b39c
Compare
Description
Problem: When there are hooks and the transaction reverted, gas refund logic is reverted too.
Solution: Don't revert the gas refund logic
For contributor use:
docs/
) or specification (x/<module>/spec/
)godoc
comments.Unreleased
section inCHANGELOG.md
Files changed
in the Github PR explorerFor admin use:
WIP
,R4R
,docs
, etc)