From b7fb428a757c1dd896ef6eb1494f2226274c1a62 Mon Sep 17 00:00:00 2001 From: Vegard Stikbakke Date: Thu, 20 Jun 2024 15:25:36 +0200 Subject: [PATCH] Fix SendBlock response type --- client/duneapi/models.go | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/client/duneapi/models.go b/client/duneapi/models.go index 6ee8229..1afd273 100644 --- a/client/duneapi/models.go +++ b/client/duneapi/models.go @@ -3,6 +3,7 @@ package duneapi import ( "fmt" "sort" + "strings" "github.com/duneanalytics/blockchain-ingester/models" ) @@ -27,16 +28,24 @@ type BlockchainIngestResponse struct { } type IngestedTableInfo struct { - Name string `json:"name"` - Rows int `json:"rows_written"` - Bytes int `json:"bytes_written"` + Name string `json:"name"` + Rows int `json:"rows"` } func (b *BlockchainIngestResponse) String() string { sort.Slice(b.Tables, func(i, j int) bool { return b.Tables[i].Name < b.Tables[j].Name }) - return fmt.Sprintf("%+v", b.Tables) + s := strings.Builder{} + s.WriteString("[") + for i, t := range b.Tables { + if i > 0 { + s.WriteString(", ") + } + s.WriteString(fmt.Sprintf("%s: %d", t.Name, t.Rows)) + } + s.WriteString("]") + return s.String() } type BlockchainIngestRequest struct {