Fixes for unit tests

This commit is contained in:
Prathamesh Musale 2022-03-14 15:27:58 +05:30
parent 43ddbc7eea
commit 3aa5cb36ef
5 changed files with 8 additions and 7 deletions

View File

@ -19,7 +19,7 @@ services:
ipld-eth-db: ipld-eth-db:
restart: always restart: always
image: vulcanize/ipld-eth-db:v3.0.6 image: vulcanize/ipld-eth-db:v0.3.1
environment: environment:
POSTGRES_USER: "vdbm" POSTGRES_USER: "vdbm"
POSTGRES_DB: "vulcanize_testing" POSTGRES_DB: "vulcanize_testing"

View File

@ -65,10 +65,10 @@ var (
const ( const (
RetrieveCanonicalBlockHashByNumber = `SELECT block_hash FROM eth.header_cids RetrieveCanonicalBlockHashByNumber = `SELECT block_hash FROM eth.header_cids
INNER JOIN public.blocks ON (header_cids.mh_key = blocks.key) INNER JOIN public.blocks ON (header_cids.mh_key = blocks.key)
WHERE block_hash = (SELECT canonical_header_id($1))` WHERE block_hash = (SELECT canonical_header_hash($1))`
RetrieveCanonicalHeaderByNumber = `SELECT cid, data FROM eth.header_cids RetrieveCanonicalHeaderByNumber = `SELECT cid, data FROM eth.header_cids
INNER JOIN public.blocks ON (header_cids.mh_key = blocks.key) INNER JOIN public.blocks ON (header_cids.mh_key = blocks.key)
WHERE block_hash = (SELECT canonical_header_id($1))` WHERE block_hash = (SELECT canonical_header_hash($1))`
RetrieveTD = `SELECT CAST(td as Text) FROM eth.header_cids RetrieveTD = `SELECT CAST(td as Text) FROM eth.header_cids
WHERE header_cids.block_hash = $1` WHERE header_cids.block_hash = $1`
RetrieveRPCTransaction = `SELECT blocks.data, block_hash, block_number, index FROM public.blocks, eth.transaction_cids, eth.header_cids RetrieveRPCTransaction = `SELECT blocks.data, block_hash, block_number, index FROM public.blocks, eth.transaction_cids, eth.header_cids
@ -82,7 +82,7 @@ const (
AND block_number <= (SELECT block_number AND block_number <= (SELECT block_number
FROM eth.header_cids FROM eth.header_cids
WHERE block_hash = $2) WHERE block_hash = $2)
AND header_cids.block_hash = (SELECT canonical_header_id(block_number)) AND header_cids.block_hash = (SELECT canonical_header_hash(block_number))
ORDER BY block_number DESC ORDER BY block_number DESC
LIMIT 1` LIMIT 1`
RetrieveCodeByMhKey = `SELECT data FROM public.blocks WHERE key = $1` RetrieveCodeByMhKey = `SELECT data FROM public.blocks WHERE key = $1`

View File

@ -116,7 +116,7 @@ const (
AND block_number <= (SELECT block_number AND block_number <= (SELECT block_number
FROM eth.header_cids FROM eth.header_cids
WHERE block_hash = $2) WHERE block_hash = $2)
AND header_cids.block_hash = (SELECT canonical_header_id(block_number)) AND header_cids.block_hash = (SELECT canonical_header_hash(block_number))
ORDER BY block_number DESC ORDER BY block_number DESC
LIMIT 1` LIMIT 1`
RetrieveAccountByLeafKeyAndBlockNumberPgStr = `SELECT state_cids.cid, data, state_cids.node_type RetrieveAccountByLeafKeyAndBlockNumberPgStr = `SELECT state_cids.cid, data, state_cids.node_type
@ -147,7 +147,7 @@ const (
AND block_number <= (SELECT block_number AND block_number <= (SELECT block_number
FROM eth.header_cids FROM eth.header_cids
WHERE block_hash = $3) WHERE block_hash = $3)
AND header_cids.block_hash = (SELECT canonical_header_id(block_number)) AND header_cids.block_hash = (SELECT canonical_header_hash(block_number))
ORDER BY block_number DESC ORDER BY block_number DESC
LIMIT 1` LIMIT 1`
) )

View File

@ -453,6 +453,7 @@ var (
Bloom: MockBlock.Bloom().Bytes(), Bloom: MockBlock.Bloom().Bytes(),
Timestamp: MockBlock.Time(), Timestamp: MockBlock.Time(),
TimesValidated: 1, TimesValidated: 1,
Coinbase: "0x0000000000000000000000000000000000000000",
}, },
Transactions: MockTrxMetaPostPublsh, Transactions: MockTrxMetaPostPublsh,
Receipts: MockRctMetaPostPublish, Receipts: MockRctMetaPostPublish,

View File

@ -248,7 +248,7 @@ type ConvertedPayload struct {
// LogResult represent a log. // LogResult represent a log.
type LogResult struct { type LogResult struct {
LeafCID string `db:"leaf_cid"` LeafCID string `db:"leaf_cid"`
ReceiptID int64 `db:"rct_id"` ReceiptID string `db:"rct_id"`
Address string `db:"address"` Address string `db:"address"`
Index int64 `db:"index"` Index int64 `db:"index"`
Data []byte `db:"log_data"` Data []byte `db:"log_data"`