|
|
@ -241,13 +241,14 @@ func (ec *Client) TransactionCount(ctx context.Context, blockHash common.Hash) ( |
|
|
|
func (ec *Client) TransactionInBlock(ctx context.Context, blockHash common.Hash, index uint) (*types.Transaction, error) { |
|
|
|
func (ec *Client) TransactionInBlock(ctx context.Context, blockHash common.Hash, index uint) (*types.Transaction, error) { |
|
|
|
var json *rpcTransaction |
|
|
|
var json *rpcTransaction |
|
|
|
err := ec.c.CallContext(ctx, &json, "eth_getTransactionByBlockHashAndIndex", blockHash, hexutil.Uint64(index)) |
|
|
|
err := ec.c.CallContext(ctx, &json, "eth_getTransactionByBlockHashAndIndex", blockHash, hexutil.Uint64(index)) |
|
|
|
if err == nil { |
|
|
|
if err != nil { |
|
|
|
|
|
|
|
return nil, err |
|
|
|
|
|
|
|
} |
|
|
|
if json == nil { |
|
|
|
if json == nil { |
|
|
|
return nil, ethereum.NotFound |
|
|
|
return nil, ethereum.NotFound |
|
|
|
} else if _, r, _ := json.tx.RawSignatureValues(); r == nil { |
|
|
|
} else if _, r, _ := json.tx.RawSignatureValues(); r == nil { |
|
|
|
return nil, fmt.Errorf("server returned transaction without signature") |
|
|
|
return nil, fmt.Errorf("server returned transaction without signature") |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if json.From != nil && json.BlockHash != nil { |
|
|
|
if json.From != nil && json.BlockHash != nil { |
|
|
|
setSenderFromServer(json.tx, *json.From, *json.BlockHash) |
|
|
|
setSenderFromServer(json.tx, *json.From, *json.BlockHash) |
|
|
|
} |
|
|
|
} |
|
|
|