Skip to content

Commit

Permalink
Add ConfirmationTxnHash to feed blobs response (#72)
Browse files Browse the repository at this point in the history
Co-authored-by: Wellington Barbosa <[email protected]>
  • Loading branch information
wmb-software-consulting and Wellington Barbosa authored Dec 7, 2023
1 parent e30592b commit c5785ec
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions disperser/dataapi/blobs_handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
1 change: 1 addition & 0 deletions disperser/dataapi/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand Down
1 change: 1 addition & 0 deletions disperser/dataapi/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit c5785ec

Please sign in to comment.