Skip to content

Commit

Permalink
Updated logging (paritytech#628)
Browse files Browse the repository at this point in the history
* Updated logging

* updated error message
  • Loading branch information
alistair-singh committed May 24, 2022
1 parent 15dd73c commit 0b94014
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions relayer/relays/ethereum/parachain-writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -228,16 +228,16 @@ func (wr *ParachainWriter) makeHeaderImportCall(header *chain.Header) (types.Cal
func (wr *ParachainWriter) queryImportedHeaderExists(hash types.H256) (bool, error) {
key, err := types.CreateStorageKey(wr.conn.Metadata(), "EthereumLightClient", "Headers", hash[:], nil)
if err != nil {
return false, err
return false, fmt.Errorf("failed to create storeage key for hash %s with error: %s", hash.Hex(), err)
}

var headerOption types.OptionBytes
ok, err := wr.conn.API().RPC.State.GetStorageLatest(key, &headerOption)
if err != nil {
return false, err
return false, fmt.Errorf("storage query failed for key %s and hash %s with error: %s", key.Hex(), hash.Hex(), err)
}
if !ok {
return false, fmt.Errorf("Storage query did not find header for hash %s", hash.Hex())
return false, fmt.Errorf("storage query did not find header for key %s and hash %s", key.Hex(), hash.Hex())
}

return headerOption.IsSome(), nil
Expand Down

0 comments on commit 0b94014

Please sign in to comment.