@@ -113,6 +113,7 @@ func (s *DefaultStore) GetHeader(ctx context.Context, height uint64) (*types.Sig
113113 if err = header .UnmarshalBinary (headerBlob ); err != nil {
114114 return nil , fmt .Errorf ("unmarshal block header: %w" , err )
115115 }
116+
116117 return header , nil
117118}
118119
@@ -176,7 +177,7 @@ func (s *DefaultStore) GetStateAtHeight(ctx context.Context, height uint64) (typ
176177//
177178// Metadata is separated from other data by using prefix in KV.
178179func (s * DefaultStore ) SetMetadata (ctx context.Context , key string , value []byte ) error {
179- err := s .db .Put (ctx , ds .NewKey (getMetaKey (key )), value )
180+ err := s .db .Put (ctx , ds .NewKey (GetMetaKey (key )), value )
180181 if err != nil {
181182 return fmt .Errorf ("failed to set metadata for key '%s': %w" , key , err )
182183 }
@@ -185,7 +186,7 @@ func (s *DefaultStore) SetMetadata(ctx context.Context, key string, value []byte
185186
186187// GetMetadata returns values stored for given key with SetMetadata.
187188func (s * DefaultStore ) GetMetadata (ctx context.Context , key string ) ([]byte , error ) {
188- data , err := s .db .Get (ctx , ds .NewKey (getMetaKey (key )))
189+ data , err := s .db .Get (ctx , ds .NewKey (GetMetaKey (key )))
189190 if err != nil {
190191 return nil , fmt .Errorf ("failed to get metadata for key '%s': %w" , key , err )
191192 }
@@ -196,7 +197,7 @@ func (s *DefaultStore) GetMetadata(ctx context.Context, key string) ([]byte, err
196197// This is more efficient than iterating through known keys when the set of keys is unknown.
197198func (s * DefaultStore ) GetMetadataByPrefix (ctx context.Context , prefix string ) ([]MetadataEntry , error ) {
198199 // The full key in the datastore includes the meta prefix
199- fullPrefix := getMetaKey (prefix )
200+ fullPrefix := GetMetaKey (prefix )
200201
201202 results , err := s .db .Query (ctx , dsq.Query {Prefix : fullPrefix })
202203 if err != nil {
@@ -213,7 +214,7 @@ func (s *DefaultStore) GetMetadataByPrefix(ctx context.Context, prefix string) (
213214 // Extract the original key by removing the meta prefix
214215 // The key from datastore is like "/m/cache/header-da-included/hash"
215216 // We want to return "cache/header-da-included/hash"
216- metaKeyPrefix := getMetaKey ("" )
217+ metaKeyPrefix := GetMetaKey ("" )
217218 key := strings .TrimPrefix (result .Key , metaKeyPrefix )
218219 key = strings .TrimPrefix (key , "/" ) // Remove leading slash for consistency
219220
@@ -228,7 +229,7 @@ func (s *DefaultStore) GetMetadataByPrefix(ctx context.Context, prefix string) (
228229
229230// DeleteMetadata removes a metadata key from the store.
230231func (s * DefaultStore ) DeleteMetadata (ctx context.Context , key string ) error {
231- err := s .db .Delete (ctx , ds .NewKey (getMetaKey (key )))
232+ err := s .db .Delete (ctx , ds .NewKey (GetMetaKey (key )))
232233 if err != nil {
233234 return fmt .Errorf ("failed to delete metadata for key '%s': %w" , key , err )
234235 }
@@ -279,7 +280,7 @@ func (s *DefaultStore) Rollback(ctx context.Context, height uint64, aggregator b
279280 } else { // in case of syncing issues, rollback the included height is OK.
280281 bz := make ([]byte , 8 )
281282 binary .LittleEndian .PutUint64 (bz , height )
282- if err := batch .Put (ctx , ds .NewKey (getMetaKey (DAIncludedHeightKey )), bz ); err != nil {
283+ if err := batch .Put (ctx , ds .NewKey (GetMetaKey (DAIncludedHeightKey )), bz ); err != nil {
283284 return fmt .Errorf ("failed to update DA included height: %w" , err )
284285 }
285286 }
0 commit comments