mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-16 17:03:46 +00:00
save
This commit is contained in:
parent
91cd4a8c8b
commit
14764d13c5
1 changed files with 7 additions and 3 deletions
|
|
@ -66,16 +66,20 @@ func (s *Server) GetTransactionReceipt(ctx context.Context, req *protobor.Receip
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
receipts, err := s.backend.APIBackend.GetReceipts(ctx, blockHash)
|
receipt, err := s.backend.APIBackend.GetReceipts(ctx, blockHash)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(receipts) <= int(txnIndex) {
|
if receipt == nil {
|
||||||
|
return nil, errors.New("no receipt found")
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(receipt) <= 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(receipts[txnIndex])}, nil
|
return &protobor.ReceiptResponse{Receipt: ConvertReceiptToProtoReceipt(receipt[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) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue