-
Notifications
You must be signed in to change notification settings - Fork 560
feat: support stateful precompiled contracts #1650
Conversation
temp temp fix build temp fix build support mint method mint and query balance
x/evm/keeper/state_transition.go
Outdated
for addr, creator := range k.customPrecompiles { | ||
contracts[addr] = creator(ctx, stateDB, caller, msg.Value(), false) | ||
} |
Check failure
Code scanning / gosec
the value in the range statement should be _ unless copying a map: want: for key := range m
|
||
func init() { | ||
addressType, _ := abi.NewType("address", "", nil) | ||
uint256Type, _ := abi.NewType("uint256", "", nil) |
Check warning
Code scanning / gosec
Returned error is not propagated up the stack.
) | ||
|
||
func init() { | ||
addressType, _ := abi.NewType("address", "", nil) |
Check warning
Code scanning / gosec
Returned error is not propagated up the stack.
x/evm/keeper/state_transition.go
Outdated
for addr, c := range contracts { | ||
precompiles[addr] = c | ||
} |
Check warning
Code scanning / CodeQL
Iteration over map
x/evm/keeper/state_transition.go
Outdated
for addr, creator := range k.customPrecompiles { | ||
contracts[addr] = creator(ctx, stateDB, caller, msg.Value(), false) | ||
} |
Check warning
Code scanning / CodeQL
Iteration over map
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days-before-close if no further activity occurs. |
x/evm/statedb/statedb.go
Outdated
// Keeper returns the underlying `Keeper` | ||
func (s *StateDB) Keeper() Keeper { | ||
return s.keeper | ||
} | ||
|
||
// AppendJournalEntry allow external module to append journal entry, | ||
// to support snapshot revert for external states. | ||
func (s *StateDB) AppendJournalEntry(entry JournalEntry) { |
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.
Is this method used anywhere?
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.
No, can clean up some interface now
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #1650 +/- ##
==========================================
- Coverage 68.89% 68.72% -0.18%
==========================================
Files 117 119 +2
Lines 10681 10726 +45
==========================================
+ Hits 7359 7371 +12
- Misses 2900 2931 +31
- Partials 422 424 +2
|
replace transfer with raw
func init() { | ||
addressType, _ := abi.NewType("address", "", nil) | ||
uint256Type, _ := abi.NewType("uint256", "", nil) | ||
bytesType, _ := abi.NewType("bytes", "", nil) |
Check warning
Code scanning / gosec
Returned error is not propagated up the stack.
|
||
func init() { | ||
addressType, _ := abi.NewType("address", "", nil) | ||
uint256Type, _ := abi.NewType("uint256", "", nil) |
Check warning
Code scanning / gosec
Returned error is not propagated up the stack.
) | ||
|
||
func init() { | ||
addressType, _ := abi.NewType("address", "", nil) |
Check warning
Code scanning / gosec
Returned error is not propagated up the stack.
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days-before-close if no further activity occurs. |
Updates: #1116
Description
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)