Skip to content

Commit

Permalink
Fix globalIndex bridge endpoint (#702)
Browse files Browse the repository at this point in the history
  • Loading branch information
ARR552 committed Dec 4, 2024
1 parent d1f9b51 commit 1a82c8a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions server/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -464,6 +464,12 @@ func (s *bridgeService) GetBridge(ctx context.Context, req *pb.GetBridgeRequest)
if err != nil {
return nil, err
}
mainnetFlag := deposit.NetworkID == 0
var rollupIndex uint32
if !mainnetFlag {
rollupIndex = deposit.NetworkID - 1
}
localExitRootIndex := deposit.DepositCount

return &pb.GetBridgeResponse{
Deposit: &pb.Deposit{
Expand All @@ -480,6 +486,7 @@ func (s *bridgeService) GetBridge(ctx context.Context, req *pb.GetBridgeRequest)
ClaimTxHash: claimTxHash,
Metadata: "0x" + hex.EncodeToString(deposit.Metadata),
ReadyForClaim: deposit.ReadyForClaim,
GlobalIndex: etherman.GenerateGlobalIndex(mainnetFlag, rollupIndex, localExitRootIndex).String(),
},
}, nil
}
Expand Down

0 comments on commit 1a82c8a

Please sign in to comment.