@@ -69,14 +69,20 @@ func MsgDelegateDependencyGenerator(keeper aclkeeper.Keeper, ctx sdk.Context, ms
69
69
70
70
// Before Unbond Distribution Hook
71
71
{
72
- AccessType : sdkacltypes .AccessType_READ ,
73
- ResourceType : sdkacltypes .ResourceType_KV_DISTRIBUTION_DELEGATOR_STARTING_INFO ,
74
- IdentifierTemplate : hex .EncodeToString (distributiontypes .GetDelegatorStartingInfoKey (validatorAddr , delegateAddr )),
72
+ AccessType : sdkacltypes .AccessType_READ ,
73
+ ResourceType : sdkacltypes .ResourceType_KV_DISTRIBUTION_DELEGATOR_STARTING_INFO ,
74
+ IdentifierTemplate : hex .EncodeToString (distributiontypes .GetDelegatorStartingInfoKey (
75
+ keeper .StakingKeeper .GetValidatorID (ctx , validatorAddr ),
76
+ keeper .AccountKeeper .GetAccount (ctx , delegateAddr ).GetAccountNumber (),
77
+ )),
75
78
},
76
79
{
77
- AccessType : sdkacltypes .AccessType_WRITE ,
78
- ResourceType : sdkacltypes .ResourceType_KV_DISTRIBUTION_DELEGATOR_STARTING_INFO ,
79
- IdentifierTemplate : hex .EncodeToString (distributiontypes .GetDelegatorStartingInfoKey (validatorAddr , delegateAddr )),
80
+ AccessType : sdkacltypes .AccessType_WRITE ,
81
+ ResourceType : sdkacltypes .ResourceType_KV_DISTRIBUTION_DELEGATOR_STARTING_INFO ,
82
+ IdentifierTemplate : hex .EncodeToString (distributiontypes .GetDelegatorStartingInfoKey (
83
+ keeper .StakingKeeper .GetValidatorID (ctx , validatorAddr ),
84
+ keeper .AccountKeeper .GetAccount (ctx , delegateAddr ).GetAccountNumber (),
85
+ )),
80
86
},
81
87
{
82
88
AccessType : sdkacltypes .AccessType_READ ,
@@ -293,9 +299,12 @@ func MsgUndelegateDependencyGenerator(keeper aclkeeper.Keeper, ctx sdk.Context,
293
299
294
300
// Before Unbond Distribution Hook
295
301
{
296
- AccessType : sdkacltypes .AccessType_READ ,
297
- ResourceType : sdkacltypes .ResourceType_KV_DISTRIBUTION_DELEGATOR_STARTING_INFO ,
298
- IdentifierTemplate : hex .EncodeToString (distributiontypes .GetDelegatorStartingInfoKey (validatorAddr , delegateAddr )),
302
+ AccessType : sdkacltypes .AccessType_READ ,
303
+ ResourceType : sdkacltypes .ResourceType_KV_DISTRIBUTION_DELEGATOR_STARTING_INFO ,
304
+ IdentifierTemplate : hex .EncodeToString (distributiontypes .GetDelegatorStartingInfoKey (
305
+ keeper .StakingKeeper .GetValidatorID (ctx , validatorAddr ),
306
+ keeper .AccountKeeper .GetAccount (ctx , delegateAddr ).GetAccountNumber (),
307
+ )),
299
308
},
300
309
{
301
310
AccessType : sdkacltypes .AccessType_READ ,
@@ -353,9 +362,12 @@ func MsgUndelegateDependencyGenerator(keeper aclkeeper.Keeper, ctx sdk.Context,
353
362
},
354
363
355
364
{
356
- AccessType : sdkacltypes .AccessType_WRITE ,
357
- ResourceType : sdkacltypes .ResourceType_KV_DISTRIBUTION_DELEGATOR_STARTING_INFO ,
358
- IdentifierTemplate : hex .EncodeToString (distributiontypes .GetDelegatorStartingInfoKey (validatorAddr , delegateAddr )),
365
+ AccessType : sdkacltypes .AccessType_WRITE ,
366
+ ResourceType : sdkacltypes .ResourceType_KV_DISTRIBUTION_DELEGATOR_STARTING_INFO ,
367
+ IdentifierTemplate : hex .EncodeToString (distributiontypes .GetDelegatorStartingInfoKey (
368
+ keeper .StakingKeeper .GetValidatorID (ctx , validatorAddr ),
369
+ keeper .AccountKeeper .GetAccount (ctx , delegateAddr ).GetAccountNumber (),
370
+ )),
359
371
},
360
372
361
373
// Update the delegator and validator account balances
@@ -484,14 +496,20 @@ func MsgBeginRedelegateDependencyGenerator(keeper aclkeeper.Keeper, ctx sdk.Cont
484
496
485
497
// Before Unbond Distribution Hook
486
498
{
487
- AccessType : sdkacltypes .AccessType_READ ,
488
- ResourceType : sdkacltypes .ResourceType_KV_DISTRIBUTION_DELEGATOR_STARTING_INFO ,
489
- IdentifierTemplate : hex .EncodeToString (distributiontypes .GetDelegatorStartingInfoKey (srcValidatorAddr , delegateAddr )),
499
+ AccessType : sdkacltypes .AccessType_READ ,
500
+ ResourceType : sdkacltypes .ResourceType_KV_DISTRIBUTION_DELEGATOR_STARTING_INFO ,
501
+ IdentifierTemplate : hex .EncodeToString (distributiontypes .GetDelegatorStartingInfoKey (
502
+ keeper .StakingKeeper .GetValidatorID (ctx , srcValidatorAddr ),
503
+ keeper .AccountKeeper .GetAccount (ctx , delegateAddr ).GetAccountNumber (),
504
+ )),
490
505
},
491
506
{
492
- AccessType : sdkacltypes .AccessType_READ ,
493
- ResourceType : sdkacltypes .ResourceType_KV_DISTRIBUTION_DELEGATOR_STARTING_INFO ,
494
- IdentifierTemplate : hex .EncodeToString (distributiontypes .GetDelegatorStartingInfoKey (dstValidatorAddr , delegateAddr )),
507
+ AccessType : sdkacltypes .AccessType_READ ,
508
+ ResourceType : sdkacltypes .ResourceType_KV_DISTRIBUTION_DELEGATOR_STARTING_INFO ,
509
+ IdentifierTemplate : hex .EncodeToString (distributiontypes .GetDelegatorStartingInfoKey (
510
+ keeper .StakingKeeper .GetValidatorID (ctx , dstValidatorAddr ),
511
+ keeper .AccountKeeper .GetAccount (ctx , delegateAddr ).GetAccountNumber (),
512
+ )),
495
513
},
496
514
497
515
{
@@ -582,14 +600,20 @@ func MsgBeginRedelegateDependencyGenerator(keeper aclkeeper.Keeper, ctx sdk.Cont
582
600
},
583
601
584
602
{
585
- AccessType : sdkacltypes .AccessType_WRITE ,
586
- ResourceType : sdkacltypes .ResourceType_KV_DISTRIBUTION_DELEGATOR_STARTING_INFO ,
587
- IdentifierTemplate : hex .EncodeToString (distributiontypes .GetDelegatorStartingInfoKey (srcValidatorAddr , delegateAddr )),
603
+ AccessType : sdkacltypes .AccessType_WRITE ,
604
+ ResourceType : sdkacltypes .ResourceType_KV_DISTRIBUTION_DELEGATOR_STARTING_INFO ,
605
+ IdentifierTemplate : hex .EncodeToString (distributiontypes .GetDelegatorStartingInfoKey (
606
+ keeper .StakingKeeper .GetValidatorID (ctx , srcValidatorAddr ),
607
+ keeper .AccountKeeper .GetAccount (ctx , delegateAddr ).GetAccountNumber (),
608
+ )),
588
609
},
589
610
{
590
- AccessType : sdkacltypes .AccessType_WRITE ,
591
- ResourceType : sdkacltypes .ResourceType_KV_DISTRIBUTION_DELEGATOR_STARTING_INFO ,
592
- IdentifierTemplate : hex .EncodeToString (distributiontypes .GetDelegatorStartingInfoKey (dstValidatorAddr , delegateAddr )),
611
+ AccessType : sdkacltypes .AccessType_WRITE ,
612
+ ResourceType : sdkacltypes .ResourceType_KV_DISTRIBUTION_DELEGATOR_STARTING_INFO ,
613
+ IdentifierTemplate : hex .EncodeToString (distributiontypes .GetDelegatorStartingInfoKey (
614
+ keeper .StakingKeeper .GetValidatorID (ctx , dstValidatorAddr ),
615
+ keeper .AccountKeeper .GetAccount (ctx , delegateAddr ).GetAccountNumber (),
616
+ )),
593
617
},
594
618
595
619
// Update the delegator and validator account balances
0 commit comments