Skip to content

Commit

Permalink
wip: add debug for handler
Browse files Browse the repository at this point in the history
  • Loading branch information
boodyvo committed Nov 7, 2024
1 parent fedeac5 commit 540f4ae
Show file tree
Hide file tree
Showing 18 changed files with 491 additions and 458 deletions.
7 changes: 5 additions & 2 deletions app/params/encoding.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package params

import (
"cosmossdk.io/x/tx/signing"
"fmt"
"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/codec"
"github.com/cosmos/cosmos-sdk/codec/address"
Expand All @@ -14,6 +13,7 @@ import (
enccodec "github.com/evmos/ethermint/encoding/codec"
evmtypes "github.com/evmos/ethermint/x/evm/types"
cdptypes "github.com/kava-labs/kava/x/cdp/types"
communitytypes "github.com/kava-labs/kava/x/community/types"
evmutiltypes "github.com/kava-labs/kava/x/evmutil/types"
"google.golang.org/protobuf/reflect/protoreflect"
)
Expand Down Expand Up @@ -49,9 +49,12 @@ func MakeEncodingConfig() EncodingConfig {
cdptypes.MsgDrawDebtGetSigners.MsgType: cdptypes.MsgDrawDebtGetSigners.Fn,
cdptypes.MsgRepayDebtGetSigners.MsgType: cdptypes.MsgRepayDebtGetSigners.Fn,
cdptypes.MsgLiquidateGetSigners.MsgType: cdptypes.MsgLiquidateGetSigners.Fn,
// MsgFundCommunityPoolGetSigners
// MsgUpdateParamsSigners
communitytypes.MsgFundCommunityPoolGetSigners.MsgType: communitytypes.MsgFundCommunityPoolGetSigners.Fn,
communitytypes.MsgUpdateParamsSigners.MsgType: communitytypes.MsgUpdateParamsSigners.Fn,
},
}
fmt.Println("registering customer signers", signingOptions.CustomGetSigners)
interfaceRegistry, _ := types.NewInterfaceRegistryWithOptions(types.InterfaceRegistryOptions{
ProtoFiles: proto.HybridResolver,
SigningOptions: signingOptions,
Expand Down
3 changes: 0 additions & 3 deletions cmd/kava/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import (
)

func main() {
fmt.Println("starting cmd")
rootCmd := cmd.NewRootCmd()

//if err := autoCliOpts.EnhanceRootCommand(rootCmd); err != nil {
Expand All @@ -29,6 +28,4 @@ func main() {
// os.Exit(1)
//}
}

fmt.Println("finished without errors")
}
7 changes: 4 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,8 @@ require (
)

replace (
cosmossdk.io/core/comet => cosmossdk.io/core/comet v0.11.0
// need to fix the comet.BlockInfo error, new changed to Info
//cosmossdk.io/core/comet => cosmossdk.io/core/comet v0.11.0
// Use the cosmos keyring code
github.com/99designs/keyring => github.com/cosmos/keyring v1.2.0
// Use cometbft fork of tendermint
Expand All @@ -260,7 +261,7 @@ replace (
// Use cosmos-sdk fork with backported fix for unsafe-reset-all, staking transfer events, and custom tally handler support
//github.com/cosmos/cosmos-sdk => github.com/kava-labs/cosmos-sdk v0.47.10-iavl-v1-kava.1
//github.com/cosmos/cosmos-sdk => github.com/kava-labs/cosmos-sdk v0.50.10-test-patch 5f9239e3147358ef034bfc4d19aacb34e5ea2064
github.com/cosmos/cosmos-sdk => github.com/kava-labs/cosmos-sdk v0.0.0-20241104154228-9f413992bbe2
github.com/cosmos/cosmos-sdk => github.com/kava-labs/cosmos-sdk v0.0.0-20241106234931-e0830e6513bf
//github.com/cosmos/cosmos-sdk => ../cosmos-sdk

//github.com/cosmos/cosmos-sdk/store => cosmossdk.io/store v1.1.1
Expand All @@ -280,7 +281,7 @@ replace (
// Tracking kava-labs/etheremint master branch
// TODO: Tag before release
//github.com/evmos/ethermint => github.com/kava-labs/ethermint v0.21.1-0.20240802224012-586960857184
github.com/evmos/ethermint => github.com/kava-labs/ethermint v0.0.0-20241105003924-46860cc1bf94
github.com/evmos/ethermint => github.com/kava-labs/ethermint v0.0.0-20241106175148-88c60961b867
//github.com/evmos/ethermint => ../ethermint
// See https://github.com/cosmos/cosmos-sdk/pull/10401, https://github.com/cosmos/cosmos-sdk/commit/0592ba6158cd0bf49d894be1cef4faeec59e8320
github.com/gin-gonic/gin => github.com/gin-gonic/gin v1.9.0
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -832,10 +832,10 @@ github.com/kava-labs/cometbft v0.0.0-20241024200036-527d8df9ff12 h1:RqnpnEGEuykj
github.com/kava-labs/cometbft v0.0.0-20241024200036-527d8df9ff12/go.mod h1:5awmm7t/X8LJ+Wd7/TXHcv4hLfFLcexy6fdS9WvOepA=
github.com/kava-labs/cometbft-db v0.0.0-20241007145430-b2740b2e4bed h1:3FNJ3fcD9aA9oOwDphrSEJ8u2kBNj9YoYAwl16UKyv4=
github.com/kava-labs/cometbft-db v0.0.0-20241007145430-b2740b2e4bed/go.mod h1:buPRZKyVp+u5fmwN7tDtOk1zc5xA2z9BJJTy61tNnws=
github.com/kava-labs/cosmos-sdk v0.0.0-20241104154228-9f413992bbe2 h1:rZ3KCm7PZG/IsX2r1L8ZyMhxRL/8FCZ4pGGjPd7obZ0=
github.com/kava-labs/cosmos-sdk v0.0.0-20241104154228-9f413992bbe2/go.mod h1:6Eesrx3ZE7vxBZWpK++30H+Uc7Q4ahQWCL7JKU/LEdU=
github.com/kava-labs/ethermint v0.0.0-20241105003924-46860cc1bf94 h1:kuu2D50jxxmcSB5A3060clrdi8OxoKIBxV61asz9SGU=
github.com/kava-labs/ethermint v0.0.0-20241105003924-46860cc1bf94/go.mod h1:dFh15Ndobz1zWqWcJm9ML+0BnMt5m8gS+MhVUcAGLpg=
github.com/kava-labs/cosmos-sdk v0.0.0-20241106234931-e0830e6513bf h1:qtXGs4gHOdpvFOUfHVzxwhVwlODLlU6wPVDtf3Ald9g=
github.com/kava-labs/cosmos-sdk v0.0.0-20241106234931-e0830e6513bf/go.mod h1:Yf8jj8R5+9NWCbdot0IMId92WeAIF22Thc/pRR2hSoI=
github.com/kava-labs/ethermint v0.0.0-20241106175148-88c60961b867 h1:lr91ivknFlXlu3KXB43H8w0o8dKBwOVjUqV/IazzVs8=
github.com/kava-labs/ethermint v0.0.0-20241106175148-88c60961b867/go.mod h1:dFh15Ndobz1zWqWcJm9ML+0BnMt5m8gS+MhVUcAGLpg=
github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q=
github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00=
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
Expand Down
17 changes: 17 additions & 0 deletions modules checked.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,20 @@ Table:
| swap](x%2Fswap) || |
| validator-vesting](x%2Fvalidator-vesting) || |




E2E tests:


| File | Status | Notes
|----------------------------------------------------------------------------------------|-----|-------------------------------------------------------------------------------------------------|
| e2e_community_update_params_test.go | | TestCommunityUpdateParams_Authority |
| e2e_convert_cosmos_coins_test.go | | TestConvertCosmosCoins_ForbiddenERC20Calls, TestConvertCosmosCoins_ERC20Magic |
| e2e_evm_contracts_test.go || |
| e2e_grpc_client_query_test.go || |
| e2e_grpc_client_util_test.go || |
| e2e_min_fees_test.go || |
| e2e_precompile_genesis_test.go | | TestPrecompileGenesis (potentially, just need rebase with some changes that were not in master) |
| e2e_test.go | | TestIbcTransfer |
| e2e_upgrade_handler_test.go || Not sure what and how it should be tested (skipped) |
25 changes: 13 additions & 12 deletions tests/e2e-ibc/chainconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ package main
import (
"os"

"github.com/strangelove-ventures/interchaintest/v7/chain/cosmos"
"github.com/strangelove-ventures/interchaintest/v7/ibc"
"github.com/strangelove-ventures/interchaintest/v7/testutil"
"github.com/strangelove-ventures/interchaintest/v8/chain/cosmos"
"github.com/strangelove-ventures/interchaintest/v8/ibc"
"github.com/strangelove-ventures/interchaintest/v8/testutil"
)

const (
Expand Down Expand Up @@ -39,14 +39,15 @@ func DefaultKavaChainConfig(chainId string) ibc.ChainConfig {
ChainID: chainId,
Images: []ibc.DockerImage{{Repository: "kava/kava", Version: kavaImageTag, UidGid: "0:0"}},
// Images: []ibc.DockerImage{{Repository: "ghcr.io/strangelove-ventures/heighliner/kava", Version: "v0.26.0", UidGid: "1025:1025"}},
Bin: "kava",
Bech32Prefix: "kava",
Denom: "ukava",
GasPrices: "0ukava", // 0 gas price makes calculating expected balances simpler
GasAdjustment: 1.5,
TrustingPeriod: "168h0m0s",
ModifyGenesis: cosmos.ModifyGenesis(genesis),
ExposeAdditionalPorts: []string{"8545/tcp"},
ConfigFileOverrides: map[string]any{"config/app.toml": appTomlOverrides},
Bin: "kava",
Bech32Prefix: "kava",
Denom: "ukava",
GasPrices: "0ukava", // 0 gas price makes calculating expected balances simpler
GasAdjustment: 1.5,
TrustingPeriod: "168h0m0s",
ModifyGenesis: cosmos.ModifyGenesis(genesis),
HostPortOverride: map[int]int{8545: 8545},
//ExposeAdditionalPorts: []string{"8545/tcp"},
ConfigFileOverrides: map[string]any{"config/app.toml": appTomlOverrides},
}
}
8 changes: 4 additions & 4 deletions tests/e2e-ibc/conformance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ package main_test
import (
"context"
"fmt"
"github.com/strangelove-ventures/interchaintest/v8"
"testing"
"time"

"go.uber.org/zap/zaptest"

"github.com/strangelove-ventures/interchaintest/v7"
"github.com/strangelove-ventures/interchaintest/v7/conformance"
"github.com/strangelove-ventures/interchaintest/v7/ibc"
"github.com/strangelove-ventures/interchaintest/v7/testreporter"
"github.com/strangelove-ventures/interchaintest/v8/conformance"
"github.com/strangelove-ventures/interchaintest/v8/ibc"
"github.com/strangelove-ventures/interchaintest/v8/testreporter"
"github.com/stretchr/testify/require"

kavainterchain "github.com/kava-labs/kava/tests/interchain"
Expand Down
25 changes: 15 additions & 10 deletions tests/e2e-ibc/erc20_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"crypto/sha256"
"encoding/json"
"fmt"
"github.com/strangelove-ventures/interchaintest/v8"
"math/big"
"path/filepath"
"testing"
Expand All @@ -21,10 +22,9 @@ import (

"github.com/ethereum/go-ethereum/ethclient"

"github.com/strangelove-ventures/interchaintest/v7"
"github.com/strangelove-ventures/interchaintest/v7/chain/cosmos"
"github.com/strangelove-ventures/interchaintest/v7/ibc"
"github.com/strangelove-ventures/interchaintest/v7/testreporter"
"github.com/strangelove-ventures/interchaintest/v8/chain/cosmos"
"github.com/strangelove-ventures/interchaintest/v8/ibc"
"github.com/strangelove-ventures/interchaintest/v8/testreporter"

"github.com/kava-labs/kava/app"
"github.com/kava-labs/kava/client/erc20"
Expand Down Expand Up @@ -116,11 +116,14 @@ func TestInterchainErc20(t *testing.T) {
// default coin type to 60 in the chain config.
// we need to fund an account and then all of kava's e2e testutil chain management will work.

rpcUrl, err := ictKava.FullNodes[0].GetHostAddress(ctx, "26657/tcp")
//rpcUrl, err := ictKava.FullNodes[0].GetHostAddress(ctx, "26657/tcp")
rpcUrl := ictKava.FullNodes[0].HostName() + ":26657"
require.NoError(t, err, "failed to find rpc URL")
grpcUrl, err := ictKava.FullNodes[0].GetHostAddress(ctx, "9090/tcp")
//grpcUrl, err := ictKava.FullNodes[0].GetHostAddress(ctx, "9090/tcp")
grpcUrl := ictKava.FullNodes[0].HostName() + ":9090"
require.NoError(t, err, "failed to find grpc URL")
evmUrl, err := ictKava.FullNodes[0].GetHostAddress(ctx, "8545/tcp")
//evmUrl, err := ictKava.FullNodes[0].GetHostAddress(ctx, "8545/tcp")
evmUrl := ictKava.FullNodes[0].HostName() + ":8545"
require.NoError(t, err, "failed to find evm URL")

evmClient, err := ethclient.Dial(evmUrl)
Expand Down Expand Up @@ -199,11 +202,13 @@ func TestInterchainErc20(t *testing.T) {
propId := int64(1)

// 2. Vote on Proposal
err = ictKava.VoteOnProposalAllValidators(ctx, propId, cosmos.ProposalVoteYes)
//err = ictKava.VoteOnProposalAllValidators(ctx, propId, cosmos.ProposalVoteYes)
proIDString := fmt.Sprintf("%d", propId)
err = ictKava.VoteOnProposalAllValidators(ctx, proIDString, cosmos.ProposalVoteYes)
require.NoError(t, err, "failed to submit votes")

height, _ = ictKava.Height(ctx)
_, err = cosmos.PollForProposalStatus(ctx, ictKava, height, height+10, propId, gov1beta1.StatusPassed)
_, err = cosmos.PollForProposalStatus(ctx, ictKava, height, height+10, uint64(propId), gov1beta1.StatusPassed)
require.NoError(t, err, "proposal status did not change to passed in expected number of blocks")

// fund a user & mint them some usdt
Expand All @@ -230,7 +235,7 @@ func TestInterchainErc20(t *testing.T) {
convertTx := util.KavaMsgRequest{
Msgs: []sdk.Msg{&msg},
GasLimit: 4e5,
FeeAmount: sdk.NewCoins(sdk.NewCoin("ukava", sdkmath.NewInt(400))),
FeeAmount: sdk.NewCoins(sdk.NewCoin("ukava", math.NewInt(400))),
Data: "converting sdk coin to erc20",
}
res := user.SignAndBroadcastKavaTx(convertTx)
Expand Down
Loading

0 comments on commit 540f4ae

Please sign in to comment.