prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Consider adding Chain Id to library
  * Version: 4.0.0-b
  * Python: 3.6.3
  * OS: linux
  
  ### What was wrong?
  
  No clear way to access known chain ids.
  
  ### How can it be fixed?
  
  Proposed syntax
  
  ```
  >>> from web3 import Chains
  >>> Chains.Ropsten.id
  3
  ```
  
  I ran into issues here: https://web3py.readthedocs.io/en/latest/web3.eth.account.html#sign-a-contract-transaction as `buildTransaction()` requires a `chainId`.  I didn't even know the chains had ids.
  
  ```
  >>> unicorn_txn = unicorns.functions.transfer(
  ...     '0xfB6916095ca1df60bB79Ce92cE3Ea74c37c5d359',
  ...     1,
  ... ).buildTransaction({
  ...     'chainId': 1,
  ...     'gas': 70000,
  ...     'gasPrice': w3.toWei('1', 'gwei'),
  ...     'nonce': nonce,
  ... })
  ```
  
  ### Maybe this will help others
  
  According to this answer https://ethereum.stackexchange.com/a/17101/7187 the chain ids are as follows:
  
  0: Olympic, Ethereum public pre-release testnet
  1: Frontier, Homestead, Metropolis, the Ethereum public main network
  1: Classic, the (un)forked public Ethereum Classic main network, chain ID 61
  1: Expanse, an alternative Ethereum implementation, chain ID 2
  2: Morden, the public Ethereum testnet, now Ethereum Classic testnet
  3: Ropsten, the public cross-client Ethereum testnet
  4: Rinkeby, the public Geth PoA testnet
  42: Kovan, the public Parity PoA testnet
  77: Sokol, the public POA Network testnet
  99: Core, the public POA Network main network
  7762959: Musicoin, the music blockchain
  
  Consider adding Chain Id to library
  * Version: 4.0.0-b
  * Python: 3.6.3
  * OS: linux
  
  ### What was wrong?
  
  No clear way to access known chain ids.
  
  ### How can it be fixed?
  
  Proposed syntax
  
  ```
  >>> from web3 import Chains
  >>> Chains.Ropsten.id
  3
  ```
  
  I ran into issues here: https://web3py.readthedocs.io/en/latest/web3.eth.account.html#sign-a-contract-transaction as `buildTransaction()` requires a `chainId`.  I didn't even know the chains had ids.
  
  ```
  >>> unicorn_txn = unicorns.functions.transfer(
  ...     '0xfB6916095ca1df60bB79Ce92cE3Ea74c37c5d359',
  ...     1,
  ... ).buildTransaction({
  ...     'chainId': 1,
  ...     'gas': 70000,
  ...     'gasPrice': w3.toWei('1', 'gwei'),
  ...     'nonce': nonce,
  ... })
  ```
  
  ### Maybe this will help others
  
  According to this answer https://ethereum.stackexchange.com/a/17101/7187 the chain ids are as follows:
  
  0: Olympic, Ethereum public pre-release testnet
  1: Frontier, Homestead, Metropolis, the Ethereum public main network
  1: Classic, the (un)forked public Ethereum Classic main network, chain ID 61
  1: Expanse, an alternative Ethereum implementation, chain ID 2
  2: Morden, the public Ethereum testnet, now Ethereum Classic testnet
  3: Ropsten, the public cross-client Ethereum testnet
  4: Rinkeby, the public Geth PoA testnet
  42: Kovan, the public Parity PoA testnet
  77: Sokol, the public POA Network testnet
  99: Core, the public POA Network main network
  7762959: Musicoin, the music blockchain
  
  
  </issue>
  <code>
  [start of web3/net.py]
  1 from web3.module import (
  2     Module,
  3 )
  4 
  5 
  6 class Net(Module):
  7     @property
  8     def listening(self):
  9         return self.web3.manager.request_blocking("net_listening", [])
  10 
  11     @property
  12     def peerCount(self):
  13         return self.web3.manager.request_blocking("net_peerCount", [])
  14 
  15     @property
  16     def version(self):
  17         return self.web3.manager.request_blocking("net_version", [])
  18
  [end of web3/net.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: diff --git a/web3/net.py b/web3/net.py
  --- a/web3/net.py
  +++ b/web3/net.py
  @@ -12,6 +12,10 @@
       def peerCount(self):
           return self.web3.manager.request_blocking("net_peerCount", [])
   
  +    @property
  +    def chainId(self):
  +        return self.version
  +
       @property
       def version(self):
           return self.web3.manager.request_blocking("net_version", [])
  
verification_info: {"golden_diff": "diff --git a/web3/net.py b/web3/net.py\n--- a/web3/net.py\n+++ b/web3/net.py\n@@ -12,6 +12,10 @@\n     def peerCount(self):\n         return self.web3.manager.request_blocking(\"net_peerCount\", [])\n \n+    @property\n+    def chainId(self):\n+        return self.version\n+\n     @property\n     def version(self):\n         return self.web3.manager.request_blocking(\"net_version\", [])\n", "issue": "Consider adding Chain Id to library\n* Version: 4.0.0-b\r\n* Python: 3.6.3\r\n* OS: linux\r\n\r\n### What was wrong?\r\n\r\nNo clear way to access known chain ids.\r\n\r\n### How can it be fixed?\r\n\r\nProposed syntax\r\n\r\n```\r\n>>> from web3 import Chains\r\n>>> Chains.Ropsten.id\r\n3\r\n```\r\n\r\nI ran into issues here: https://web3py.readthedocs.io/en/latest/web3.eth.account.html#sign-a-contract-transaction as `buildTransaction()` requires a `chainId`.  I didn't even know the chains had ids.\r\n\r\n```\r\n>>> unicorn_txn = unicorns.functions.transfer(\r\n...     '0xfB6916095ca1df60bB79Ce92cE3Ea74c37c5d359',\r\n...     1,\r\n... ).buildTransaction({\r\n...     'chainId': 1,\r\n...     'gas': 70000,\r\n...     'gasPrice': w3.toWei('1', 'gwei'),\r\n...     'nonce': nonce,\r\n... })\r\n```\r\n\r\n### Maybe this will help others\r\n\r\nAccording to this answer https://ethereum.stackexchange.com/a/17101/7187 the chain ids are as follows:\r\n\r\n0: Olympic, Ethereum public pre-release testnet\r\n1: Frontier, Homestead, Metropolis, the Ethereum public main network\r\n1: Classic, the (un)forked public Ethereum Classic main network, chain ID 61\r\n1: Expanse, an alternative Ethereum implementation, chain ID 2\r\n2: Morden, the public Ethereum testnet, now Ethereum Classic testnet\r\n3: Ropsten, the public cross-client Ethereum testnet\r\n4: Rinkeby, the public Geth PoA testnet\r\n42: Kovan, the public Parity PoA testnet\r\n77: Sokol, the public POA Network testnet\r\n99: Core, the public POA Network main network\r\n7762959: Musicoin, the music blockchain\r\n\nConsider adding Chain Id to library\n* Version: 4.0.0-b\r\n* Python: 3.6.3\r\n* OS: linux\r\n\r\n### What was wrong?\r\n\r\nNo clear way to access known chain ids.\r\n\r\n### How can it be fixed?\r\n\r\nProposed syntax\r\n\r\n```\r\n>>> from web3 import Chains\r\n>>> Chains.Ropsten.id\r\n3\r\n```\r\n\r\nI ran into issues here: https://web3py.readthedocs.io/en/latest/web3.eth.account.html#sign-a-contract-transaction as `buildTransaction()` requires a `chainId`.  I didn't even know the chains had ids.\r\n\r\n```\r\n>>> unicorn_txn = unicorns.functions.transfer(\r\n...     '0xfB6916095ca1df60bB79Ce92cE3Ea74c37c5d359',\r\n...     1,\r\n... ).buildTransaction({\r\n...     'chainId': 1,\r\n...     'gas': 70000,\r\n...     'gasPrice': w3.toWei('1', 'gwei'),\r\n...     'nonce': nonce,\r\n... })\r\n```\r\n\r\n### Maybe this will help others\r\n\r\nAccording to this answer https://ethereum.stackexchange.com/a/17101/7187 the chain ids are as follows:\r\n\r\n0: Olympic, Ethereum public pre-release testnet\r\n1: Frontier, Homestead, Metropolis, the Ethereum public main network\r\n1: Classic, the (un)forked public Ethereum Classic main network, chain ID 61\r\n1: Expanse, an alternative Ethereum implementation, chain ID 2\r\n2: Morden, the public Ethereum testnet, now Ethereum Classic testnet\r\n3: Ropsten, the public cross-client Ethereum testnet\r\n4: Rinkeby, the public Geth PoA testnet\r\n42: Kovan, the public Parity PoA testnet\r\n77: Sokol, the public POA Network testnet\r\n99: Core, the public POA Network main network\r\n7762959: Musicoin, the music blockchain\r\n\n", "before_files": [{"content": "from web3.module import (\n    Module,\n)\n\n\nclass Net(Module):\n    @property\n    def listening(self):\n        return self.web3.manager.request_blocking(\"net_listening\", [])\n\n    @property\n    def peerCount(self):\n        return self.web3.manager.request_blocking(\"net_peerCount\", [])\n\n    @property\n    def version(self):\n        return self.web3.manager.request_blocking(\"net_version\", [])\n", "path": "web3/net.py"}]}