@@ -374,7 +374,7 @@ export default {
374
374
amount : string
375
375
protocolNetwork : string
376
376
} ,
377
- { network, graphNode, logger, models } : IndexerManagementResolverContext ,
377
+ { network, graphNode, logger, models, actionManager } : IndexerManagementResolverContext ,
378
378
) : Promise < CreateAllocationResult > => {
379
379
logger . debug ( 'Execute createAllocation() mutation' , {
380
380
deployment,
@@ -571,6 +571,14 @@ export default {
571
571
572
572
await models . IndexingRule . upsert ( indexingRule )
573
573
574
+ if ( actionManager ?. allocationManager ?. dipsManager ) {
575
+ await actionManager . allocationManager . dipsManager . tryUpdateAgreementAllocation (
576
+ deployment ,
577
+ null ,
578
+ createAllocationEventLogs . allocationID ,
579
+ )
580
+ }
581
+
574
582
// Since upsert succeeded, we _must_ have a rule
575
583
const updatedRule = await models . IndexingRule . findOne ( {
576
584
where : { identifier : indexingRule . identifier } ,
@@ -608,7 +616,7 @@ export default {
608
616
poi : string | undefined
609
617
force : boolean
610
618
} ,
611
- { logger, models, network } : IndexerManagementResolverContext ,
619
+ { logger, models, network, actionManager } : IndexerManagementResolverContext ,
612
620
) : Promise < CloseAllocationResult > => {
613
621
logger . debug ( 'Execute closeAllocation() mutation' , {
614
622
allocationID : allocation ,
@@ -726,6 +734,17 @@ export default {
726
734
727
735
await models . IndexingRule . upsert ( offchainIndexingRule )
728
736
737
+ if ( actionManager ?. allocationManager ?. dipsManager ) {
738
+ await actionManager . allocationManager . dipsManager . tryCancelAgreement (
739
+ allocation ,
740
+ )
741
+ await actionManager . allocationManager . dipsManager . tryUpdateAgreementAllocation (
742
+ allocationData . subgraphDeployment . id . toString ( ) ,
743
+ allocation ,
744
+ null ,
745
+ )
746
+ }
747
+
729
748
// Since upsert succeeded, we _must_ have a rule
730
749
const updatedRule = await models . IndexingRule . findOne ( {
731
750
where : { identifier : offchainIndexingRule . identifier } ,
@@ -765,7 +784,7 @@ export default {
765
784
force : boolean
766
785
protocolNetwork : string
767
786
} ,
768
- { logger, models, network } : IndexerManagementResolverContext ,
787
+ { logger, models, network, actionManager } : IndexerManagementResolverContext ,
769
788
) : Promise < ReallocateAllocationResult > => {
770
789
logger = logger . child ( {
771
790
component : 'reallocateAllocationResolver' ,
@@ -1032,6 +1051,14 @@ export default {
1032
1051
1033
1052
await models . IndexingRule . upsert ( indexingRule )
1034
1053
1054
+ if ( actionManager ?. allocationManager ?. dipsManager ) {
1055
+ await actionManager . allocationManager . dipsManager . tryUpdateAgreementAllocation (
1056
+ allocationData . subgraphDeployment . id . toString ( ) ,
1057
+ allocation ,
1058
+ createAllocationEventLogs . allocationID ,
1059
+ )
1060
+ }
1061
+
1035
1062
// Since upsert succeeded, we _must_ have a rule
1036
1063
const updatedRule = await models . IndexingRule . findOne ( {
1037
1064
where : { identifier : indexingRule . identifier } ,
0 commit comments