From 7a2ef4f542c2c7eb4059b090423c4806a8604ca0 Mon Sep 17 00:00:00 2001 From: Roy Crihfield Date: Tue, 22 Feb 2022 17:03:06 +0800 Subject: [PATCH] fix fixtures --- pkg/snapshot/file/publisher_test.go | 12 ++++++------ pkg/snapshot/pg/publisher_test.go | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/pkg/snapshot/file/publisher_test.go b/pkg/snapshot/file/publisher_test.go index ac8c9fe..382ec0c 100644 --- a/pkg/snapshot/file/publisher_test.go +++ b/pkg/snapshot/file/publisher_test.go @@ -33,12 +33,12 @@ var ( func writeFiles(t *testing.T, dir string) *publisher { pub, err := NewPublisher(dir, nodeInfo) test.NoError(t, err) - test.NoError(t, pub.PublishHeader(&fixt.Header1)) + test.NoError(t, pub.PublishHeader(&fixt.Block1_Header)) tx, err := pub.BeginTx() test.NoError(t, err) - headerID := fixt.Header1.Hash().String() - test.NoError(t, pub.PublishStateNode(&fixt.StateNode1, headerID, tx)) + headerID := fixt.Block1_Header.Hash().String() + test.NoError(t, pub.PublishStateNode(&fixt.Block1_StateNode0, headerID, tx)) test.NoError(t, tx.Commit()) return pub @@ -122,11 +122,11 @@ func TestPgCopy(t *testing.T) { BlockHash string } var header res - err = conn.QueryRow(ctx, pgQueryHeader, fixt.Header1.Number.Uint64()).Scan( + err = conn.QueryRow(ctx, pgQueryHeader, fixt.Block1_Header.Number.Uint64()).Scan( &header.CID, &header.BlockHash) test.NoError(t, err) - headerNode, err := ipld.NewEthHeader(&fixt.Header1) + headerNode, err := ipld.NewEthHeader(&fixt.Block1_Header) test.ExpectEqual(t, headerNode.Cid().String(), header.CID) - test.ExpectEqual(t, fixt.Header1.Hash().String(), header.BlockHash) + test.ExpectEqual(t, fixt.Block1_Header.Hash().String(), header.BlockHash) } diff --git a/pkg/snapshot/pg/publisher_test.go b/pkg/snapshot/pg/publisher_test.go index c4860aa..a6e9842 100644 --- a/pkg/snapshot/pg/publisher_test.go +++ b/pkg/snapshot/pg/publisher_test.go @@ -31,12 +31,12 @@ func writeData(t *testing.T) *publisher { driver, err := postgres.NewPGXDriver(context.Background(), pgConfig, nodeInfo) test.NoError(t, err) pub := NewPublisher(postgres.NewPostgresDB(driver)) - test.NoError(t, pub.PublishHeader(&fixt.Header1)) + test.NoError(t, pub.PublishHeader(&fixt.Block1_Header)) tx, err := pub.BeginTx() test.NoError(t, err) - headerID := fixt.Header1.Hash().String() - test.NoError(t, pub.PublishStateNode(&fixt.StateNode1, headerID, tx)) + headerID := fixt.Block1_Header.Hash().String() + test.NoError(t, pub.PublishStateNode(&fixt.Block1_StateNode0, headerID, tx)) test.NoError(t, tx.Commit()) return pub @@ -68,11 +68,11 @@ func TestBasic(t *testing.T) { BlockHash string } var header res - err = conn.QueryRow(ctx, pgQueryHeader, fixt.Header1.Number.Uint64()).Scan( + err = conn.QueryRow(ctx, pgQueryHeader, fixt.Block1_Header.Number.Uint64()).Scan( &header.CID, &header.BlockHash) test.NoError(t, err) - headerNode, err := ipld.NewEthHeader(&fixt.Header1) + headerNode, err := ipld.NewEthHeader(&fixt.Block1_Header) test.ExpectEqual(t, headerNode.Cid().String(), header.CID) - test.ExpectEqual(t, fixt.Header1.Hash().String(), header.BlockHash) + test.ExpectEqual(t, fixt.Block1_Header.Hash().String(), header.BlockHash) }