@@ -98,8 +98,8 @@ type Watcher interface {
9898}
9999
100100type DepositManager interface {
101- IncreaseBalanceIfExists (bidder common.Address , provider common.Address , amount * big.Int ) error
102- DecreaseBalanceIfExists (bidder common.Address , provider common.Address , amount * big.Int ) error
101+ RefundBalanceIfExists (bidder common.Address , provider common.Address , amount * big.Int ) error
102+ DeductBalanceIfExists (bidder common.Address , provider common.Address , amount * big.Int ) error
103103}
104104
105105func NewTracker (
@@ -457,9 +457,9 @@ func (t *Tracker) statusUpdater(
457457 } else {
458458 status = store .CommitmentStatusStored
459459 if t .depositMgr != nil {
460- // Try to decrease cached balance now that commitment was successfully stored
461- if err := t .tryDecreaseCachedBalance (task .commitment ); err != nil {
462- t .logger .Warn ("failed to decrease cached balance. Bidder is likely withdrawing" , "error" , err )
460+ // Try to deduct cached balance now that commitment was successfully stored
461+ if err := t .tryDeductCachedBalance (task .commitment ); err != nil {
462+ t .logger .Warn ("failed to deduct cached balance. Bidder is likely withdrawing" , "error" , err )
463463 }
464464 }
465465 }
@@ -556,7 +556,7 @@ func (t *Tracker) openCommitments(
556556 )
557557 if t .depositMgr != nil {
558558 // This node isn't the winner, so try to refund relevant cached balance
559- if err := t .tryIncreaseCachedBalance (commitment ); err != nil {
559+ if err := t .tryRefundCachedBalance (commitment ); err != nil {
560560 t .logger .Warn ("failed to refund cached balance. Bidder is likely withdrawing" , "error" , err )
561561 }
562562 }
@@ -800,34 +800,34 @@ func (t *Tracker) generateBidderProof(
800800 }
801801}
802802
803- func (t * Tracker ) tryIncreaseCachedBalance (
803+ func (t * Tracker ) tryRefundCachedBalance (
804804 commitment * store.Commitment ,
805805) error {
806806 if commitment .BidderAddress == nil || commitment .ProviderAddress == nil || commitment .BidAmount == nil {
807807 return fmt .Errorf ("nil commitment fields" )
808808 }
809- if err := t .depositMgr .IncreaseBalanceIfExists (
809+ if err := t .depositMgr .RefundBalanceIfExists (
810810 * commitment .BidderAddress ,
811811 common .BytesToAddress (commitment .ProviderAddress ),
812812 commitment .BidAmount ,
813813 ); err != nil {
814- return fmt .Errorf ("failed to increase balance: %w" , err )
814+ return fmt .Errorf ("failed to refund balance: %w" , err )
815815 }
816- t .logger .Info ("increased cached balance from commitment" ,
816+ t .logger .Info ("refunded cached balance from commitment" ,
817817 "bidder" , commitment .BidderAddress ,
818818 "provider" , common .BytesToAddress (commitment .ProviderAddress ),
819819 "amount" , commitment .BidAmount ,
820820 )
821821 return nil
822822}
823823
824- func (t * Tracker ) tryDecreaseCachedBalance (
824+ func (t * Tracker ) tryDeductCachedBalance (
825825 commitment * store.Commitment ,
826826) error {
827827 if commitment .BidderAddress == nil || commitment .ProviderAddress == nil || commitment .BidAmount == nil {
828828 return fmt .Errorf ("nil commitment fields" )
829829 }
830- if err := t .depositMgr .DecreaseBalanceIfExists (
830+ if err := t .depositMgr .DeductBalanceIfExists (
831831 * commitment .BidderAddress ,
832832 common .BytesToAddress (commitment .ProviderAddress ),
833833 commitment .BidAmount ,
0 commit comments