fix : fix the conflicts

This commit is contained in:
Sai Kumar 2022-04-23 21:23:51 +05:30
parent cf0be98f9b
commit fd59a37798
11 changed files with 36 additions and 27 deletions

View File

@ -2,15 +2,16 @@ package gql
import ( import (
"context" "context"
"github.com/cosmos/cosmos-sdk/client"
"os" "os"
"os/exec" "os/exec"
"strconv" "strconv"
"strings" "strings"
"github.com/cosmos/cosmos-sdk/client"
) )
// NodeDataPath is the path to the ethermintd data folder. // 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) { func getStatusInfo(client client.Context) (*NodeInfo, *SyncInfo, *ValidatorInfo, error) {
nodeClient, err := client.GetNode() nodeClient, err := client.GetNode()
@ -48,17 +49,17 @@ func getNetInfo(client client.Context) (string, []*PeerInfo, error) {
return "", nil, err return "", nil, err
} }
peers := netInfo.Peers peersInfo := make([]*PeerInfo, netInfo.NPeers)
peersInfo := make([]*PeerInfo, len(peers)) // TODO: find a way to get the peer information from nodeClient
for index, peer := range peers { for index, peer := range netInfo.Peers {
peersInfo[index] = &PeerInfo{ peersInfo[index] = &PeerInfo{
Node: &NodeInfo{ Node: &NodeInfo{
ID: string(peer.NodeInfo.ID()), ID: string(peer.ID),
Moniker: peer.NodeInfo.Moniker, // Moniker: peer.Node.Moniker,
Network: peer.NodeInfo.Network, // Network: peer.Node.Network,
}, },
IsOutbound: peer.IsOutbound, // IsOutbound: peer.IsOutbound,
RemoteIP: peer.RemoteIP, // RemoteIP: peer.RemoteIP,
} }
} }

View File

@ -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) info, _, err := val.ClientCtx.Keyring.NewMnemonic(accountName, keyring.English, sdk.FullFundraiserPath, keyring.DefaultBIP39Passphrase, hd.EthSecp256k1)
sr.NoError(err) 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( _, err = banktestutil.MsgSendExec(
val.ClientCtx, val.ClientCtx,
val.Address, val.Address,

View File

@ -3,7 +3,7 @@ package testutil
import ( import (
"fmt" "fmt"
"github.com/cosmos/cosmos-sdk/types/rest" "github.com/cosmos/cosmos-sdk/testutil/rest"
auctiontypes "github.com/tharsis/ethermint/x/auction/types" auctiontypes "github.com/tharsis/ethermint/x/auction/types"
) )

View File

@ -7,12 +7,12 @@ import (
"time" "time"
"github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/codec"
storetypes "github.com/cosmos/cosmos-sdk/store/types"
sdk "github.com/cosmos/cosmos-sdk/types" sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
auth "github.com/cosmos/cosmos-sdk/x/auth/keeper" auth "github.com/cosmos/cosmos-sdk/x/auth/keeper"
bank "github.com/cosmos/cosmos-sdk/x/bank/keeper" bank "github.com/cosmos/cosmos-sdk/x/bank/keeper"
params "github.com/cosmos/cosmos-sdk/x/params/types" params "github.com/cosmos/cosmos-sdk/x/params/types"
"github.com/tharsis/ethermint/x/auction/types" "github.com/tharsis/ethermint/x/auction/types"
wnsUtils "github.com/tharsis/ethermint/utils" 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). // Track auction usage in other cosmos-sdk modules (more like a usage tracker).
usageKeepers []types.AuctionUsageKeeper 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. 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 // 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() { if !ps.HasKeyTable() {
ps = ps.WithKeyTable(types.ParamKeyTable()) ps = ps.WithKeyTable(types.ParamKeyTable())
} }

View File

@ -2,8 +2,9 @@ package testutil
import ( import (
"fmt" "fmt"
clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" 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" tmcli "github.com/tendermint/tendermint/libs/cli"
"github.com/tharsis/ethermint/x/bond/client/cli" "github.com/tharsis/ethermint/x/bond/client/cli"
bondtypes "github.com/tharsis/ethermint/x/bond/types" bondtypes "github.com/tharsis/ethermint/x/bond/types"

View File

@ -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) info, _, err := val.ClientCtx.Keyring.NewMnemonic(accountName, keyring.English, sdk.FullFundraiserPath, keyring.DefaultBIP39Passphrase, hd.Secp256k1)
sr.NoError(err) sr.NoError(err)
newAddr := sdk.AccAddress(info.GetPubKey().Address()) newAddr, _ := info.GetAddress()
_, err = banktestutil.MsgSendExec( _, err = banktestutil.MsgSendExec(
val.ClientCtx, val.ClientCtx,
val.Address, val.Address,

View File

@ -4,7 +4,9 @@ import (
"crypto/sha256" "crypto/sha256"
"encoding/hex" "encoding/hex"
"fmt" "fmt"
"github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/codec"
storetypes "github.com/cosmos/cosmos-sdk/store/types"
sdk "github.com/cosmos/cosmos-sdk/types" sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
auth "github.com/cosmos/cosmos-sdk/x/auth/keeper" 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). // Track bond usage in other cosmos-sdk modules (more like a usage tracker).
usageKeepers []types.BondUsageKeeper usageKeepers []types.BondUsageKeeper
storeKey sdk.StoreKey storeKey storetypes.StoreKey
cdc codec.BinaryCodec cdc codec.BinaryCodec
@ -37,7 +39,7 @@ type Keeper struct {
} }
// NewKeeper creates new instances of the bond Keeper // 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 // set KeyTable if it has not already been set
if !ps.HasKeyTable() { if !ps.HasKeyTable() {
ps = ps.WithKeyTable(types.ParamKeyTable()) ps = ps.WithKeyTable(types.ParamKeyTable())

View File

@ -8,8 +8,8 @@ import (
"github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/flags"
clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli"
"github.com/cosmos/cosmos-sdk/testutil/rest"
sdk "github.com/cosmos/cosmos-sdk/types" sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/rest"
tmcli "github.com/tendermint/tendermint/libs/cli" tmcli "github.com/tendermint/tendermint/libs/cli"
"github.com/tharsis/ethermint/x/nameservice/client/cli" "github.com/tharsis/ethermint/x/nameservice/client/cli"
nstypes "github.com/tharsis/ethermint/x/nameservice/types" nstypes "github.com/tharsis/ethermint/x/nameservice/types"

View File

@ -78,7 +78,7 @@ func (s *IntegrationTestSuite) createAccountWithBalance(accountName string) {
sr.NoError(err) sr.NoError(err)
// account key // account key
newAddr := sdk.AccAddress(info.GetPubKey().Address()) newAddr, _ := info.GetAddress()
_, err = banktestutil.MsgSendExec( _, err = banktestutil.MsgSendExec(
val.ClientCtx, val.ClientCtx,
val.Address, val.Address,

View File

@ -8,6 +8,7 @@ import (
"github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/codec"
"github.com/cosmos/cosmos-sdk/codec/legacy" "github.com/cosmos/cosmos-sdk/codec/legacy"
storetypes "github.com/cosmos/cosmos-sdk/store/types"
sdk "github.com/cosmos/cosmos-sdk/types" sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
auth "github.com/cosmos/cosmos-sdk/x/auth/keeper" auth "github.com/cosmos/cosmos-sdk/x/auth/keeper"
@ -63,7 +64,7 @@ type Keeper struct {
bondKeeper bondkeeper.Keeper bondKeeper bondkeeper.Keeper
auctionKeeper auctionkeeper.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. 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 // NewKeeper creates new instances of the nameservice Keeper
func NewKeeper(cdc codec.BinaryCodec, accountKeeper auth.AccountKeeper, bankKeeper bank.Keeper, recordKeeper RecordKeeper, 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 // set KeyTable if it has not already been set
if !ps.HasKeyTable() { if !ps.HasKeyTable() {
ps = ps.WithKeyTable(types.ParamKeyTable()) ps = ps.WithKeyTable(types.ParamKeyTable())

View File

@ -5,6 +5,7 @@ import (
"time" "time"
"github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/codec"
storetypes "github.com/cosmos/cosmos-sdk/store/types"
sdk "github.com/cosmos/cosmos-sdk/types" sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
auctionkeeper "github.com/tharsis/ethermint/x/auction/keeper" auctionkeeper "github.com/tharsis/ethermint/x/auction/keeper"
@ -16,8 +17,8 @@ import (
// RecordKeeper exposes the bare minimal read-only API for other modules. // RecordKeeper exposes the bare minimal read-only API for other modules.
type RecordKeeper struct { type RecordKeeper struct {
auctionKeeper auctionkeeper.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. cdc codec.BinaryCodec // The wire codec for binary encoding/decoding.
} }
func (k RecordKeeper) UsesAuction(ctx sdk.Context, auctionID string) bool { 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 // 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{ return RecordKeeper{
auctionKeeper: auctionKeeper, auctionKeeper: auctionKeeper,
storeKey: storeKey, storeKey: storeKey,