Skip to content

Commit

Permalink
Fix typo in msgdump structs (#709)
Browse files Browse the repository at this point in the history
Minor typo fix.

While at it, use temp dir from `t` in parquet test even though it is
currently skipped.
  • Loading branch information
masih authored Oct 8, 2024
1 parent 866f785 commit 25c3ade
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
10 changes: 5 additions & 5 deletions cmd/f3/msgdump/cbor_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion cmd/f3/msgdump/envelope.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@ import (
cbg "github.com/whyrusleeping/cbor-gen"
)

type GMessageEnvelopeDeffered struct {
type GMessageEnvelopeDeferred struct {
UnixMicroTime int64
NetworkName string
Message cbg.Deferred
}

type GMessageEnvelope struct {
UnixMicroTime int64
NetworkName string
Expand Down
4 changes: 2 additions & 2 deletions cmd/f3/msgdump/parquet_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ import (
"github.com/stretchr/testify/require"
)

var sampleMessageJSON = `{"UnixMicroTime":1723047990453259,"NetworkName":"testnetnet/1","Message":{"Sender":22352,"Vote":{"Instance":9,"Round":0,"Phase":5,"SupplementalData":{"Commitments":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"PowerTable":"AXGg5AIg0NYh/YFdOj1N45I1zYmUDyoUs9OpZX1zOQPXzBCeRVk="},"Value":[{"Epoch":4158041,"Key":"AXGg5AIgsGmu9dWNsCG9YBE67100gPoU8eCoqGwsGRLxTqy70fYBcaDkAiA7TOrxgatUIdYancl6cIiFdMgtPJqjvP/5Z6yRP4PrVwFxoOQCIDKEai58tsmOy0cdqGmip3xIxKWxbqIgKLzQIXeHOyW1AXGg5AIgu6nRqVZI9JjjplGZNrfVh992Dy77PwfDVdgBKzT63qUBcaDkAiCR2nxb4FyBs4BbypT0ygV/LUMuUX5JfEa43Rvs9C3tCAFxoOQCIEZZhUO0pTh1R3F9A1x4OmDWi4+L04AYKWsUCuZ8SKrU","PowerTable":"AXGg5AIg0NYh/YFdOj1N45I1zYmUDyoUs9OpZX1zOQPXzBCeRVk=","Commitments":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},{"Epoch":4158042,"Key":"AXGg5AIgcaua1NcW/0t7O5Yr+5mkeLu9Xj7iwwnFAOiRCpiANvsBcaDkAiAlQlpraJB33Ttm9fj0xh3+hMXLRRsxffPnfEgt4HB9GA==","PowerTable":"AXGg5AIg0NYh/YFdOj1N45I1zYmUDyoUs9OpZX1zOQPXzBCeRVk=","Commitments":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},{"Epoch":4158043,"Key":"AXGg5AIgO4WgDY44KF+3S/g8Ksj+BTZiWAXsXsLs/ltUUirCPXoBcaDkAiB+e1I6r/vrCl//RP32mDExEAzHLiQbofO0g7DuBQ+S+wFxoOQCILFWQDpPl8dWxDr0Cu9RRpfY3gLFeQUJaRgFYZs0YC2MAXGg5AIgOIETEvAAle5EpWsj83n6hlJdmCqzVRY62v6e7vEHQfYBcaDkAiCNsHNANtqtVy+rFDjXmtBasidiN4sNZdQ6sjtGl+OWxg==","PowerTable":"AXGg5AIg0NYh/YFdOj1N45I1zYmUDyoUs9OpZX1zOQPXzBCeRVk=","Commitments":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}]},"Signature":"igXCqi8jKSuYse+Fgg1ue8dqQ2fs8C73LBxjyyg0od99dpOsbs07mMjPLSJ/1hqoGUhzQdfsWgtmz/D96W++pY8BsidnchUzBQd7MoqgDmncFg6jbgxRwYplp+NyVsjb","Ticket":null,"Justification":{"Vote":{"Instance":9,"Round":0,"Phase":4,"SupplementalData":{"Commitments":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"PowerTable":"AXGg5AIg0NYh/YFdOj1N45I1zYmUDyoUs9OpZX1zOQPXzBCeRVk="},"Value":[{"Epoch":4158041,"Key":"AXGg5AIgsGmu9dWNsCG9YBE67100gPoU8eCoqGwsGRLxTqy70fYBcaDkAiA7TOrxgatUIdYancl6cIiFdMgtPJqjvP/5Z6yRP4PrVwFxoOQCIDKEai58tsmOy0cdqGmip3xIxKWxbqIgKLzQIXeHOyW1AXGg5AIgu6nRqVZI9JjjplGZNrfVh992Dy77PwfDVdgBKzT63qUBcaDkAiCR2nxb4FyBs4BbypT0ygV/LUMuUX5JfEa43Rvs9C3tCAFxoOQCIEZZhUO0pTh1R3F9A1x4OmDWi4+L04AYKWsUCuZ8SKrU","PowerTable":"AXGg5AIg0NYh/YFdOj1N45I1zYmUDyoUs9OpZX1zOQPXzBCeRVk=","Commitments":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},{"Epoch":4158042,"Key":"AXGg5AIgcaua1NcW/0t7O5Yr+5mkeLu9Xj7iwwnFAOiRCpiANvsBcaDkAiAlQlpraJB33Ttm9fj0xh3+hMXLRRsxffPnfEgt4HB9GA==","PowerTable":"AXGg5AIg0NYh/YFdOj1N45I1zYmUDyoUs9OpZX1zOQPXzBCeRVk=","Commitments":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},{"Epoch":4158043,"Key":"AXGg5AIgO4WgDY44KF+3S/g8Ksj+BTZiWAXsXsLs/ltUUirCPXoBcaDkAiB+e1I6r/vrCl//RP32mDExEAzHLiQbofO0g7DuBQ+S+wFxoOQCILFWQDpPl8dWxDr0Cu9RRpfY3gLFeQUJaRgFYZs0YC2MAXGg5AIgOIETEvAAle5EpWsj83n6hlJdmCqzVRY62v6e7vEHQfYBcaDkAiCNsHNANtqtVy+rFDjXmtBasidiN4sNZdQ6sjtGl+OWxg==","PowerTable":"AXGg5AIg0NYh/YFdOj1N45I1zYmUDyoUs9OpZX1zOQPXzBCeRVk=","Commitments":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}]},"Signers":[0,1,2,3],"Signature":"jlfS7Oairfycsh7cCkrmqOFE5+kl7WQOEFKmIcnTLW1y430B2txugrC/FNhi/cbPDuJ32ZSMDoFCjFwZpK1zjDPvIchy5dX3nGWGlNxMGSiRdhEtz47ANqZ7WuFoupTG"}}}`
var sampleMessageJSON = []byte(`{"UnixMicroTime":1723047990453259,"NetworkName":"testnetnet/1","Message":{"Sender":22352,"Vote":{"Instance":9,"Round":0,"Phase":5,"SupplementalData":{"Commitments":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"PowerTable":"AXGg5AIg0NYh/YFdOj1N45I1zYmUDyoUs9OpZX1zOQPXzBCeRVk="},"Value":[{"Epoch":4158041,"Key":"AXGg5AIgsGmu9dWNsCG9YBE67100gPoU8eCoqGwsGRLxTqy70fYBcaDkAiA7TOrxgatUIdYancl6cIiFdMgtPJqjvP/5Z6yRP4PrVwFxoOQCIDKEai58tsmOy0cdqGmip3xIxKWxbqIgKLzQIXeHOyW1AXGg5AIgu6nRqVZI9JjjplGZNrfVh992Dy77PwfDVdgBKzT63qUBcaDkAiCR2nxb4FyBs4BbypT0ygV/LUMuUX5JfEa43Rvs9C3tCAFxoOQCIEZZhUO0pTh1R3F9A1x4OmDWi4+L04AYKWsUCuZ8SKrU","PowerTable":"AXGg5AIg0NYh/YFdOj1N45I1zYmUDyoUs9OpZX1zOQPXzBCeRVk=","Commitments":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},{"Epoch":4158042,"Key":"AXGg5AIgcaua1NcW/0t7O5Yr+5mkeLu9Xj7iwwnFAOiRCpiANvsBcaDkAiAlQlpraJB33Ttm9fj0xh3+hMXLRRsxffPnfEgt4HB9GA==","PowerTable":"AXGg5AIg0NYh/YFdOj1N45I1zYmUDyoUs9OpZX1zOQPXzBCeRVk=","Commitments":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},{"Epoch":4158043,"Key":"AXGg5AIgO4WgDY44KF+3S/g8Ksj+BTZiWAXsXsLs/ltUUirCPXoBcaDkAiB+e1I6r/vrCl//RP32mDExEAzHLiQbofO0g7DuBQ+S+wFxoOQCILFWQDpPl8dWxDr0Cu9RRpfY3gLFeQUJaRgFYZs0YC2MAXGg5AIgOIETEvAAle5EpWsj83n6hlJdmCqzVRY62v6e7vEHQfYBcaDkAiCNsHNANtqtVy+rFDjXmtBasidiN4sNZdQ6sjtGl+OWxg==","PowerTable":"AXGg5AIg0NYh/YFdOj1N45I1zYmUDyoUs9OpZX1zOQPXzBCeRVk=","Commitments":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}]},"Signature":"igXCqi8jKSuYse+Fgg1ue8dqQ2fs8C73LBxjyyg0od99dpOsbs07mMjPLSJ/1hqoGUhzQdfsWgtmz/D96W++pY8BsidnchUzBQd7MoqgDmncFg6jbgxRwYplp+NyVsjb","Ticket":null,"Justification":{"Vote":{"Instance":9,"Round":0,"Phase":4,"SupplementalData":{"Commitments":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"PowerTable":"AXGg5AIg0NYh/YFdOj1N45I1zYmUDyoUs9OpZX1zOQPXzBCeRVk="},"Value":[{"Epoch":4158041,"Key":"AXGg5AIgsGmu9dWNsCG9YBE67100gPoU8eCoqGwsGRLxTqy70fYBcaDkAiA7TOrxgatUIdYancl6cIiFdMgtPJqjvP/5Z6yRP4PrVwFxoOQCIDKEai58tsmOy0cdqGmip3xIxKWxbqIgKLzQIXeHOyW1AXGg5AIgu6nRqVZI9JjjplGZNrfVh992Dy77PwfDVdgBKzT63qUBcaDkAiCR2nxb4FyBs4BbypT0ygV/LUMuUX5JfEa43Rvs9C3tCAFxoOQCIEZZhUO0pTh1R3F9A1x4OmDWi4+L04AYKWsUCuZ8SKrU","PowerTable":"AXGg5AIg0NYh/YFdOj1N45I1zYmUDyoUs9OpZX1zOQPXzBCeRVk=","Commitments":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},{"Epoch":4158042,"Key":"AXGg5AIgcaua1NcW/0t7O5Yr+5mkeLu9Xj7iwwnFAOiRCpiANvsBcaDkAiAlQlpraJB33Ttm9fj0xh3+hMXLRRsxffPnfEgt4HB9GA==","PowerTable":"AXGg5AIg0NYh/YFdOj1N45I1zYmUDyoUs9OpZX1zOQPXzBCeRVk=","Commitments":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},{"Epoch":4158043,"Key":"AXGg5AIgO4WgDY44KF+3S/g8Ksj+BTZiWAXsXsLs/ltUUirCPXoBcaDkAiB+e1I6r/vrCl//RP32mDExEAzHLiQbofO0g7DuBQ+S+wFxoOQCILFWQDpPl8dWxDr0Cu9RRpfY3gLFeQUJaRgFYZs0YC2MAXGg5AIgOIETEvAAle5EpWsj83n6hlJdmCqzVRY62v6e7vEHQfYBcaDkAiCNsHNANtqtVy+rFDjXmtBasidiN4sNZdQ6sjtGl+OWxg==","PowerTable":"AXGg5AIg0NYh/YFdOj1N45I1zYmUDyoUs9OpZX1zOQPXzBCeRVk=","Commitments":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}]},"Signers":[0,1,2,3],"Signature":"jlfS7Oairfycsh7cCkrmqOFE5+kl7WQOEFKmIcnTLW1y430B2txugrC/FNhi/cbPDuJ32ZSMDoFCjFwZpK1zjDPvIchy5dX3nGWGlNxMGSiRdhEtz47ANqZ7WuFoupTG"}}}`)

func TestOpenAndWriteParquetFile(t *testing.T) {
t.SkipNow()
pw, err := NewParquetWriter[ParquetEnvelope]("/tmp/pq-test")
require.NoError(t, err)

var gEnvelope GMessageEnvelope
require.NoError(t, json.Unmarshal([]byte(sampleMessageJSON), &gEnvelope))
require.NoError(t, json.Unmarshal(sampleMessageJSON, &gEnvelope))
row, err := ToParquet(gEnvelope)
require.NoError(t, err)
_, err = pw.Write(row)
Expand Down
2 changes: 1 addition & 1 deletion gen/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func main() {
eg.Go(func() error {
return gen.WriteTupleEncodersToFile("../cmd/f3/msgdump/cbor_gen.go", "msgdump",
msgdump.GMessageEnvelope{},
msgdump.GMessageEnvelopeDeffered{},
msgdump.GMessageEnvelopeDeferred{},
)
})
if err := eg.Wait(); err != nil {
Expand Down

0 comments on commit 25c3ade

Please sign in to comment.