Commit 9871b9ac authored by protolambda's avatar protolambda

op-node,op-program: tx hashing function naming

parent 04a75430
...@@ -34,7 +34,8 @@ func DecodeTransactions(data []hexutil.Bytes) ([]*types.Transaction, error) { ...@@ -34,7 +34,8 @@ func DecodeTransactions(data []hexutil.Bytes) ([]*types.Transaction, error) {
return dest, nil return dest, nil
} }
func HashTransactions(elems []*types.Transaction) []common.Hash { // TransactionsToHashes computes the transaction-hash for every transaction in the input.
func TransactionsToHashes(elems []*types.Transaction) []common.Hash {
out := make([]common.Hash, len(elems)) out := make([]common.Hash, len(elems))
for i, el := range elems { for i, el := range elems {
out[i] = el.Hash() out[i] = el.Hash()
......
...@@ -356,7 +356,7 @@ func (s *EthClient) FetchReceipts(ctx context.Context, blockHash common.Hash) (e ...@@ -356,7 +356,7 @@ func (s *EthClient) FetchReceipts(ctx context.Context, blockHash common.Hash) (e
if v, ok := s.receiptsCache.Get(blockHash); ok { if v, ok := s.receiptsCache.Get(blockHash); ok {
job = v.(*receiptsFetchingJob) job = v.(*receiptsFetchingJob)
} else { } else {
txHashes := eth.HashTransactions(txs) txHashes := eth.TransactionsToHashes(txs)
job = NewReceiptsFetchingJob(s, s.client, s.maxBatchSize, eth.ToBlockID(info), info.ReceiptHash(), txHashes) job = NewReceiptsFetchingJob(s, s.client, s.maxBatchSize, eth.ToBlockID(info), info.ReceiptHash(), txHashes)
s.receiptsCache.Add(blockHash, job) s.receiptsCache.Add(blockHash, job)
} }
......
...@@ -78,7 +78,7 @@ func (p *PreimageOracle) ReceiptsByBlockHash(blockHash common.Hash) (eth.BlockIn ...@@ -78,7 +78,7 @@ func (p *PreimageOracle) ReceiptsByBlockHash(blockHash common.Hash) (eth.BlockIn
return p.oracle.Get(preimage.Keccak256Key(key)) return p.oracle.Get(preimage.Keccak256Key(key))
}) })
txHashes := eth.HashTransactions(txs) txHashes := eth.TransactionsToHashes(txs)
receipts, err := eth.DecodeRawReceipts(eth.ToBlockID(info), opaqueReceipts, txHashes) receipts, err := eth.DecodeRawReceipts(eth.ToBlockID(info), opaqueReceipts, txHashes)
if err != nil { if err != nil {
panic(fmt.Errorf("bad receipts data for block %s: %w", blockHash, err)) panic(fmt.Errorf("bad receipts data for block %s: %w", blockHash, err))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment