From 3724ade1effb349fe83fff36d183a24469ccb382 Mon Sep 17 00:00:00 2001 From: Tudor Malene Date: Fri, 14 Jun 2024 16:05:40 +0100 Subject: [PATCH] remove unused method --- go/enclave/storage/enclavedb/batch.go | 17 ----------------- go/enclave/storage/interfaces.go | 2 -- go/enclave/storage/storage.go | 6 ------ 3 files changed, 25 deletions(-) diff --git a/go/enclave/storage/enclavedb/batch.go b/go/enclave/storage/enclavedb/batch.go index 240e67adb9..a2a91dfb83 100644 --- a/go/enclave/storage/enclavedb/batch.go +++ b/go/enclave/storage/enclavedb/batch.go @@ -384,23 +384,6 @@ func ReadBatchTransactions(ctx context.Context, db *sql.DB, height uint64) ([]*c return txs, nil } -func GetContractCreationTx(ctx context.Context, db *sql.DB, address gethcommon.Address) (*gethcommon.Hash, error) { - row := db.QueryRowContext(ctx, "select tx.hash from exec_tx join tx on tx.id=exec_tx.tx join contract on created_contract_address=contract.id where address=? ", address.Bytes()) - - var txHashBytes []byte - err := row.Scan(&txHashBytes) - if err != nil { - if errors.Is(err, sql.ErrNoRows) { - // make sure the error is converted to obscuro-wide not found error - return nil, errutil.ErrNotFound - } - return nil, err - } - txHash := gethcommon.Hash{} - txHash.SetBytes(txHashBytes) - return &txHash, nil -} - func ReadContractCreationCount(ctx context.Context, db *sql.DB) (*big.Int, error) { row := db.QueryRowContext(ctx, "select id from contract order by id desc limit 1") diff --git a/go/enclave/storage/interfaces.go b/go/enclave/storage/interfaces.go index 80c817a87d..eb0558c643 100644 --- a/go/enclave/storage/interfaces.go +++ b/go/enclave/storage/interfaces.go @@ -98,8 +98,6 @@ type TransactionStorage interface { GetTransaction(ctx context.Context, txHash common.L2TxHash) (*types.Transaction, common.L2BatchHash, uint64, uint64, error) // GetTransactionReceipt - returns the receipt of a tx by tx hash GetTransactionReceipt(ctx context.Context, txHash common.L2TxHash) (*types.Receipt, error) - // GetContractCreationTx returns the hash of the tx that created a contract - GetContractCreationTx(ctx context.Context, address gethcommon.Address) (*gethcommon.Hash, error) } type AttestationStorage interface { diff --git a/go/enclave/storage/storage.go b/go/enclave/storage/storage.go index c2aa513060..a16b11ceb5 100644 --- a/go/enclave/storage/storage.go +++ b/go/enclave/storage/storage.go @@ -462,12 +462,6 @@ func (s *storageImpl) GetTransaction(ctx context.Context, txHash gethcommon.Hash return enclavedb.ReadTransaction(ctx, s.db.GetSQLDB(), txHash) } -// todo - get rid -func (s *storageImpl) GetContractCreationTx(ctx context.Context, address gethcommon.Address) (*gethcommon.Hash, error) { - defer s.logDuration("GetContractCreationTx", measure.NewStopwatch()) - return enclavedb.GetContractCreationTx(ctx, s.db.GetSQLDB(), address) -} - func (s *storageImpl) GetTransactionReceipt(ctx context.Context, txHash gethcommon.Hash) (*types.Receipt, error) { defer s.logDuration("GetTransactionReceipt", measure.NewStopwatch()) return enclavedb.ReadReceipt(ctx, s.db.GetSQLDB(), txHash, s.chainConfig)