Skip to content

Commit

Permalink
wip: removed one debug log
Browse files Browse the repository at this point in the history
  • Loading branch information
boodyvo committed Nov 12, 2024
1 parent 17f7b2e commit 96919dd
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 21 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -261,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-20241107170058-27e0ccccc208
github.com/cosmos/cosmos-sdk => github.com/kava-labs/cosmos-sdk v0.0.0-20241108231030-e1beb1437b24
//github.com/cosmos/cosmos-sdk => ../cosmos-sdk

//github.com/cosmos/cosmos-sdk/store => cosmossdk.io/store v1.1.1
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -832,8 +832,8 @@ 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-20241107170058-27e0ccccc208 h1:0Z/vypO858xcywSSzxuDsuFW+CuuxeE+8XR1jyMM7qQ=
github.com/kava-labs/cosmos-sdk v0.0.0-20241107170058-27e0ccccc208/go.mod h1:Yf8jj8R5+9NWCbdot0IMId92WeAIF22Thc/pRR2hSoI=
github.com/kava-labs/cosmos-sdk v0.0.0-20241108231030-e1beb1437b24 h1:89aBfvV1XKbOaGklejzQnAove63jH6TxNL1hT6BIf6U=
github.com/kava-labs/cosmos-sdk v0.0.0-20241108231030-e1beb1437b24/go.mod h1:Yf8jj8R5+9NWCbdot0IMId92WeAIF22Thc/pRR2hSoI=
github.com/kava-labs/ethermint v0.0.0-20241107232649-d8ee91e8450e h1:79mJSoWItAG2gPLOzVfdRJnMWy3vwAPdnahjh3jmUno=
github.com/kava-labs/ethermint v0.0.0-20241107232649-d8ee91e8450e/go.mod h1:Vulovod3ZhLTCfs9RkILIDK8WSDyYhnEp665kTRv530=
github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q=
Expand Down
19 changes: 7 additions & 12 deletions tests/e2e-ibc/chainconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package main

import (
"fmt"
"net"
"os"

"github.com/strangelove-ventures/interchaintest/v8/chain/cosmos"
Expand Down Expand Up @@ -30,29 +29,25 @@ func DefaultKavaChainConfig(chainId string) ibc.ChainConfig {

// genesis param overrides
genesis := []cosmos.GenesisKV{
cosmos.NewGenesisKV("consensus_params.block.max_gas", "20000000"),
//cosmos.NewGenesisKV("consensus_params.block.max_gas", "20000000"),
cosmos.NewGenesisKV("app_state.evm.params.evm_denom", "akava"),
// update for fast voting periods
cosmos.NewGenesisKV("app_state.gov.params.voting_period", "10s"),
cosmos.NewGenesisKV("app_state.gov.params.min_deposit.0.denom", "ukava"),
}
listener, err := net.Listen("tcp", ":0")
if err != nil {
panic(err)
}

randomPort := listener.Addr().(*net.TCPAddr).Port
fmt.Println("Using port:", chainId, randomPort)
fmt.Println("genesis", genesis)

return ibc.ChainConfig{
Type: "cosmos",
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
Bin: "kava",
Bech32Prefix: "kava",
Denom: "ukava",
//GasPrices: "0ukava", // 0 gas price makes calculating expected balances simpler
GasPrices: "100ukava", // 0 gas price makes calculating expected balances simpler
GasAdjustment: 1.5,
TrustingPeriod: "168h0m0s",
ModifyGenesis: cosmos.ModifyGenesis(genesis),
Expand Down
27 changes: 26 additions & 1 deletion tests/e2e-ibc/erc20_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,14 @@ func TestInterchainErc20(t *testing.T) {
app.SetSDKConfig()
ctx := context.Background()

// exportGenesis := os.Getenv("EXPORT_GENESIS_FILE_PATH")
// export EXPORT_GENESIS_FILE_PATH=./e2e_genesis.json
// export EXPORT_GENESIS_CHAIN=kava_8888-1
// exportGenesisChain := os.Getenv("EXPORT_GENESIS_CHAIN")

// Configure & run chains with interchaintest
cf := interchaintest.NewBuiltinChainFactory(zaptest.NewLogger(t), []*interchaintest.ChainSpec{
//{Name: "kava", Version: "local", ChainConfig: kavainterchain.DefaultKavaChainConfig(kavainterchain.KavaTestChainId)},
{Name: "kava", ChainConfig: kavainterchain.DefaultKavaChainConfig(kavainterchain.KavaTestChainId)},
{Name: "gaia", Version: "v15.2.0", ChainConfig: ibc.ChainConfig{GasPrices: "0.0uatom"}},
})
Expand Down Expand Up @@ -85,9 +91,12 @@ func TestInterchainErc20(t *testing.T) {
// Log location
f, err := interchaintest.CreateLogFile(fmt.Sprintf("%d.json", time.Now().Unix()))
require.NoError(t, err)
fmt.Println("f: ", f.Name())
// Reporter/logs
rep := testreporter.NewReporter(f)
fmt.Println("rep: ", rep)
eRep := rep.RelayerExecReporter(t)
fmt.Println("eRep: ", eRep)

// Build interchain
err = ic.Build(ctx, eRep, interchaintest.InterchainBuildOptions{
Expand All @@ -99,10 +108,17 @@ func TestInterchainErc20(t *testing.T) {
)
require.NoError(t, err)

fmt.Println("built interchain", err)

// Create and Fund User Wallets
fundAmount := math.NewInt(1e12)

users := interchaintest.GetAndFundTestUsers(t, ctx, t.Name(), fundAmount, ictKava, gaia)
fmt.Println("users: ", users)
for i, u := range users {
fmt.Println("user: ", i, u, u.KeyName())
}
// kava tx bank send faucet kava1m6477zyykew9ezxl599qc2lurz83elwv5xx332 1000000000000ukava --gas-prices 0ukava --gas-adjustment 1.5 --from faucet --keyring-backend test --output json -y --chain-id kava_8888-1 --home /var/cosmos-chain/kava-1 --node tcp://kava_8888-1-val-0-TestInterchainErc20:26657
kavaUser := users[0]
gaiaUser := users[1]

Expand Down Expand Up @@ -132,7 +148,7 @@ func TestInterchainErc20(t *testing.T) {
fmt.Println("rpcUrl: ", rpcUrl)
//grpcUrl, err := ictKava.FullNodes[0].GetHostAddress(ctx, "9090/tcp")
//require.NoError(t, err, "failed to find grpc URL")
grpcUrl := ictKava.GetHostGRPCAddress()
grpcUrl := "http://" + ictKava.GetHostGRPCAddress()
fmt.Println("grpcUrl: ", grpcUrl)
//evmUrl, err := ictKava.FullNodes[0].GetHostAddress(ctx, "8545/tcp")
require.NoError(t, err, "failed to find evm URL")
Expand Down Expand Up @@ -171,6 +187,7 @@ func TestInterchainErc20(t *testing.T) {
require.NoError(t, err)

deployerKavaAddr := util.EvmToSdkAddress(evmDeployer.Address())
fmt.Println("going to send funds from", kavaUser.KeyName(), "to ", deployerKavaAddr.String())
err = ictKava.SendFunds(ctx, kavaUser.KeyName(), ibc.WalletAmount{
Address: deployerKavaAddr.String(),
Denom: "ukava",
Expand All @@ -190,6 +207,10 @@ func TestInterchainErc20(t *testing.T) {

deployer := kava.GetAccount("whale")

balance := kava.QuerySdkForBalances(deployer.SdkAddress)

fmt.Println("balance", balance)

// deploy ERC20 contract
usdtAddr, deployTx, usdt, err := erc20.DeployErc20(
deployer.EvmAuth, kava.EvmClient,
Expand Down Expand Up @@ -229,6 +250,7 @@ func TestInterchainErc20(t *testing.T) {
Deposit: "10000000ukava",
}

fmt.Println("kavaUser", kavaUser.KeyName())
_, err = legacyParamChangeProposal(ictKava.FullNodes[0], ctx, kavaUser.KeyName(), &paramChange)
require.NoError(t, err, "error submitting param change proposal tx")

Expand Down Expand Up @@ -325,5 +347,8 @@ func legacyParamChangeProposal(tn *cosmos.ChainNode, ctx context.Context, keyNam
proposalPath,
}

fmt.Println("command: ", command)
fmt.Println("keyName: ", keyName)

return tn.ExecTx(ctx, keyName, command...)
}
2 changes: 1 addition & 1 deletion tests/e2e-ibc/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ replace (
github.com/cometbft/cometbft-db => github.com/kava-labs/cometbft-db v0.0.0-20241007145430-b2740b2e4bed

//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-20241106161732-b6368700cfeb
github.com/cosmos/cosmos-sdk => github.com/kava-labs/cosmos-sdk v0.0.0-20241108231030-e1beb1437b24
// 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/store => cosmossdk.io/store v1.1.1
Expand Down
6 changes: 2 additions & 4 deletions tests/e2e-ibc/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -832,8 +832,8 @@ github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7V
github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM=
github.com/kava-labs/cometbft v0.0.0-20241024200036-527d8df9ff12 h1:RqnpnEGEuykjY3XWSLMuMwjUOiJ6cr7gSznAW/tgTQ4=
github.com/kava-labs/cometbft v0.0.0-20241024200036-527d8df9ff12/go.mod h1:5awmm7t/X8LJ+Wd7/TXHcv4hLfFLcexy6fdS9WvOepA=
github.com/kava-labs/cosmos-sdk v0.0.0-20241106161732-b6368700cfeb h1:VzNaZNKhn3Q7FSu7A4cC3uzH9Oq3BUfa0llWFtXTVBE=
github.com/kava-labs/cosmos-sdk v0.0.0-20241106161732-b6368700cfeb/go.mod h1:Yf8jj8R5+9NWCbdot0IMId92WeAIF22Thc/pRR2hSoI=
github.com/kava-labs/cosmos-sdk v0.0.0-20241108231030-e1beb1437b24 h1:89aBfvV1XKbOaGklejzQnAove63jH6TxNL1hT6BIf6U=
github.com/kava-labs/cosmos-sdk v0.0.0-20241108231030-e1beb1437b24/go.mod h1:Yf8jj8R5+9NWCbdot0IMId92WeAIF22Thc/pRR2hSoI=
github.com/kava-labs/ethermint v0.0.0-20241105193811-2b40405cecd5 h1:bYKOKyjnntnkc+f5gyTmjKCpqKl1HFjcOMzJjo9s2yQ=
github.com/kava-labs/ethermint v0.0.0-20241105193811-2b40405cecd5/go.mod h1:dFh15Ndobz1zWqWcJm9ML+0BnMt5m8gS+MhVUcAGLpg=
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 h1:Z9n2FFNUXsshfwJMBgNA0RU6/i7WVaAegv3PtuIHPMs=
Expand Down Expand Up @@ -1144,8 +1144,6 @@ github.com/spf13/viper v1.19.0 h1:RWq5SEjt8o25SROyN3z2OrDB9l7RPd3lwTWU8EcEdcI=
github.com/spf13/viper v1.19.0/go.mod h1:GQUN9bilAbhU/jgc1bKs99f/suXKeUMct8Adx5+Ntkg=
github.com/status-im/keycard-go v0.2.0 h1:QDLFswOQu1r5jsycloeQh3bVU8n/NatHHaZobtDnDzA=
github.com/status-im/keycard-go v0.2.0/go.mod h1:wlp8ZLbsmrF6g6WjugPAx+IzoLrkdf9+mHxBEeo3Hbg=
github.com/strangelove-ventures/interchaintest/v8 v8.2.0 h1:EZXPvZXL1y/kvh9XI04A2stL+2UMvykhNUv28euRnL8=
github.com/strangelove-ventures/interchaintest/v8 v8.2.0/go.mod h1:pupV0YN3A56/u9kHj9U1F8MdDUEolBIn05F0W1q/0oI=
github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw=
github.com/streadway/amqp v0.0.0-20190827072141-edfb9018d271/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw=
github.com/streadway/handy v0.0.0-20190108123426-d5acb3125c2a/go.mod h1:qNTQ5P5JnDBl6z3cMAg/SywNDC5ABu5ApDIw6lUbRmI=
Expand Down
2 changes: 2 additions & 0 deletions tests/util/sdksigner.go
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,8 @@ func (s *KavaSigner) Run(requests <-chan KavaMsgRequest) (<-chan KavaMsgResponse
continue
}

fmt.Println("going to build transaction", currentRequest)
fmt.Println("going to build transaction with gas limit", currentRequest.GasLimit)
txBuilder := s.encodingConfig.TxConfig.NewTxBuilder()
txBuilder.SetMsgs(currentRequest.Msgs...)
txBuilder.SetGasLimit(currentRequest.GasLimit)
Expand Down

0 comments on commit 96919dd

Please sign in to comment.