Skip to content

Commit 9f2d8e4

Browse files
committed
fix function name
1 parent 10856bb commit 9f2d8e4

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

x/restake/keeper/grpc_query.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ func (k Querier) Rewards(
7171
return nil, err
7272
}
7373

74-
keyStore := prefix.NewStore(ctx.KVStore(k.storeKey), types.LocksStoreKey(addr))
74+
keyStore := prefix.NewStore(ctx.KVStore(k.storeKey), types.LocksByAddressStoreKey(addr))
7575

7676
filteredRewards, pageRes, err := query.GenericFilteredPaginate(
7777
k.cdc,
@@ -124,7 +124,7 @@ func (k Querier) Locks(
124124
return nil, err
125125
}
126126

127-
keyStore := prefix.NewStore(ctx.KVStore(k.storeKey), types.LocksStoreKey(addr))
127+
keyStore := prefix.NewStore(ctx.KVStore(k.storeKey), types.LocksByAddressStoreKey(addr))
128128

129129
filteredLocks, pageRes, err := query.GenericFilteredPaginate(
130130
k.cdc,

x/restake/keeper/keeper_lock.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ func (k Keeper) GetLocksIterator(ctx sdk.Context) sdk.Iterator {
114114

115115
// GetLocksByAddressIterator gets iterator of locks of the speicfic address.
116116
func (k Keeper) GetLocksByAddressIterator(ctx sdk.Context, addr sdk.AccAddress) sdk.Iterator {
117-
return sdk.KVStorePrefixIterator(ctx.KVStore(k.storeKey), types.LocksStoreKey(addr))
117+
return sdk.KVStorePrefixIterator(ctx.KVStore(k.storeKey), types.LocksByAddressStoreKey(addr))
118118
}
119119

120120
// GetLocksByAddress gets all locks of the address.

x/restake/types/keys.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,14 @@ func KeyStoreKey(keyName string) []byte {
3838
return append(KeyStoreKeyPrefix, []byte(keyName)...)
3939
}
4040

41-
// LocksStoreKey returns the key to retrieve all locks of an address from the store.
42-
func LocksStoreKey(addr sdk.AccAddress) []byte {
41+
// LocksByAddressStoreKey returns the key to retrieve all locks of an address from the store.
42+
func LocksByAddressStoreKey(addr sdk.AccAddress) []byte {
4343
return append(LockStoreKeyPrefix, address.MustLengthPrefix(addr)...)
4444
}
4545

4646
// LockStoreKey returns the key to retrieve a lock of an address and the key from the store.
4747
func LockStoreKey(addr sdk.AccAddress, keyName string) []byte {
48-
return append(LocksStoreKey(addr), []byte(keyName)...)
48+
return append(LocksByAddressStoreKey(addr), []byte(keyName)...)
4949
}
5050

5151
// LocksByAmountIndexKey returns the key to retrieve all locks of an address ordering by locked amount from the store.

x/restake/types/keys_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@ func TestKeyStoreKey(t *testing.T) {
1616
require.Equal(t, expect, KeyStoreKey(keyName))
1717
}
1818

19-
func TestLocksStoreKey(t *testing.T) {
19+
func TestLocksByAddressStoreKey(t *testing.T) {
2020
hexAddress := "b80f2a5df7d5710b15622d1a9f1e3830ded5bda8"
2121
acc, err := sdk.AccAddressFromHexUnsafe(hexAddress)
2222
require.NoError(t, err)
2323

2424
expect, err := hex.DecodeString("02" + "14" + hexAddress)
2525
require.NoError(t, err)
26-
require.Equal(t, expect, LocksStoreKey(acc))
26+
require.Equal(t, expect, LocksByAddressStoreKey(acc))
2727
}
2828

2929
func TestLockStoreKey(t *testing.T) {

0 commit comments

Comments
 (0)