Skip to content

Commit

Permalink
fix panic in slot.go when handling contract deployment tx
Browse files Browse the repository at this point in the history
  • Loading branch information
pk910 committed Nov 29, 2023
1 parent 83b94d1 commit 6dc4fb1
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion handlers/slot.go
Original file line number Diff line number Diff line change
Expand Up @@ -619,7 +619,6 @@ func getSlotPageTransactions(pageData *models.SlotPageBlockData, tranactions []b
txData := &models.SlotPageTransaction{
Index: uint64(idx),
Hash: txHash[:],
To: tx.To().String(),
Value: txValue,
Data: tx.Data(),
Type: uint64(tx.Type()),
Expand All @@ -632,6 +631,12 @@ func getSlotPageTransactions(pageData *models.SlotPageBlockData, tranactions []b
} else {
txData.From = txFrom.String()
}
txTo := tx.To()
if txTo == nil {
txData.To = "new contract"
} else {
txData.To = txTo.String()
}

pageData.Transactions = append(pageData.Transactions, txData)

Expand Down

0 comments on commit 6dc4fb1

Please sign in to comment.