check indices in test
This commit is contained in:
parent
1b4a91703b
commit
292abcd9af
@ -131,6 +131,7 @@ func DoTestPublishAndIndexTransactionIPLDs(t *testing.T, db sql.Database) {
|
|||||||
}
|
}
|
||||||
txTypeAndValueStr := `SELECT tx_type, CAST(value as TEXT) FROM eth.transaction_cids WHERE cid = $1`
|
txTypeAndValueStr := `SELECT tx_type, CAST(value as TEXT) FROM eth.transaction_cids WHERE cid = $1`
|
||||||
txBlobHashQuery := `SELECT blob_hash FROM eth.blob_hashes WHERE tx_hash = $1`
|
txBlobHashQuery := `SELECT blob_hash FROM eth.blob_hashes WHERE tx_hash = $1`
|
||||||
|
txBlobIndexQuery := `SELECT index FROM eth.blob_hashes WHERE tx_hash = $1`
|
||||||
switch c {
|
switch c {
|
||||||
case txCIDs[0].String():
|
case txCIDs[0].String():
|
||||||
require.Equal(t, encodedTxs[0], data)
|
require.Equal(t, encodedTxs[0], data)
|
||||||
@ -206,12 +207,19 @@ func DoTestPublishAndIndexTransactionIPLDs(t *testing.T, db sql.Database) {
|
|||||||
}
|
}
|
||||||
require.Equal(t, types.BlobTxType, txRes.TxType)
|
require.Equal(t, types.BlobTxType, txRes.TxType)
|
||||||
require.Equal(t, transactions[5].Value().String(), txRes.Value)
|
require.Equal(t, transactions[5].Value().String(), txRes.Value)
|
||||||
|
|
||||||
var txBlobHashes []common.Hash
|
var txBlobHashes []common.Hash
|
||||||
|
var txBlobIndices []uint64
|
||||||
err = db.Select(context.Background(), &txBlobHashes, txBlobHashQuery, transactions[5].Hash().String())
|
err = db.Select(context.Background(), &txBlobHashes, txBlobHashQuery, transactions[5].Hash().String())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
require.Equal(t, transactions[5].BlobHashes(), txBlobHashes)
|
require.Equal(t, transactions[5].BlobHashes(), txBlobHashes)
|
||||||
|
err = db.Select(context.Background(), &txBlobIndices, txBlobIndexQuery, transactions[5].Hash().String())
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
require.Equal(t, []uint64{0, 1}, txBlobIndices)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user