1
1
package keeper
2
2
3
3
import (
4
- "cosmossdk.io/math"
5
4
sdkmath "cosmossdk.io/math"
6
5
sdk "github.com/cosmos/cosmos-sdk/types"
7
6
@@ -10,7 +9,7 @@ import (
10
9
11
10
// SetLockedPower sets the new locked power amount of the address to the key
12
11
// This function will override the previous locked amount.
13
- func (k Keeper ) SetLockedPower (ctx sdk.Context , lockerAddr sdk.AccAddress , keyName string , amount math .Int ) error {
12
+ func (k Keeper ) SetLockedPower (ctx sdk.Context , lockerAddr sdk.AccAddress , keyName string , amount sdkmath .Int ) error {
14
13
if ! amount .IsUint64 () {
15
14
return types .ErrInvalidAmount
16
15
}
@@ -69,19 +68,19 @@ func (k Keeper) SetLockedPower(ctx sdk.Context, lockerAddr sdk.AccAddress, keyNa
69
68
}
70
69
71
70
// GetLockedPower returns locked power of the address to the key.
72
- func (k Keeper ) GetLockedPower (ctx sdk.Context , lockerAddr sdk.AccAddress , keyName string ) (math .Int , error ) {
71
+ func (k Keeper ) GetLockedPower (ctx sdk.Context , lockerAddr sdk.AccAddress , keyName string ) (sdkmath .Int , error ) {
73
72
key , err := k .GetKey (ctx , keyName )
74
73
if err != nil {
75
- return math .Int {}, types .ErrKeyNotFound
74
+ return sdkmath .Int {}, types .ErrKeyNotFound
76
75
}
77
76
78
77
if ! key .IsActive {
79
- return math .Int {}, types .ErrKeyNotActive
78
+ return sdkmath .Int {}, types .ErrKeyNotActive
80
79
}
81
80
82
81
lock , err := k .GetLock (ctx , lockerAddr , keyName )
83
82
if err != nil {
84
- return math .Int {}, types .ErrLockNotFound
83
+ return sdkmath .Int {}, types .ErrLockNotFound
85
84
}
86
85
87
86
return lock .Amount , nil
0 commit comments