File tree Expand file tree Collapse file tree 3 files changed +9
-3
lines changed
Expand file tree Collapse file tree 3 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -473,6 +473,10 @@ func (executor *bridgeExecutor) GetAndStoreBatchFromEthereum(ctx context.Context
473473
474474 executor .batch = batch
475475 executor .statusHandler .SetIntMetric (bridgeCore .MetricCurrentBatchID , safeUint64ToInt (batch .ID ))
476+ if len (batch .Deposits ) > 0 {
477+ lastDeposit := batch .Deposits [len (batch .Deposits )- 1 ]
478+ executor .statusHandler .SetIntMetric (bridgeCore .MetricCurrentDepositNonce , safeUint64ToInt (lastDeposit .Nonce ))
479+ }
476480
477481 return nil
478482}
Original file line number Diff line number Diff line change @@ -401,7 +401,8 @@ func TestEthToKCBridgeExecutor_GetAndStoreBatchFromEthereum(t *testing.T) {
401401 expectedBatch := & bridgeCore.TransferBatch {
402402 ID : providedNonce ,
403403 Deposits : []* bridgeCore.DepositTransfer {
404- {},
404+ {Nonce : 100 },
405+ {Nonce : 101 },
405406 },
406407 }
407408 args .EthereumClient = & bridgeTests.EthereumClientStub {
@@ -420,6 +421,7 @@ func TestEthToKCBridgeExecutor_GetAndStoreBatchFromEthereum(t *testing.T) {
420421 assert .True (t , expectedBatch == executor .GetStoredBatch ()) // pointer testing
421422 assert .True (t , expectedBatch == executor .batch )
422423 assert .Equal (t , int (providedNonce ), statusHandler .GetIntMetric (bridgeCore .MetricCurrentBatchID ))
424+ assert .Equal (t , 101 , statusHandler .GetIntMetric (bridgeCore .MetricCurrentDepositNonce ))
423425 })
424426 t .Run ("should add deposits metadata for sc calls" , func (t * testing.T ) {
425427 t .Parallel ()
Original file line number Diff line number Diff line change @@ -519,7 +519,7 @@ func (components *ethKleverBridgeComponents) createEthereumToKleverBlockchainBri
519519 return err
520520 }
521521
522- components .ethtoKleverStatusHandler .SetStringMetric (core .MetricBridgeDirection , "ETH->KC" )
522+ components .ethtoKleverStatusHandler .SetStringMetric (core .MetricBridgeDirection , ethtokleverName )
523523
524524 timeForTransferExecution := time .Second * time .Duration (args .Configs .GeneralConfig .Eth .IntervalToWaitForTransferInSeconds )
525525
@@ -589,7 +589,7 @@ func (components *ethKleverBridgeComponents) createKCToEthereumBridge(args ArgsE
589589 return err
590590 }
591591
592- components .kcToEthStatusHandler .SetStringMetric (core .MetricBridgeDirection , "KC->ETH" )
592+ components .kcToEthStatusHandler .SetStringMetric (core .MetricBridgeDirection , kcToEthName )
593593
594594 timeForWaitOnEthereum := time .Second * time .Duration (args .Configs .GeneralConfig .Eth .IntervalToWaitForTransferInSeconds )
595595
You can’t perform that action at this time.
0 commit comments