Skip to content

Commit

Permalink
Revert "polygon/bridge: Add bridge tests" (#10974)
Browse files Browse the repository at this point in the history
Reverts #10941
  • Loading branch information
AskAlexSharov authored Jul 2, 2024
1 parent c3bd739 commit 8856ac0
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 307 deletions.
12 changes: 3 additions & 9 deletions polygon/bridge/bridge.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ func (b *Bridge) Run(ctx context.Context) error {
if err != nil {
return err
}
defer b.Close()

// get last known sync ID
lastEventID, err := b.store.GetLatestEventID(ctx)
Expand Down Expand Up @@ -111,7 +110,7 @@ func (b *Bridge) ProcessNewBlocks(ctx context.Context, blocks []*types.Block) er
eventMap := make(map[uint64]uint64)
for _, block := range blocks {
// check if block is start of span
if !b.isSprintStart(block.NumberU64()) {
if b.isSprintStart(block.NumberU64()) {
continue
}

Expand Down Expand Up @@ -165,16 +164,12 @@ func (b *Bridge) GetEvents(ctx context.Context, blockNum uint64) ([]*types.Messa
return nil, err
}

if end == 0 { // exception for tip processing
end = b.lastProcessedEventID
}

b.log.Debug("got map", "blockNum", blockNum, "start", start, "end", end)

eventsRaw := make([]*types.Message, 0, end-start+1)
eventsRaw := make([]*types.Message, end-start+1)

// get events from DB
events, err := b.store.GetEvents(ctx, start+1, end+1)
events, err := b.store.GetEvents(ctx, start, end)
if err != nil {
return nil, err
}
Expand All @@ -197,7 +192,6 @@ func (b *Bridge) GetEvents(ctx context.Context, blockNum uint64) ([]*types.Messa

eventsRaw = append(eventsRaw, &msg)
}

return eventsRaw, nil
}

Expand Down
251 changes: 0 additions & 251 deletions polygon/bridge/bridge_test.go

This file was deleted.

Loading

0 comments on commit 8856ac0

Please sign in to comment.