mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-01-09 15:37:56 -05:00
* wip * wip * adding ssz marshalling * updating function for readability * adding unit tests and fixing ssz * gaz * linting * fixing test * wip * fixing mock blocker * fixing test * fixing tests and handler * updating unit test for more coverage * adding some comments * self review * gofmt * updating and consolidating tests * moving functional options so it can be used properly * gofmt * more missed gofmt * Update beacon-chain/rpc/endpoints.go Co-authored-by: Radosław Kapka <rkapka@wp.pl> * Update beacon-chain/rpc/lookup/blocker.go Co-authored-by: Radosław Kapka <rkapka@wp.pl> * Update beacon-chain/rpc/eth/beacon/handlers.go Co-authored-by: Radosław Kapka <rkapka@wp.pl> * radek feedback * fixing tests * fixing test * moving endpoint in test * removed unneeded comment * fixing linting from latest develop merge * fixing linting from latest develop merge * Update beacon-chain/rpc/eth/blob/handlers.go Co-authored-by: Radosław Kapka <rkapka@wp.pl> * Update beacon-chain/rpc/eth/blob/handlers.go Co-authored-by: Radosław Kapka <rkapka@wp.pl> * reverting change * reverting change * adding in better error for which hashes are missing * Update beacon-chain/rpc/lookup/blocker.go Co-authored-by: Radosław Kapka <rkapka@wp.pl> * fixing unit test * gofmt --------- Co-authored-by: Radosław Kapka <rkapka@wp.pl>
25 lines
602 B
Go
25 lines
602 B
Go
package options
|
|
|
|
// BlobsOption is a functional option for configuring blob retrieval
|
|
type BlobsOption func(*BlobsConfig)
|
|
|
|
// BlobsConfig holds configuration for blob retrieval
|
|
type BlobsConfig struct {
|
|
Indices []int
|
|
VersionedHashes [][]byte
|
|
}
|
|
|
|
// WithIndices specifies blob indices to retrieve
|
|
func WithIndices(indices []int) BlobsOption {
|
|
return func(c *BlobsConfig) {
|
|
c.Indices = indices
|
|
}
|
|
}
|
|
|
|
// WithVersionedHashes specifies versioned hashes to retrieve blobs by
|
|
func WithVersionedHashes(hashes [][]byte) BlobsOption {
|
|
return func(c *BlobsConfig) {
|
|
c.VersionedHashes = hashes
|
|
}
|
|
}
|