mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-14 16:03:45 +00:00
save
This commit is contained in:
parent
14764d13c5
commit
48c1d57e73
2 changed files with 5 additions and 6 deletions
|
|
@ -66,20 +66,20 @@ func (s *Server) GetTransactionReceipt(ctx context.Context, req *protobor.Receip
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
receipt, err := s.backend.APIBackend.GetReceipts(ctx, blockHash)
|
receipts, err := s.backend.APIBackend.GetReceipts(ctx, blockHash)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
if receipt == nil {
|
if receipts == nil {
|
||||||
return nil, errors.New("no receipt found")
|
return nil, errors.New("no receipts found")
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(receipt) <= int(txnIndex) {
|
if len(receipts) <= int(txnIndex) {
|
||||||
return nil, errors.New("transaction index out of bounds")
|
return nil, errors.New("transaction index out of bounds")
|
||||||
}
|
}
|
||||||
|
|
||||||
return &protobor.ReceiptResponse{Receipt: ConvertReceiptToProtoReceipt(receipt[txnIndex])}, nil
|
return &protobor.ReceiptResponse{Receipt: ConvertReceiptToProtoReceipt(receipts[txnIndex])}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *Server) GetBorBlockReceipt(ctx context.Context, req *protobor.ReceiptRequest) (*protobor.ReceiptResponse, error) {
|
func (s *Server) GetBorBlockReceipt(ctx context.Context, req *protobor.ReceiptRequest) (*protobor.ReceiptResponse, error) {
|
||||||
|
|
|
||||||
|
|
@ -71,7 +71,6 @@ func ConvertReceiptToProtoReceipt(receipt *types.Receipt) *protobor.Receipt {
|
||||||
GasUsed: receipt.GasUsed,
|
GasUsed: receipt.GasUsed,
|
||||||
EffectiveGasPrice: receipt.EffectiveGasPrice.Int64(),
|
EffectiveGasPrice: receipt.EffectiveGasPrice.Int64(),
|
||||||
BlobGasUsed: receipt.BlobGasUsed,
|
BlobGasUsed: receipt.BlobGasUsed,
|
||||||
BlobGasPrice: receipt.BlobGasPrice.Int64(),
|
|
||||||
BlockHash: protoutil.ConvertHashToH256(receipt.BlockHash),
|
BlockHash: protoutil.ConvertHashToH256(receipt.BlockHash),
|
||||||
BlockNumber: receipt.BlockNumber.Int64(),
|
BlockNumber: receipt.BlockNumber.Int64(),
|
||||||
TransactionIndex: uint64(receipt.TransactionIndex),
|
TransactionIndex: uint64(receipt.TransactionIndex),
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue