From 6b010bec737adeb4bdced53429310a57ff29c759 Mon Sep 17 00:00:00 2001 From: Thomas E Lackey Date: Mon, 19 Sep 2022 16:41:22 -0500 Subject: [PATCH] Refactor the Eth1Data.block_hash DB column name as well. --- pkg/beaconclient/capturehead_test.go | 2 +- pkg/beaconclient/databasewrite.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/beaconclient/capturehead_test.go b/pkg/beaconclient/capturehead_test.go index b596b94..fd9084e 100644 --- a/pkg/beaconclient/capturehead_test.go +++ b/pkg/beaconclient/capturehead_test.go @@ -568,7 +568,7 @@ func queryDbSlotAndBlock(db sql.Database, querySlot string, queryBlockRoot strin // A helper function to query the eth_beacon.signed_block table based on the slot and block_root. func queryDbSignedBeaconBlock(db sql.Database, querySlot string, queryBlockRoot string) (int, string, string, string, string) { - sqlStatement := `SELECT slot, block_root, parent_block_root, eth1_block_hash, mh_key FROM eth_beacon.signed_block WHERE slot=$1 AND block_root=$2;` + sqlStatement := `SELECT slot, block_root, parent_block_root, eth1_data_block_hash, mh_key FROM eth_beacon.signed_block WHERE slot=$1 AND block_root=$2;` var slot int var blockRoot, parentBlockRoot, eth1DataBlockHash, mhKey string row := db.QueryRow(context.Background(), sqlStatement, querySlot, queryBlockRoot) diff --git a/pkg/beaconclient/databasewrite.go b/pkg/beaconclient/databasewrite.go index 0357f06..62df98e 100644 --- a/pkg/beaconclient/databasewrite.go +++ b/pkg/beaconclient/databasewrite.go @@ -34,7 +34,7 @@ INSERT INTO eth_beacon.slots (epoch, slot, block_root, state_root, status) VALUES ($1, $2, $3, $4, $5) ON CONFLICT (slot, block_root) DO NOTHING` // Statement to upsert to the eth_beacon.signed_blocks table. UpsertSignedBeaconBlockStmt string = ` -INSERT INTO eth_beacon.signed_block (slot, block_root, parent_block_root, eth1_block_hash, mh_key) +INSERT INTO eth_beacon.signed_block (slot, block_root, parent_block_root, eth1_data_block_hash, mh_key) VALUES ($1, $2, $3, $4, $5) ON CONFLICT (slot, block_root) DO NOTHING` // Statement to upsert to the eth_beacon.state table. UpsertBeaconState string = `