Commit 7495d400 authored by mergify[bot]'s avatar mergify[bot] Committed by GitHub

Merge branch 'develop' into op-program-pre-image-comms

parents 825948d5 77f99532
...@@ -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))
......
...@@ -32,7 +32,7 @@ const ( ...@@ -32,7 +32,7 @@ const (
// The zero key type is illegal to use, ensuring all keys are non-zero. // The zero key type is illegal to use, ensuring all keys are non-zero.
_ KeyType = 0 _ KeyType = 0
// LocalKeyType is for input-type pre-images, specific to the local program instance. // LocalKeyType is for input-type pre-images, specific to the local program instance.
LocalKeyType KeyType = 0 LocalKeyType KeyType = 1
// Keccak25Key6Type is for keccak256 pre-images, for any global shared pre-images. // Keccak25Key6Type is for keccak256 pre-images, for any global shared pre-images.
Keccak25Key6Type KeyType = 2 Keccak25Key6Type KeyType = 2
) )
......
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