Skip to content

Commit

Permalink
Removed bstream.Block.PreviousRef method
Browse files Browse the repository at this point in the history
Its implementation was invalid since it was assuming that the previous number is always minus one the current block num which is not true on a lot of supported chains (Solana and NEAR for example).
  • Loading branch information
maoueh committed Oct 14, 2022
1 parent 52a3776 commit e383606
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## Unreleased

### Removed

- **BREAKING** Removed `bstream.Block.PreviousRef` method as it was invalid since it was assuming that the previous number is always minus one the current block num which is not true on a lot of supported chains (Solana and NEAR for example).

### Added

- Added FileSourceWithSecondaryBlocksStores Option to allow a fallback location
- `.SetNearBlocksCount(count)` and `.Clone()` on `Tracker` object.
- `Tracker` object to streamline queries about different targets (like network head, database lib, relayer blockstream head, whatever other BlockRef tags), ask the question about them being near one another (to select between live mode or catch-up mode). Also streamlines the requests of a start block, with a bunch of different backend implementations that can answer to the questions regarding where to start.
Expand Down
8 changes: 0 additions & 8 deletions block.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,14 +196,6 @@ func (b *Block) AsRef() BlockRef {
return NewBlockRef(b.Id, b.Number)
}

func (b *Block) PreviousRef() BlockRef {
if b == nil || b.Number == 0 || b.PreviousId == "" {
return BlockRefEmpty
}

return NewBlockRef(b.PreviousId, b.Number-1)
}

//func (b *Block) Payload() []byte {
// if b == nil {
// return nil
Expand Down

0 comments on commit e383606

Please sign in to comment.