Skip to content

Commit

Permalink
Merge branch 'main' into ud/cli-account
Browse files Browse the repository at this point in the history
  • Loading branch information
Unique-Divine committed Aug 22, 2024
2 parents 81a2af4 + 0a68933 commit d9ab812
Show file tree
Hide file tree
Showing 449 changed files with 3,910 additions and 4,032 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/e2e-evm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ jobs:
- name: "Launch localnet"
run: |
just localnet --no-build &
sleep 6
sleep 10
- name: "Run tests (just test)"
run: just test
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/proto-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
# timeout-minutes: 5
# steps:
# - uses: actions/checkout@v4
# - uses: bufbuild/buf-setup-action@v1.35.1
# - uses: bufbuild/buf-setup-action@v1.36.0
# - uses: bufbuild/buf-lint-action@v1
# with:
# input: "proto"
Expand All @@ -31,7 +31,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: bufbuild/buf-setup-action@v1.35.1
- uses: bufbuild/buf-setup-action@v1.36.0
with:
github_token: ${{ github.token }}
- uses: bufbuild/buf-breaking-action@v1
Expand Down
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- [#1989](https://github.com/NibiruChain/nibiru/pull/1989) - refactor(evm): simplify evm module address
- [#1996](https://github.com/NibiruChain/nibiru/pull/1996) - perf(evm-keeper-precompile): implement sorted map for `k.precompiles` to remove dead code
- [#1997](https://github.com/NibiruChain/nibiru/pull/1997) - refactor(evm): Remove unnecessary params: "enable_call", "enable_create".
- [#2000](https://github.com/NibiruChain/nibiru/pull/2000) - refactor(evm): simplify ERC-20 keeper methods
- [#2001](https://github.com/NibiruChain/nibiru/pull/2001) - refactor(evm): simplify FunToken methods and tests
- [#2003](https://github.com/NibiruChain/nibiru/pull/2003) - fix(evm): fix FunToken conversions between Cosmos and EVM
- [#2004](https://github.com/NibiruChain/nibiru/pull/2004) - refactor(evm)!: replace `HexAddr` with `EIP55Addr`
- [#2008](https://github.com/NibiruChain/nibiru/pull/2008) - refactor(evm): clean up precompile setups

#### Dapp modules: perp, spot, oracle, etc

Expand Down Expand Up @@ -131,6 +136,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- [#1899](https://github.com/NibiruChain/nibiru/pull/1899) - build(deps): cometbft v0.37.5, cosmos-sdk v0.47.11, proto-builder v0.14.0
- [#1913](https://github.com/NibiruChain/nibiru/pull/1913) - fix(tests): race condition from heavy Network tests
- [#1992](https://github.com/NibiruChain/nibiru/pull/1992) - chore: enabled grpc for localnet
- [#1999](https://github.com/NibiruChain/nibiru/pull/1999) - chore: update nibi go package version to v2

### Dependencies

Expand All @@ -153,7 +159,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Bump `github.com/hashicorp/go-getter` from 1.7.1 to 1.7.5 ([#1858](https://github.com/NibiruChain/nibiru/pull/1858), [#1938](https://github.com/NibiruChain/nibiru/pull/1938))
- Bump `github.com/btcsuite/btcd` from 0.23.3 to 0.24.0 ([#1862](https://github.com/NibiruChain/nibiru/pull/1862))
- Bump `pozetroninc/github-action-get-latest-release` from 0.7.0 to 0.8.0 ([#1863](https://github.com/NibiruChain/nibiru/pull/1863))
- Bump `bufbuild/buf-setup-action` from 1.30.1 to 1.35.1 ([#1891](https://github.com/NibiruChain/nibiru/pull/1891), [#1900](https://github.com/NibiruChain/nibiru/pull/1900), [#1923](https://github.com/NibiruChain/nibiru/pull/1923), [#1972](https://github.com/NibiruChain/nibiru/pull/1972), [#1974](https://github.com/NibiruChain/nibiru/pull/1974))
- Bump `bufbuild/buf-setup-action` from 1.30.1 to 1.36.0 ([#1891](https://github.com/NibiruChain/nibiru/pull/1891), [#1900](https://github.com/NibiruChain/nibiru/pull/1900), [#1923](https://github.com/NibiruChain/nibiru/pull/1923), [#1972](https://github.com/NibiruChain/nibiru/pull/1972), [#1974](https://github.com/NibiruChain/nibiru/pull/1974), [#1988](https://github.com/NibiruChain/nibiru/pull/1988))

## [v1.5.0](https://github.com/NibiruChain/nibiru/releases/tag/v1.5.0) - 2024-06-21

Expand Down
6 changes: 3 additions & 3 deletions app/ante.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import (

authante "github.com/cosmos/cosmos-sdk/x/auth/ante"

"github.com/NibiruChain/nibiru/app/ante"
"github.com/NibiruChain/nibiru/app/evmante"
devgasante "github.com/NibiruChain/nibiru/x/devgas/v1/ante"
"github.com/NibiruChain/nibiru/v2/app/ante"
"github.com/NibiruChain/nibiru/v2/app/evmante"
devgasante "github.com/NibiruChain/nibiru/v2/x/devgas/v1/ante"
)

// NewAnteHandler returns and AnteHandler that checks and increments sequence
Expand Down
6 changes: 3 additions & 3 deletions app/ante/commission_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import (

codectypes "github.com/cosmos/cosmos-sdk/codec/types"

"github.com/NibiruChain/nibiru/app"
"github.com/NibiruChain/nibiru/app/ante"
"github.com/NibiruChain/nibiru/x/common/testutil"
"github.com/NibiruChain/nibiru/v2/app"
"github.com/NibiruChain/nibiru/v2/app/ante"
"github.com/NibiruChain/nibiru/v2/x/common/testutil"
)

func (s *AnteTestSuite) TestAnteDecoratorStakingCommission() {
Expand Down
2 changes: 1 addition & 1 deletion app/ante/fixed_gas.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
sdkerrors "cosmossdk.io/errors"
sdk "github.com/cosmos/cosmos-sdk/types"

oracletypes "github.com/NibiruChain/nibiru/x/oracle/types"
oracletypes "github.com/NibiruChain/nibiru/v2/x/oracle/types"
)

const OracleMessageGas = 500
Expand Down
10 changes: 5 additions & 5 deletions app/ante/fixed_gas_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ import (
"github.com/cosmos/cosmos-sdk/x/auth/signing"
"github.com/cosmos/cosmos-sdk/x/bank/types"

"github.com/NibiruChain/nibiru/app/ante"
"github.com/NibiruChain/nibiru/app/appconst"
"github.com/NibiruChain/nibiru/x/common/testutil"
"github.com/NibiruChain/nibiru/x/common/testutil/testapp"
oracletypes "github.com/NibiruChain/nibiru/x/oracle/types"
"github.com/NibiruChain/nibiru/v2/app/ante"
"github.com/NibiruChain/nibiru/v2/app/appconst"
"github.com/NibiruChain/nibiru/v2/x/common/testutil"
"github.com/NibiruChain/nibiru/v2/x/common/testutil/testapp"
oracletypes "github.com/NibiruChain/nibiru/v2/x/oracle/types"
)

func (suite *AnteTestSuite) TestOraclePostPriceTransactionsHaveFixedPrice() {
Expand Down
2 changes: 1 addition & 1 deletion app/ante/gas_wanted.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
sdk "github.com/cosmos/cosmos-sdk/types"
errortypes "github.com/cosmos/cosmos-sdk/types/errors"

"github.com/NibiruChain/nibiru/eth"
"github.com/NibiruChain/nibiru/v2/eth"
)

// AnteDecoratorGasWanted keeps track of the gasWanted amount on the current block in
Expand Down
4 changes: 2 additions & 2 deletions app/ante/gas_wanted_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/x/auth/migrations/legacytx"

"github.com/NibiruChain/nibiru/app/ante"
"github.com/NibiruChain/nibiru/x/evm/evmtest"
"github.com/NibiruChain/nibiru/v2/app/ante"
"github.com/NibiruChain/nibiru/v2/x/evm/evmtest"
)

func (s *AnteTestSuite) TestGasWantedDecorator() {
Expand Down
6 changes: 3 additions & 3 deletions app/ante/handler_opts.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import (
authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper"
ibckeeper "github.com/cosmos/ibc-go/v7/modules/core/keeper"

devgasante "github.com/NibiruChain/nibiru/x/devgas/v1/ante"
devgaskeeper "github.com/NibiruChain/nibiru/x/devgas/v1/keeper"
evmkeeper "github.com/NibiruChain/nibiru/x/evm/keeper"
devgasante "github.com/NibiruChain/nibiru/v2/x/devgas/v1/ante"
devgaskeeper "github.com/NibiruChain/nibiru/v2/x/devgas/v1/keeper"
evmkeeper "github.com/NibiruChain/nibiru/v2/x/evm/keeper"
)

type AnteHandlerOptions struct {
Expand Down
2 changes: 1 addition & 1 deletion app/ante/reject_ethereum_tx_msgs.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
sdk "github.com/cosmos/cosmos-sdk/types"
errortypes "github.com/cosmos/cosmos-sdk/types/errors"

"github.com/NibiruChain/nibiru/x/evm"
"github.com/NibiruChain/nibiru/v2/x/evm"
)

// AnteDecoratorPreventEtheruemTxMsgs prevents invalid msg types from being executed
Expand Down
4 changes: 2 additions & 2 deletions app/ante/reject_ethereum_tx_msgs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package ante_test
import (
sdk "github.com/cosmos/cosmos-sdk/types"

"github.com/NibiruChain/nibiru/app/ante"
"github.com/NibiruChain/nibiru/x/evm/evmtest"
"github.com/NibiruChain/nibiru/v2/app/ante"
"github.com/NibiruChain/nibiru/v2/x/evm/evmtest"
)

func (s *AnteTestSuite) TestAnteDecoratorPreventEtheruemTxMsgs() {
Expand Down
6 changes: 3 additions & 3 deletions app/ante/testutil_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ import (

tmproto "github.com/cometbft/cometbft/proto/tendermint/types"

"github.com/NibiruChain/nibiru/app"
nibiruante "github.com/NibiruChain/nibiru/app/ante"
"github.com/NibiruChain/nibiru/x/common/testutil/testapp"
"github.com/NibiruChain/nibiru/v2/app"
nibiruante "github.com/NibiruChain/nibiru/v2/app/ante"
"github.com/NibiruChain/nibiru/v2/x/common/testutil/testapp"
)

// AnteTestSuite is a test suite to be used with ante handler tests.
Expand Down
9 changes: 4 additions & 5 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import (
wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper"
wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types"

"github.com/NibiruChain/nibiru/app/ante"
"github.com/NibiruChain/nibiru/app/wasmext"
"github.com/NibiruChain/nibiru/x/evm/precompile"
"github.com/NibiruChain/nibiru/v2/app/ante"
"github.com/NibiruChain/nibiru/v2/app/wasmext"
"github.com/NibiruChain/nibiru/v2/x/evm/precompile"

dbm "github.com/cometbft/cometbft-db"
abci "github.com/cometbft/cometbft/abci/types"
Expand Down Expand Up @@ -186,8 +186,7 @@ func NewNibiruApp(
skipGenesisInvariants := cast.ToBool(
appOpts.Get(crisis.FlagSkipGenesisInvariants))

precompilesToAdd := precompile.InitPrecompiles(app.AppKeepers.PublicKeepers)
app.EvmKeeper.AddPrecompiles(precompilesToAdd)
app.EvmKeeper.AddPrecompiles(precompile.InitPrecompiles(app.AppKeepers.PublicKeepers))

app.initModuleManager(encodingConfig, skipGenesisInvariants)

Expand Down
2 changes: 1 addition & 1 deletion app/appconst/appconst_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

"github.com/stretchr/testify/suite"

"github.com/NibiruChain/nibiru/app/appconst"
"github.com/NibiruChain/nibiru/v2/app/appconst"
)

type TestSuite struct {
Expand Down
2 changes: 1 addition & 1 deletion app/encoding.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package app
import (
"github.com/cosmos/cosmos-sdk/std"

"github.com/NibiruChain/nibiru/app/codec"
"github.com/NibiruChain/nibiru/v2/app/codec"
)

// EncodingConfig specifies the concrete encoding types to use for a given app.
Expand Down
4 changes: 2 additions & 2 deletions app/evmante/evmante_can_transfer.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import (
gethcommon "github.com/ethereum/go-ethereum/common"
gethcore "github.com/ethereum/go-ethereum/core/types"

"github.com/NibiruChain/nibiru/x/evm"
"github.com/NibiruChain/nibiru/x/evm/statedb"
"github.com/NibiruChain/nibiru/v2/x/evm"
"github.com/NibiruChain/nibiru/v2/x/evm/statedb"
)

// CanTransferDecorator checks if the sender is allowed to transfer funds according to the EVM block
Expand Down
25 changes: 12 additions & 13 deletions app/evmante/evmante_can_transfer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@ package evmante_test

import (
sdk "github.com/cosmos/cosmos-sdk/types"
gethcore "github.com/ethereum/go-ethereum/core/types"

"github.com/NibiruChain/nibiru/app/evmante"
"github.com/NibiruChain/nibiru/eth"
"github.com/NibiruChain/nibiru/x/common/testutil/testapp"
"github.com/NibiruChain/nibiru/x/evm/evmtest"
"github.com/NibiruChain/nibiru/x/evm/statedb"
"github.com/NibiruChain/nibiru/v2/app/evmante"
"github.com/NibiruChain/nibiru/v2/eth"
"github.com/NibiruChain/nibiru/v2/x/common/testutil/testapp"
"github.com/NibiruChain/nibiru/v2/x/evm/evmtest"
"github.com/NibiruChain/nibiru/v2/x/evm/statedb"
)

func (s *TestSuite) TestCanTransferDecorator() {
Expand All @@ -23,7 +24,7 @@ func (s *TestSuite) TestCanTransferDecorator() {
beforeTxSetup: func(deps *evmtest.TestDeps, sdb *statedb.StateDB) {
s.NoError(
testapp.FundAccount(
deps.Chain.BankKeeper,
deps.App.BankKeeper,
deps.Ctx,
deps.Sender.NibiruAddr,
sdk.NewCoins(sdk.NewInt64Coin(eth.EthBaseDenom, 100)),
Expand All @@ -34,9 +35,8 @@ func (s *TestSuite) TestCanTransferDecorator() {
txMsg := evmtest.HappyTransferTx(deps, 0)
txBuilder := deps.EncCfg.TxConfig.NewTxBuilder()

gethSigner := deps.Sender.GethSigner(deps.Chain.EvmKeeper.EthChainID(deps.Ctx))
keyringSigner := deps.Sender.KeyringSigner
err := txMsg.Sign(gethSigner, keyringSigner)
gethSigner := gethcore.LatestSignerForChainID(deps.App.EvmKeeper.EthChainID(deps.Ctx))
err := txMsg.Sign(gethSigner, deps.Sender.KeyringSigner)
s.Require().NoError(err)

tx, err := txMsg.BuildTx(txBuilder, eth.EthBaseDenom)
Expand All @@ -52,9 +52,8 @@ func (s *TestSuite) TestCanTransferDecorator() {
txMsg := evmtest.HappyTransferTx(deps, 0)
txBuilder := deps.EncCfg.TxConfig.NewTxBuilder()

gethSigner := deps.Sender.GethSigner(deps.Chain.EvmKeeper.EthChainID(deps.Ctx))
keyringSigner := deps.Sender.KeyringSigner
err := txMsg.Sign(gethSigner, keyringSigner)
gethSigner := gethcore.LatestSignerForChainID(deps.App.EvmKeeper.EthChainID(deps.Ctx))
err := txMsg.Sign(gethSigner, deps.Sender.KeyringSigner)
s.Require().NoError(err)

tx, err := txMsg.BuildTx(txBuilder, eth.EthBaseDenom)
Expand Down Expand Up @@ -90,7 +89,7 @@ func (s *TestSuite) TestCanTransferDecorator() {
s.Run(tc.name, func() {
deps := evmtest.NewTestDeps()
stateDB := deps.StateDB()
anteDec := evmante.NewCanTransferDecorator(&deps.Chain.AppKeepers.EvmKeeper)
anteDec := evmante.NewCanTransferDecorator(&deps.App.AppKeepers.EvmKeeper)
tx := tc.txSetup(&deps)

if tc.ctxSetup != nil {
Expand Down
2 changes: 1 addition & 1 deletion app/evmante/evmante_emit_event.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
sdk "github.com/cosmos/cosmos-sdk/types"
errortypes "github.com/cosmos/cosmos-sdk/types/errors"

"github.com/NibiruChain/nibiru/x/evm"
"github.com/NibiruChain/nibiru/v2/x/evm"
)

// EthEmitEventDecorator emit events in ante handler in case of tx execution failed (out of block gas limit).
Expand Down
10 changes: 5 additions & 5 deletions app/evmante/evmante_emit_event_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import (
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/x/auth/migrations/legacytx"

"github.com/NibiruChain/nibiru/app/evmante"
"github.com/NibiruChain/nibiru/x/evm"
"github.com/NibiruChain/nibiru/v2/app/evmante"
"github.com/NibiruChain/nibiru/v2/x/evm"

"github.com/NibiruChain/nibiru/x/evm/evmtest"
tf "github.com/NibiruChain/nibiru/x/tokenfactory/types"
"github.com/NibiruChain/nibiru/v2/x/evm/evmtest"
tf "github.com/NibiruChain/nibiru/v2/x/tokenfactory/types"
)

func (s *TestSuite) TestEthEmitEventDecorator() {
Expand Down Expand Up @@ -42,7 +42,7 @@ func (s *TestSuite) TestEthEmitEventDecorator() {
s.Run(tc.name, func() {
deps := evmtest.NewTestDeps()
stateDB := deps.StateDB()
anteDec := evmante.NewEthEmitEventDecorator(&deps.Chain.AppKeepers.EvmKeeper)
anteDec := evmante.NewEthEmitEventDecorator(&deps.App.AppKeepers.EvmKeeper)

tx := tc.txSetup(&deps)
s.Require().NoError(stateDB.Commit())
Expand Down
6 changes: 3 additions & 3 deletions app/evmante/evmante_gas_consume.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import (
errortypes "github.com/cosmos/cosmos-sdk/types/errors"
gethcommon "github.com/ethereum/go-ethereum/common"

"github.com/NibiruChain/nibiru/eth"
"github.com/NibiruChain/nibiru/x/evm"
"github.com/NibiruChain/nibiru/x/evm/keeper"
"github.com/NibiruChain/nibiru/v2/eth"
"github.com/NibiruChain/nibiru/v2/x/evm"
"github.com/NibiruChain/nibiru/v2/x/evm/keeper"
)

// AnteDecEthGasConsume validates enough intrinsic gas for the transaction and
Expand Down
12 changes: 6 additions & 6 deletions app/evmante/evmante_gas_consume_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ import (

sdk "github.com/cosmos/cosmos-sdk/types"

"github.com/NibiruChain/nibiru/app/evmante"
"github.com/NibiruChain/nibiru/eth"
"github.com/NibiruChain/nibiru/x/evm"
"github.com/NibiruChain/nibiru/x/evm/evmtest"
"github.com/NibiruChain/nibiru/x/evm/statedb"
"github.com/NibiruChain/nibiru/v2/app/evmante"
"github.com/NibiruChain/nibiru/v2/eth"
"github.com/NibiruChain/nibiru/v2/x/evm"
"github.com/NibiruChain/nibiru/v2/x/evm/evmtest"
"github.com/NibiruChain/nibiru/v2/x/evm/statedb"
)

func (s *TestSuite) TestAnteDecEthGasConsume() {
Expand Down Expand Up @@ -61,7 +61,7 @@ func (s *TestSuite) TestAnteDecEthGasConsume() {
deps := evmtest.NewTestDeps()
stateDB := deps.StateDB()
anteDec := evmante.NewAnteDecEthGasConsume(
&deps.Chain.AppKeepers.EvmKeeper, tc.maxGasWanted,
&deps.App.AppKeepers.EvmKeeper, tc.maxGasWanted,
)

tc.beforeTxSetup(&deps, stateDB)
Expand Down
2 changes: 1 addition & 1 deletion app/evmante/evmante_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ package evmante
import (
sdk "github.com/cosmos/cosmos-sdk/types"

"github.com/NibiruChain/nibiru/app/ante"
"github.com/NibiruChain/nibiru/v2/app/ante"
)

// NewAnteHandlerEVM creates the default ante handler for Ethereum transactions
Expand Down
Loading

0 comments on commit d9ab812

Please sign in to comment.