File tree Expand file tree Collapse file tree 2 files changed +44
-0
lines changed
chainio/clients/elcontracts Expand file tree Collapse file tree 2 files changed +44
-0
lines changed Original file line number Diff line number Diff line change @@ -354,3 +354,20 @@ func (r *ChainReader) GetOperatorAVSSplit(
354
354
355
355
return split , nil
356
356
}
357
+
358
+ func (r * ChainReader ) GetOperatorPISplit (
359
+ ctx context.Context ,
360
+ operator gethcommon.Address ,
361
+ ) (uint16 , error ) {
362
+ if r .rewardsCoordinator == nil {
363
+ return 0 , errors .New ("RewardsCoordinator contract not provided" )
364
+ }
365
+
366
+ split , err := r .rewardsCoordinator .GetOperatorPISplit (& bind.CallOpts {Context : ctx }, operator )
367
+
368
+ if err != nil {
369
+ return 0 , err
370
+ }
371
+
372
+ return split , nil
373
+ }
Original file line number Diff line number Diff line change @@ -385,6 +385,33 @@ func (w *ChainWriter) SetOperatorAVSSplit(
385
385
return receipt , nil
386
386
}
387
387
388
+ func (w * ChainWriter ) SetOperatorPISplit (
389
+ ctx context.Context ,
390
+ operator gethcommon.Address ,
391
+ split uint16 ,
392
+ waitForReceipt bool ,
393
+ ) (* gethtypes.Receipt , error ) {
394
+ if w .rewardsCoordinator == nil {
395
+ return nil , errors .New ("RewardsCoordinator contract not provided" )
396
+ }
397
+
398
+ noSendTxOpts , err := w .txMgr .GetNoSendTxOpts ()
399
+ if err != nil {
400
+ return nil , utils .WrapError ("failed to get no send tx opts" , err )
401
+ }
402
+
403
+ tx , err := w .rewardsCoordinator .SetOperatorPISplit (noSendTxOpts , operator , split )
404
+ if err != nil {
405
+ return nil , utils .WrapError ("failed to create SetOperatorAVSSplit tx" , err )
406
+ }
407
+ receipt , err := w .txMgr .Send (ctx , tx , waitForReceipt )
408
+ if err != nil {
409
+ return nil , utils .WrapError ("failed to send tx" , err )
410
+ }
411
+
412
+ return receipt , nil
413
+ }
414
+
388
415
func (w * ChainWriter ) ProcessClaims (
389
416
ctx context.Context ,
390
417
claims []rewardscoordinator.IRewardsCoordinatorRewardsMerkleClaim ,
You can’t perform that action at this time.
0 commit comments