@@ -11,6 +11,7 @@ import (
11
11
12
12
func (suite * KeeperTestSuite ) TestSetLockedPower () {
13
13
ctx := suite .ctx
14
+ suite .setupState ()
14
15
15
16
// error case - amount is not uint64
16
17
err := suite .restakeKeeper .SetLockedPower (ctx , ValidAddress1 , KeyWithRewards , sdkmath .NewInt (- 5 ))
@@ -21,7 +22,7 @@ func (suite *KeeperTestSuite) TestSetLockedPower() {
21
22
suite .Require ().Error (err )
22
23
23
24
// error case - key is deactivated
24
- _ , err = suite .restakeKeeper .GetLockedPower (ctx , ValidAddress2 , InactiveKey )
25
+ err = suite .restakeKeeper .SetLockedPower (ctx , ValidAddress1 , InactiveKey , sdkmath . NewInt ( 10 ) )
25
26
suite .Require ().Error (err )
26
27
27
28
// success cases
@@ -41,8 +42,8 @@ func (suite *KeeperTestSuite) TestSetLockedPower() {
41
42
"success case - no previous lock with empty rewards" ,
42
43
func () {
43
44
preKey = types.Key {
44
- Name : KeyWithRewards ,
45
- PoolAddress : KeyWithRewardsPoolAddress .String (),
45
+ Name : KeyWithoutRewards ,
46
+ PoolAddress : KeyWithoutRewardsPoolAddress .String (),
46
47
IsActive : true ,
47
48
RewardPerPowers : nil ,
48
49
TotalPower : sdkmath .NewInt (100 ),
@@ -56,7 +57,7 @@ func (suite *KeeperTestSuite) TestSetLockedPower() {
56
57
sdkmath .NewInt (200 ),
57
58
types.Lock {
58
59
StakerAddress : ValidAddress1 .String (),
59
- Key : KeyWithRewards ,
60
+ Key : KeyWithoutRewards ,
60
61
Amount : sdkmath .NewInt (100 ),
61
62
PosRewardDebts : nil ,
62
63
NegRewardDebts : nil ,
@@ -66,8 +67,8 @@ func (suite *KeeperTestSuite) TestSetLockedPower() {
66
67
"success case - have previous lock with empty rewards" ,
67
68
func () {
68
69
preKey = types.Key {
69
- Name : KeyWithRewards ,
70
- PoolAddress : KeyWithRewardsPoolAddress .String (),
70
+ Name : KeyWithoutRewards ,
71
+ PoolAddress : KeyWithoutRewardsPoolAddress .String (),
71
72
IsActive : true ,
72
73
RewardPerPowers : nil ,
73
74
TotalPower : sdkmath .NewInt (100 ),
@@ -76,7 +77,7 @@ func (suite *KeeperTestSuite) TestSetLockedPower() {
76
77
77
78
preLock = & types.Lock {
78
79
StakerAddress : ValidAddress1 .String (),
79
- Key : KeyWithRewards ,
80
+ Key : KeyWithoutRewards ,
80
81
Amount : sdkmath .NewInt (10 ),
81
82
PosRewardDebts : nil ,
82
83
NegRewardDebts : nil ,
@@ -87,7 +88,7 @@ func (suite *KeeperTestSuite) TestSetLockedPower() {
87
88
sdkmath .NewInt (190 ),
88
89
types.Lock {
89
90
StakerAddress : ValidAddress1 .String (),
90
- Key : KeyWithRewards ,
91
+ Key : KeyWithoutRewards ,
91
92
Amount : sdkmath .NewInt (100 ),
92
93
PosRewardDebts : nil ,
93
94
NegRewardDebts : nil ,
0 commit comments