Skip to content

Commit

Permalink
Refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
Agustin Godnic committed Jul 8, 2023
1 parent 72f984a commit 8388a48
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions api/routes/wormscan/transactions/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -393,14 +393,14 @@ func (c *Controller) makeTransactionsResponse(dtos []transactions.TransactionDto
}

for i := range dtos {
tx := c.makeTransactionOverview(&dtos[i])
tx := c.makeTransactionDetail(&dtos[i])
response.Transactions = append(response.Transactions, tx)
}

return response
}

func (c *Controller) makeTransactionOverview(input *transactions.TransactionDto) *TransactionDetail {
func (c *Controller) makeTransactionDetail(input *transactions.TransactionDto) *TransactionDetail {

tx := TransactionDetail{
ID: input.ID,
Expand Down Expand Up @@ -451,7 +451,7 @@ func (c *Controller) makeTransactionOverview(input *transactions.TransactionDto)
// @Param chain_id path integer true "id of the blockchain"
// @Param emitter path string true "address of the emitter"
// @Param seq path integer true "sequence of the VAA"
// @Success 200 {object} TransactionOverview
// @Success 200 {object} TransactionDetail
// @Failure 400
// @Failure 500
// @Router /api/v1/transactions/{chain_id}/{emitter}/{seq} [get]
Expand All @@ -477,6 +477,6 @@ func (c *Controller) GetTransactionByID(ctx *fiber.Ctx) error {
return errors.ErrNotFound
}

tx := c.makeTransactionOverview(dto)
tx := c.makeTransactionDetail(dto)
return ctx.JSON(tx)
}

0 comments on commit 8388a48

Please sign in to comment.