Skip to content

Conversation

@yihuang
Copy link
Contributor

@yihuang yihuang commented Nov 5, 2025

Description

Closes: #505

Supersedes: #517

Use go-abi to simplify implementation, see: #789

Closes: #XXXX


Author Checklist

All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.

I have...

  • tackled an existing issue or discussed with a team member
  • left instructions on how to review the changes
  • targeted the main branch

Closes: cosmos#505

Supersedes: cosmos#517

Use go-abi to simplify implementation.

update erc20 source
@yihuang yihuang mentioned this pull request Nov 5, 2025
3 tasks
Comment on lines +62 to +64
for k, v := range generator.ParseExternalTuples(*extTuplesFlag) {
extTuples[k] = v
}

Check warning

Code scanning / CodeQL

Iteration over map Warning

Iteration over map may be a possible source of non-determinism
Comment on lines +112 to +117
for denom, amount := range m {
coin := sdk.NewCoin(denom, sdkmath.NewInt(amount))
if cb(coin) {
break
}
}

Check warning

Code scanning / CodeQL

Iteration over map Warning

Iteration over map may be a possible source of non-determinism
Comment on lines +122 to +127
for denom, amount := range k.supplies {
coin := sdk.NewCoin(denom, sdkmath.NewInt(amount))
if cb(coin) {
break
}
}

Check warning

Code scanning / CodeQL

Iteration over map Warning

Iteration over map may be a possible source of non-determinism
@codecov
Copy link

codecov bot commented Nov 5, 2025

Codecov Report

❌ Patch coverage is 81.38528% with 43 lines in your changes missing coverage. Please review.
✅ Project coverage is 65.18%. Comparing base (cb68a1b) to head (6d83bd2).

Files with missing lines Patch % Lines
precompiles/bank/mock.go 79.01% 14 Missing and 3 partials ⚠️
precompiles/common/precompile.go 66.66% 6 Missing and 5 partials ⚠️
precompiles/bank/query.go 84.09% 3 Missing and 4 partials ⚠️
precompiles/bank/tx.go 75.00% 2 Missing and 2 partials ⚠️
precompiles/bank/bank.go 94.59% 2 Missing ⚠️
precompiles/bank/erc20.go 85.71% 1 Missing and 1 partial ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #804      +/-   ##
==========================================
+ Coverage   64.99%   65.18%   +0.18%     
==========================================
  Files         317      320       +3     
  Lines       21615    21827     +212     
==========================================
+ Hits        14049    14228     +179     
- Misses       6371     6415      +44     
+ Partials     1195     1184      -11     
Files with missing lines Coverage Δ
precompiles/types/defaults.go 67.85% <100.00%> (+1.19%) ⬆️
precompiles/types/static_precompiles.go 88.63% <100.00%> (ø)
server/config/opendb.go 0.00% <ø> (ø)
x/vm/statedb/mockkeeper.go 40.74% <100.00%> (ø)
x/vm/types/config_testing.go 58.97% <ø> (ø)
x/vm/types/denom_config_testing.go 56.52% <ø> (ø)
precompiles/bank/bank.go 86.88% <94.59%> (+8.45%) ⬆️
precompiles/bank/erc20.go 85.71% <85.71%> (ø)
precompiles/bank/tx.go 75.00% <75.00%> (ø)
precompiles/bank/query.go 85.13% <84.09%> (-5.98%) ⬇️
... and 2 more

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@aljo242
Copy link
Contributor

aljo242 commented Nov 18, 2025

looks like we might need a go mod tidy

@aljo242
Copy link
Contributor

aljo242 commented Nov 19, 2025

Anything we need to do to get our code coverage up?

@yihuang
Copy link
Contributor Author

yihuang commented Nov 20, 2025

Anything we need to do to get our code coverage up?

I removed generated abi files from the coverage, the report looks good now.

Precompile: cmn.Precompile{
KvGasConfig: storetypes.GasConfig{},
TransientKVGasConfig: storetypes.GasConfig{},
ContractAddress: common.HexToAddress(evmtypes.BankPrecompileAddress),
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks need to set BalanceHandlerFactory

Copy link
Contributor Author

@yihuang yihuang Nov 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently, it explicitly reject to handle native token in transferFrom method.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Problem: dynamic erc20 precompiles are heavy

4 participants