diff --git a/cmd/mempool/hasura_integration_test.go b/cmd/mempool/hasura_integration_test.go index 4444a64..ac41d24 100644 --- a/cmd/mempool/hasura_integration_test.go +++ b/cmd/mempool/hasura_integration_test.go @@ -37,13 +37,18 @@ func TestIntegration_HasuraMetadata(t *testing.T) { // Go through `expectedMetadata` and assert that each object // in that array is in `metadata` with corresponding columns. for _, expectedTable := range expectedMetadata.Tables { - metadataTable, err := getTableColumns(metadata, expectedTable.Name, "user") // todo: read role from config + metadataTableColumns, err := getTableColumns(metadata, expectedTable.Name, "user") // todo: read role from config if err != nil { - t.Fatalf("Erro with searching expectedTable in metadata: %e", err) + t.Fatalf("Error with searching expectedTable in metadata: %s\n%e", expectedTable.Name, err) } - if !elementsMatch(expectedTable, metadataTable) { - t.Errorf("Table columns do not match: %s", expectedTable.Name) + if !elementsMatch(expectedTable, metadataTableColumns) { + t.Errorf( + "Table columns do not match: %s\nexpected: %s\nactual: %s", + expectedTable.Name, + expectedTable.Columns, + metadataTableColumns, + ) } } } diff --git a/cmd/mempool/models/proposal.go b/cmd/mempool/models/proposal.go index e8f4ab4..9da7b0a 100644 --- a/cmd/mempool/models/proposal.go +++ b/cmd/mempool/models/proposal.go @@ -6,5 +6,5 @@ type Proposal struct { tableName struct{} `pg:"proposals"` MempoolOperation Period int64 `json:"period"` - Proposals string `json:"proposal"` + Proposals string `json:"proposal" pg:"proposals"` } diff --git a/cmd/mempool/models/transaction.go b/cmd/mempool/models/transaction.go index bcb81fe..e284fc8 100644 --- a/cmd/mempool/models/transaction.go +++ b/cmd/mempool/models/transaction.go @@ -4,6 +4,7 @@ package models type Transaction struct { //nolint tableName struct{} `pg:"transactions"` + MempoolOperation Source string `json:"source" index:"transaction_source_idx"` Fee int64 `json:"fee,string"`