diff --git a/internal/storage/postgres/blob_log.go b/internal/storage/postgres/blob_log.go index 72b1af3e..1f7c47c4 100644 --- a/internal/storage/postgres/blob_log.go +++ b/internal/storage/postgres/blob_log.go @@ -261,10 +261,12 @@ func (bl *BlobLog) Blob(ctx context.Context, height types.Level, nsId uint64, co ColumnExpr("blob_log.*"). ColumnExpr("rollup.id as rollup__id, rollup.name as rollup__name, rollup.logo as rollup__logo, rollup.slug as rollup__slug"). ColumnExpr("signer.address as signer__address"). + ColumnExpr("celestial.id as signer__celestials__id, celestial.image_url as signer__celestials__image_url"). ColumnExpr("ns.id as namespace__id, ns.size as namespace__size, ns.blobs_count as namespace__blobs_count, ns.version as namespace__version, ns.namespace_id as namespace__namespace_id, ns.reserved as namespace__reserved, ns.pfb_count as namespace__pfb_count, ns.last_height as namespace__last_height, ns.last_message_time as namespace__last_message_time"). ColumnExpr("tx.id as tx__id, tx.height as tx__height, tx.time as tx__time, tx.position as tx__position, tx.gas_wanted as tx__gas_wanted, tx.gas_used as tx__gas_used, tx.timeout_height as tx__timeout_height, tx.events_count as tx__events_count, tx.messages_count as tx__messages_count, tx.fee as tx__fee, tx.status as tx__status, tx.error as tx__error, tx.codespace as tx__codespace, tx.hash as tx__hash, tx.memo as tx__memo, tx.message_types as tx__message_types"). TableExpr("(?) as blob_log", blobLogQuery). Join("left join address as signer on signer.id = blob_log.signer_id"). + Join("left join celestial on celestial.address_id = signer.id and celestial.status = 'PRIMARY'"). Join("left join namespace as ns on ns.id = blob_log.namespace_id"). Join("left join tx on tx.id = blob_log.tx_id"). Join("left join rollup_provider as p on blob_log.signer_id = p.address_id and blob_log.namespace_id = p.namespace_id"). diff --git a/internal/storage/postgres/blob_log_test.go b/internal/storage/postgres/blob_log_test.go index f3f378fe..89bbc69d 100644 --- a/internal/storage/postgres/blob_log_test.go +++ b/internal/storage/postgres/blob_log_test.go @@ -388,6 +388,8 @@ func (s *StorageTestSuite) TestBlob() { s.Require().NotNil(log.Signer) s.Require().EqualValues("celestia1mm8yykm46ec3t0dgwls70g0jvtm055wk9ayal8", log.Signer.Address) + s.Require().NotNil(log.Signer.Celestials) + s.Require().EqualValues("name 1", log.Signer.Celestials.Id) s.Require().NotNil(log.Tx) s.Require().EqualValues(4, log.Tx.Id)