ethclient, ethereum: add NotFound, split transactions out of ChainReader
ethclient now returns ethereum.NotFound if the server returns null and no error while accessing blockchain data. The light client cannot provide arbitrary transactions. The change to split transaction access into its own interface emphasizes that transactions should not be relied on and recommends use of logs.
This commit is contained in:
@ -73,7 +73,8 @@ func (ec *EthereumClient) GetHeaderByNumber(ctx *Context, number int64) (*Header
|
||||
|
||||
// GetTransactionByHash returns the transaction with the given hash.
|
||||
func (ec *EthereumClient) GetTransactionByHash(ctx *Context, hash *Hash) (*Transaction, error) {
|
||||
tx, err := ec.client.TransactionByHash(ctx.context, hash.hash)
|
||||
// TODO(karalabe): handle isPending
|
||||
tx, _, err := ec.client.TransactionByHash(ctx.context, hash.hash)
|
||||
return &Transaction{tx}, err
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user