Skip to content

Commit

Permalink
use sdkConfig
Browse files Browse the repository at this point in the history
  • Loading branch information
ajansari95 committed Jun 2, 2023
1 parent 5a82c47 commit 2f1c666
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
3 changes: 1 addition & 2 deletions x/interchainstaking/keeper/grpc_query.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import (
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"

config "github.com/ingenuity-build/quicksilver/cmd/config"
"github.com/ingenuity-build/quicksilver/utils"
"github.com/ingenuity-build/quicksilver/x/interchainstaking/types"
)
Expand Down Expand Up @@ -265,7 +264,7 @@ func (k *Keeper) MappedAccounts(c context.Context, req *types.QueryMappedAccount
ctx := sdk.UnwrapSDKContext(c)

remoteAddressMap := make(map[string][]byte)
addrBytes, err := utils.AccAddressFromBech32(req.Address, config.Bech32Prefix)
addrBytes, err := utils.AccAddressFromBech32(req.Address, sdk.GetConfig().GetBech32AccountAddrPrefix())
if err != nil {
return nil, status.Error(codes.InvalidArgument, "Invalid Address")
}
Expand Down
8 changes: 4 additions & 4 deletions x/interchainstaking/keeper/grpc_query_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -836,7 +836,7 @@ func (s *KeeperTestSuite) TestKeeper_RedelegationRecords() {

func (s *KeeperTestSuite) TestKeeper_MappedAccounts() {
icsKeeper := s.GetQuicksilverApp(s.chainA).InterchainstakingKeeper
usrAddress1, _ := utils.AccAddressFromBech32("quick17v9kk34km3w6hdjs2sn5s5qjdu2zrm0m3rgtmq", "quick")
usrAddress1, _ := utils.AccAddressFromBech32("cosmos1vwh8mkgefn73vpsv7td68l3tynayck07engahn", "cosmos")
ctx := s.chainA.GetContext()

tests := []struct {
Expand Down Expand Up @@ -869,7 +869,7 @@ func (s *KeeperTestSuite) TestKeeper_MappedAccounts() {
}
icsKeeper.SetZone(ctx, &zone)
},
&types.QueryMappedAccountsRequest{Address: "quick17v9kk34km3w6hdjs2sn5s5qjdu2zrm0m3rgtmq"},
&types.QueryMappedAccountsRequest{Address: "cosmos1vwh8mkgefn73vpsv7td68l3tynayck07engahn"},
false,
0,
},
Expand All @@ -892,7 +892,7 @@ func (s *KeeperTestSuite) TestKeeper_MappedAccounts() {

icsKeeper.SetRemoteAddressMap(ctx, usrAddress1, utils.GenerateRandomHash(), zone.ChainId)
},
&types.QueryMappedAccountsRequest{Address: "quick17v9kk34km3w6hdjs2sn5s5qjdu2zrm0m3rgtmq"},
&types.QueryMappedAccountsRequest{Address: "cosmos1vwh8mkgefn73vpsv7td68l3tynayck07engahn"},
false,
1,
},
Expand Down Expand Up @@ -929,7 +929,7 @@ func (s *KeeperTestSuite) TestKeeper_MappedAccounts() {

icsKeeper.SetRemoteAddressMap(ctx, usrAddress1, utils.GenerateRandomHash(), zone2.ChainId)
},
&types.QueryMappedAccountsRequest{Address: "quick17v9kk34km3w6hdjs2sn5s5qjdu2zrm0m3rgtmq"},
&types.QueryMappedAccountsRequest{Address: "cosmos1vwh8mkgefn73vpsv7td68l3tynayck07engahn"},
false,
2,
},
Expand Down

0 comments on commit 2f1c666

Please sign in to comment.