From fd59a37798260a63bdd28e874280aef79e407da7 Mon Sep 17 00:00:00 2001 From: Sai Kumar Date: Sat, 23 Apr 2022 21:23:51 +0530 Subject: [PATCH] fix : fix the conflicts --- gql/status.go | 21 +++++++++++---------- x/auction/client/testutil/common.go | 7 +++++-- x/auction/client/testutil/grpc.go | 2 +- x/auction/keeper/keeper.go | 6 +++--- x/bond/client/testutil/grpc.go | 3 ++- x/bond/client/testutil/query.go | 2 +- x/bond/keeper/keeper.go | 6 ++++-- x/nameservice/client/testutil/grpc.go | 2 +- x/nameservice/client/testutil/tx.go | 2 +- x/nameservice/keeper/keeper.go | 5 +++-- x/nameservice/keeper/record_keeper.go | 7 ++++--- 11 files changed, 36 insertions(+), 27 deletions(-) diff --git a/gql/status.go b/gql/status.go index b774a0fc..bbc07b47 100644 --- a/gql/status.go +++ b/gql/status.go @@ -2,15 +2,16 @@ package gql import ( "context" - "github.com/cosmos/cosmos-sdk/client" "os" "os/exec" "strconv" "strings" + + "github.com/cosmos/cosmos-sdk/client" ) // NodeDataPath is the path to the ethermintd data folder. -var NodeDataPath = os.ExpandEnv("$HOME/.ethermintd/data") +var NodeDataPath = os.ExpandEnv("$HOME/.chibaclonkd/data") func getStatusInfo(client client.Context) (*NodeInfo, *SyncInfo, *ValidatorInfo, error) { nodeClient, err := client.GetNode() @@ -48,17 +49,17 @@ func getNetInfo(client client.Context) (string, []*PeerInfo, error) { return "", nil, err } - peers := netInfo.Peers - peersInfo := make([]*PeerInfo, len(peers)) - for index, peer := range peers { + peersInfo := make([]*PeerInfo, netInfo.NPeers) + // TODO: find a way to get the peer information from nodeClient + for index, peer := range netInfo.Peers { peersInfo[index] = &PeerInfo{ Node: &NodeInfo{ - ID: string(peer.NodeInfo.ID()), - Moniker: peer.NodeInfo.Moniker, - Network: peer.NodeInfo.Network, + ID: string(peer.ID), + // Moniker: peer.Node.Moniker, + // Network: peer.Node.Network, }, - IsOutbound: peer.IsOutbound, - RemoteIP: peer.RemoteIP, + // IsOutbound: peer.IsOutbound, + // RemoteIP: peer.RemoteIP, } } diff --git a/x/auction/client/testutil/common.go b/x/auction/client/testutil/common.go index b937d66c..e010b523 100644 --- a/x/auction/client/testutil/common.go +++ b/x/auction/client/testutil/common.go @@ -61,9 +61,12 @@ func (s *IntegrationTestSuite) createAccountWithBalance(accountName string, acco info, _, err := val.ClientCtx.Keyring.NewMnemonic(accountName, keyring.English, sdk.FullFundraiserPath, keyring.DefaultBIP39Passphrase, hd.EthSecp256k1) sr.NoError(err) - val.ClientCtx.Keyring.SavePubKey(accountName, info.GetPubKey(), hd.EthSecp256k1Type) + pubKey, err := info.GetPubKey() + sr.NoError(err) - newAddr := sdk.AccAddress(info.GetPubKey().Address()) + val.ClientCtx.Keyring.SaveOfflineKey(accountName, pubKey) + + newAddr, _ := info.GetAddress() _, err = banktestutil.MsgSendExec( val.ClientCtx, val.Address, diff --git a/x/auction/client/testutil/grpc.go b/x/auction/client/testutil/grpc.go index 03037a7c..686367c5 100644 --- a/x/auction/client/testutil/grpc.go +++ b/x/auction/client/testutil/grpc.go @@ -3,7 +3,7 @@ package testutil import ( "fmt" - "github.com/cosmos/cosmos-sdk/types/rest" + "github.com/cosmos/cosmos-sdk/testutil/rest" auctiontypes "github.com/tharsis/ethermint/x/auction/types" ) diff --git a/x/auction/keeper/keeper.go b/x/auction/keeper/keeper.go index 97bf8912..120978fc 100644 --- a/x/auction/keeper/keeper.go +++ b/x/auction/keeper/keeper.go @@ -7,12 +7,12 @@ import ( "time" "github.com/cosmos/cosmos-sdk/codec" + storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" auth "github.com/cosmos/cosmos-sdk/x/auth/keeper" bank "github.com/cosmos/cosmos-sdk/x/bank/keeper" params "github.com/cosmos/cosmos-sdk/x/params/types" - "github.com/tharsis/ethermint/x/auction/types" wnsUtils "github.com/tharsis/ethermint/utils" @@ -43,7 +43,7 @@ type Keeper struct { // Track auction usage in other cosmos-sdk modules (more like a usage tracker). usageKeepers []types.AuctionUsageKeeper - storeKey sdk.StoreKey // Unexposed key to access store from sdk.Context + storeKey storetypes.StoreKey // Unexposed key to access store from sdk.Context cdc codec.BinaryCodec // The wire codec for binary encoding/decoding. @@ -58,7 +58,7 @@ type AuctionClientKeeper interface { } // NewKeeper creates new instances of the auction Keeper -func NewKeeper(accountKeeper auth.AccountKeeper, bankKeeper bank.Keeper, storeKey sdk.StoreKey, cdc codec.BinaryCodec, ps params.Subspace) Keeper { +func NewKeeper(accountKeeper auth.AccountKeeper, bankKeeper bank.Keeper, storeKey storetypes.StoreKey, cdc codec.BinaryCodec, ps params.Subspace) Keeper { if !ps.HasKeyTable() { ps = ps.WithKeyTable(types.ParamKeyTable()) } diff --git a/x/bond/client/testutil/grpc.go b/x/bond/client/testutil/grpc.go index da249ff2..f5cbddf5 100644 --- a/x/bond/client/testutil/grpc.go +++ b/x/bond/client/testutil/grpc.go @@ -2,8 +2,9 @@ package testutil import ( "fmt" + clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" - "github.com/cosmos/cosmos-sdk/types/rest" + "github.com/cosmos/cosmos-sdk/testutil/rest" tmcli "github.com/tendermint/tendermint/libs/cli" "github.com/tharsis/ethermint/x/bond/client/cli" bondtypes "github.com/tharsis/ethermint/x/bond/types" diff --git a/x/bond/client/testutil/query.go b/x/bond/client/testutil/query.go index 3e52c7ba..7aace2b9 100644 --- a/x/bond/client/testutil/query.go +++ b/x/bond/client/testutil/query.go @@ -89,7 +89,7 @@ func (s *IntegrationTestSuite) createAccountWithBalance(accountName string) { info, _, err := val.ClientCtx.Keyring.NewMnemonic(accountName, keyring.English, sdk.FullFundraiserPath, keyring.DefaultBIP39Passphrase, hd.Secp256k1) sr.NoError(err) - newAddr := sdk.AccAddress(info.GetPubKey().Address()) + newAddr, _ := info.GetAddress() _, err = banktestutil.MsgSendExec( val.ClientCtx, val.Address, diff --git a/x/bond/keeper/keeper.go b/x/bond/keeper/keeper.go index e1c785bf..11b22918 100644 --- a/x/bond/keeper/keeper.go +++ b/x/bond/keeper/keeper.go @@ -4,7 +4,9 @@ import ( "crypto/sha256" "encoding/hex" "fmt" + "github.com/cosmos/cosmos-sdk/codec" + storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" auth "github.com/cosmos/cosmos-sdk/x/auth/keeper" @@ -29,7 +31,7 @@ type Keeper struct { // Track bond usage in other cosmos-sdk modules (more like a usage tracker). usageKeepers []types.BondUsageKeeper - storeKey sdk.StoreKey + storeKey storetypes.StoreKey cdc codec.BinaryCodec @@ -37,7 +39,7 @@ type Keeper struct { } // NewKeeper creates new instances of the bond Keeper -func NewKeeper(cdc codec.BinaryCodec, accountKeeper auth.AccountKeeper, bankKeeper bank.Keeper, usageKeepers []types.BondUsageKeeper, storeKey sdk.StoreKey, ps paramtypes.Subspace) Keeper { +func NewKeeper(cdc codec.BinaryCodec, accountKeeper auth.AccountKeeper, bankKeeper bank.Keeper, usageKeepers []types.BondUsageKeeper, storeKey storetypes.StoreKey, ps paramtypes.Subspace) Keeper { // set KeyTable if it has not already been set if !ps.HasKeyTable() { ps = ps.WithKeyTable(types.ParamKeyTable()) diff --git a/x/nameservice/client/testutil/grpc.go b/x/nameservice/client/testutil/grpc.go index fd7a16e3..2256cee6 100644 --- a/x/nameservice/client/testutil/grpc.go +++ b/x/nameservice/client/testutil/grpc.go @@ -8,8 +8,8 @@ import ( "github.com/cosmos/cosmos-sdk/client/flags" clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" + "github.com/cosmos/cosmos-sdk/testutil/rest" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/rest" tmcli "github.com/tendermint/tendermint/libs/cli" "github.com/tharsis/ethermint/x/nameservice/client/cli" nstypes "github.com/tharsis/ethermint/x/nameservice/types" diff --git a/x/nameservice/client/testutil/tx.go b/x/nameservice/client/testutil/tx.go index d45ecd9b..963fc542 100644 --- a/x/nameservice/client/testutil/tx.go +++ b/x/nameservice/client/testutil/tx.go @@ -78,7 +78,7 @@ func (s *IntegrationTestSuite) createAccountWithBalance(accountName string) { sr.NoError(err) // account key - newAddr := sdk.AccAddress(info.GetPubKey().Address()) + newAddr, _ := info.GetAddress() _, err = banktestutil.MsgSendExec( val.ClientCtx, val.Address, diff --git a/x/nameservice/keeper/keeper.go b/x/nameservice/keeper/keeper.go index f5fbeef9..c4d1c7a9 100644 --- a/x/nameservice/keeper/keeper.go +++ b/x/nameservice/keeper/keeper.go @@ -8,6 +8,7 @@ import ( "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/codec/legacy" + storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" auth "github.com/cosmos/cosmos-sdk/x/auth/keeper" @@ -63,7 +64,7 @@ type Keeper struct { bondKeeper bondkeeper.Keeper auctionKeeper auctionkeeper.Keeper - storeKey sdk.StoreKey // Unexposed key to access store from sdk.Context + storeKey storetypes.StoreKey // Unexposed key to access store from sdk.Context cdc codec.BinaryCodec // The wire codec for binary encoding/decoding. @@ -72,7 +73,7 @@ type Keeper struct { // NewKeeper creates new instances of the nameservice Keeper func NewKeeper(cdc codec.BinaryCodec, accountKeeper auth.AccountKeeper, bankKeeper bank.Keeper, recordKeeper RecordKeeper, - bondKeeper bondkeeper.Keeper, auctionKeeper auctionkeeper.Keeper, storeKey sdk.StoreKey, ps paramtypes.Subspace) Keeper { + bondKeeper bondkeeper.Keeper, auctionKeeper auctionkeeper.Keeper, storeKey storetypes.StoreKey, ps paramtypes.Subspace) Keeper { // set KeyTable if it has not already been set if !ps.HasKeyTable() { ps = ps.WithKeyTable(types.ParamKeyTable()) diff --git a/x/nameservice/keeper/record_keeper.go b/x/nameservice/keeper/record_keeper.go index 2a856e32..8c390498 100644 --- a/x/nameservice/keeper/record_keeper.go +++ b/x/nameservice/keeper/record_keeper.go @@ -5,6 +5,7 @@ import ( "time" "github.com/cosmos/cosmos-sdk/codec" + storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" auctionkeeper "github.com/tharsis/ethermint/x/auction/keeper" @@ -16,8 +17,8 @@ import ( // RecordKeeper exposes the bare minimal read-only API for other modules. type RecordKeeper struct { auctionKeeper auctionkeeper.Keeper - storeKey sdk.StoreKey // Unexposed key to access store from sdk.Context - cdc codec.BinaryCodec // The wire codec for binary encoding/decoding. + storeKey storetypes.StoreKey // Unexposed key to access store from sdk.Context + cdc codec.BinaryCodec // The wire codec for binary encoding/decoding. } func (k RecordKeeper) UsesAuction(ctx sdk.Context, auctionID string) bool { @@ -123,7 +124,7 @@ func (k Keeper) RemoveBondToRecordIndexEntry(ctx sdk.Context, bondID string, id } // NewRecordKeeper creates new instances of the nameservice RecordKeeper -func NewRecordKeeper(auctionKeeper auctionkeeper.Keeper, storeKey sdk.StoreKey, cdc codec.BinaryCodec) RecordKeeper { +func NewRecordKeeper(auctionKeeper auctionkeeper.Keeper, storeKey storetypes.StoreKey, cdc codec.BinaryCodec) RecordKeeper { return RecordKeeper{ auctionKeeper: auctionKeeper, storeKey: storeKey,