celestiaorg / go-header

Go library with all the services needed to request, sync and store blockchain headers.
Apache License 2.0
19 stars 18 forks source link

refactor!: type paramed Header interface #96

Closed Wondertan closed 1 year ago

Wondertan commented 1 year ago

The goal here is to improve type safety. Before, go-header users had to do type checks as https://github.com/celestiaorg/celestia-node/blob/main/header/verify.go#L12-L17. This PR parametrized the Header interface so that type safety is ensured during compilation rather than runtime