From c5785eccdfe76c7a2cb93b026f2fa72c67d89417 Mon Sep 17 00:00:00 2001 From: WELLINGTON MIRANDA BARBOSA <126125417+wmb-software-consulting@users.noreply.github.com> Date: Thu, 7 Dec 2023 17:32:35 -0300 Subject: [PATCH] Add ConfirmationTxnHash to feed blobs response (#72) Co-authored-by: Wellington Barbosa --- disperser/dataapi/blobs_handlers.go | 1 + disperser/dataapi/server.go | 1 + disperser/dataapi/server_test.go | 1 + 3 files changed, 3 insertions(+) diff --git a/disperser/dataapi/blobs_handlers.go b/disperser/dataapi/blobs_handlers.go index cb7a8ecdb1..07cfceafc6 100644 --- a/disperser/dataapi/blobs_handlers.go +++ b/disperser/dataapi/blobs_handlers.go @@ -84,6 +84,7 @@ func convertMetadataToBlobMetadataResponse(metadata *disperser.BlobMetadata) (*B BlobCommitment: metadata.ConfirmationInfo.BlobCommitment, BatchId: metadata.ConfirmationInfo.BatchID, ConfirmationBlockNumber: metadata.ConfirmationInfo.ConfirmationBlockNumber, + ConfirmationTxnHash: metadata.ConfirmationInfo.ConfirmationTxnHash.String(), Fee: hex.EncodeToString(metadata.ConfirmationInfo.Fee), SecurityParams: metadata.RequestMetadata.SecurityParams, RequestAt: ConvertNanosecondToSecond(metadata.RequestMetadata.RequestedAt), diff --git a/disperser/dataapi/server.go b/disperser/dataapi/server.go index cda67dcca3..ac4f109add 100644 --- a/disperser/dataapi/server.go +++ b/disperser/dataapi/server.go @@ -42,6 +42,7 @@ type ( BlobCommitment *core.BlobCommitments `json:"blob_commitment"` BatchId uint32 `json:"batch_id"` ConfirmationBlockNumber uint32 `json:"confirmation_block_number"` + ConfirmationTxnHash string `json:"confirmation_txn_hash"` Fee string `json:"fee"` SecurityParams []*core.SecurityParam `json:"security_params"` RequestAt uint64 `json:"requested_at"` diff --git a/disperser/dataapi/server_test.go b/disperser/dataapi/server_test.go index 6e381c456f..aa17f98f2f 100644 --- a/disperser/dataapi/server_test.go +++ b/disperser/dataapi/server_test.go @@ -92,6 +92,7 @@ func TestFetchBlobHandler(t *testing.T) { assert.Equal(t, expectedBlobCommitment, response.BlobCommitment) assert.Equal(t, expectedBatchId, uint32(response.BatchId)) assert.Equal(t, expectedConfirmationBlockNumber, uint32(response.ConfirmationBlockNumber)) + assert.Equal(t, "0x0000000000000000000000000000000000000000000000000000000000000123", response.ConfirmationTxnHash) assert.Equal(t, hex.EncodeToString(expectedFee), response.Fee) assert.Equal(t, blob.RequestHeader.SecurityParams, response.SecurityParams) assert.Equal(t, uint64(5567830000), response.RequestAt)