0g-chain/app
Nick DeLuca ab3cf7c994
feat!(precompile): Add registry and genesis tests (#1999)
* feat!(precompile): Add registry and genesis tests

Based on evgeniy-scherbina's work, this adds a new precompile module
which defines a contract moudule with an example noop contract that
will be will be used for implementing test functions.  In addition,
it defines a registry module that instantiates stateful precompile
contracts and associates them with an address in a global registry
defined in kava-labs/go-ethereum. See precompile/README.md for more
information.

The kava-labs/go-ethereum and kava-labs/etheremint replace statements
are updated to support these changes as well as an update to kvtool
which includes genesis state for the registry.NoopContractAddress and
initializes the contract's EthAccount with a non-zero sequence and
codehash set to keccak256(0x01), and sets the contract code to 0x01.
See tests/e2e/e2e_precompile_genesis_test.go for an overview of the
expected genesis state for an enabled precompile.

Co-authored-by: evgeniy-scherbina <evgeniy.shcherbina.es@gmail.com>

* chore: Precompile readme improvements

This fixes a typo (import -> important) and uses package terminology
instead of unclear module terminology.  This aligns best with golang
terminology were modules and packages are distinctly different and
modules are defined using go.mod.

* chore: Improve noop contract godoc

Add a more meaningful godoc where the noop contract is constructed.

* chore(e2e): Improve comments around query checks

Improve the clarity of comments around where the error is checked for
accounts and why it is not checked directly.

In addition, improve comment on why both grpc and rpc code is fetched
and where they are used.

---------

Co-authored-by: evgeniy-scherbina <evgeniy.shcherbina.es@gmail.com>
2024-08-09 09:55:31 -07:00
..
ante feat!(precompile): Add registry and genesis tests (#1999) 2024-08-09 09:55:31 -07:00
params chore: fix some typos (#1913) 2024-05-16 13:27:48 -07:00
_sim_test.go Update cosmos-sdk to v0.47.7 (#1811) 2024-02-06 17:54:10 -05:00
_simulate_tx_test.go Update cosmos-sdk to v0.47.7 (#1811) 2024-02-06 17:54:10 -05:00
_simulate_tx.go Upgrade to sdk v0.44.5 and add IBC (#1106) 2022-01-07 17:39:27 -07:00
app_test.go feat!(precompile): Add registry and genesis tests (#1999) 2024-08-09 09:55:31 -07:00
app.go feat!(precompile): Add registry and genesis tests (#1999) 2024-08-09 09:55:31 -07:00
config.go Upgrade to sdk v0.44.5 and add IBC (#1106) 2022-01-07 17:39:27 -07:00
encoding.go feat: upgrade to Cosmos v0.46 (#1477) 2023-04-03 20:08:45 -04:00
export.go Update cosmos-sdk to v0.47.7 (#1811) 2024-02-06 17:54:10 -05:00
genesis.go Upgrade to sdk v0.44.5 and add IBC (#1106) 2022-01-07 17:39:27 -07:00
tally_handler_test.go Fix some typos in comments (#1878) 2024-04-16 11:54:09 -07:00
tally_handler.go Update cosmos-sdk to v0.47.7 (#1811) 2024-02-06 17:54:10 -05:00
test_builder.go formatting fixes (#1783) 2023-11-21 14:08:07 -05:00
test_common.go feat(x/precisebank): Implement SendCoins (#1923) 2024-06-17 10:53:41 -07:00
upgrades.go Remove x/bridge & setup migration skeletion (#1295) 2022-09-01 16:20:37 -04:00