mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2025-01-18 16:44:12 +00:00
fixed api.blockWithSenders (#3435)
* fix * fix 2 * fixed api.blockWithSenders * removed white space * pretty
This commit is contained in:
parent
4da9a663f8
commit
1602842a63
@ -432,10 +432,10 @@ func (rs Receipts) EncodeIndex(i int, w *bytes.Buffer) {
|
|||||||
func (r Receipts) DeriveFields(hash common.Hash, number uint64, txs Transactions, senders []common.Address) error {
|
func (r Receipts) DeriveFields(hash common.Hash, number uint64, txs Transactions, senders []common.Address) error {
|
||||||
logIndex := uint(0) // logIdx is unique within the block and starts from 0
|
logIndex := uint(0) // logIdx is unique within the block and starts from 0
|
||||||
if len(txs) != len(r) {
|
if len(txs) != len(r) {
|
||||||
return errors.New("transaction and receipt count mismatch")
|
return fmt.Errorf("transaction and receipt count mismatch, tx count = %d, receipts count = %d", len(txs), len(r))
|
||||||
}
|
}
|
||||||
if len(senders) != len(txs) {
|
if len(senders) != len(txs) {
|
||||||
return errors.New("transaction and senders count mismatch")
|
return fmt.Errorf("transaction and senders count mismatch, tx count = %d, receipts count = %d", len(txs), len(r))
|
||||||
}
|
}
|
||||||
for i := 0; i < len(r); i++ {
|
for i := 0; i < len(r); i++ {
|
||||||
// The transaction type and hash can be retrieved from the transaction itself
|
// The transaction type and hash can be retrieved from the transaction itself
|
||||||
|
@ -216,8 +216,8 @@ func (s *EthBackendServer) Block(ctx context.Context, req *remote.BlockRequest)
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
sendersBytes := make([]byte, 20*len(senders))
|
sendersBytes := make([]byte, 20*len(senders))
|
||||||
for i := range senders {
|
for i, sender := range senders {
|
||||||
sendersBytes = append(sendersBytes, senders[i][:]...)
|
copy(sendersBytes[i*20:], sender[:])
|
||||||
}
|
}
|
||||||
return &remote.BlockReply{BlockRlp: blockRlp, Senders: sendersBytes}, nil
|
return &remote.BlockReply{BlockRlp: blockRlp, Senders: sendersBytes}, nil
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user