EspressoSystems / hotshot-query-service

Generic query service for HotShot applications
https://espressosystems.github.io/hotshot-query-service/
GNU General Public License v3.0
5 stars 1 forks source link

`ExplorerHeader` should not have the method `namespace_ids_for_offset` #579

Closed Ayiga closed 3 months ago

Ayiga commented 3 months ago

The method namespace_ids_for_offset is intended to get a list of NamespaceIds for a given Transaction offset on a Block Header. Considering implementation details the Block Header doesn't actually have access to this information, based on the discussion here: https://github.com/EspressoSystems/espresso-sequencer/pull/1428#discussion_r1596717521.

Since this method is only utilized for TransactionSummary, TransactionSummary has access to the actual Transaction itself when being constructed, and the implementation details for a Transaction actually has access to its NamespaceId, then we can make this work by creating a trait for the Transaction itself to retrieve its own NamespaceId.

So, we need to remove namespace_ids_for_offset, and create a new trait for a Transaction for use with the Explorer API, that allows us to retrieve the NamespaceId from the transaction itself.