Skip to content

Commit

Permalink
remove unused method
Browse files Browse the repository at this point in the history
  • Loading branch information
tudor-malene committed Jun 14, 2024
1 parent ad7f9f3 commit 3724ade
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 25 deletions.
17 changes: 0 additions & 17 deletions go/enclave/storage/enclavedb/batch.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down
2 changes: 0 additions & 2 deletions go/enclave/storage/interfaces.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
6 changes: 0 additions & 6 deletions go/enclave/storage/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 3724ade

Please sign in to comment.