From 831c2fc8a6e6aa713f2befc4f2029ca64b9e1e68 Mon Sep 17 00:00:00 2001 From: BobTheBuidler <70677534+BobTheBuidler@users.noreply.github.com> Date: Thu, 11 Jul 2024 14:18:05 -0400 Subject: [PATCH 01/35] chore: bump vyper --- requirements.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.in b/requirements.in index 56d07b964..315a5dd7e 100644 --- a/requirements.in +++ b/requirements.in @@ -24,6 +24,6 @@ rlp semantic-version<3 tqdm<5 vvm==0.1.0 # 0.2.0 switches from semantic-version to packaging.version and things break -vyper>=0.3.8,<0.4 +vyper>=0.4.0,<0.5 web3>=6,<7 wrapt>=1.12.1,<2 From ae227091d6f69cf70e7757b515f4a66591807603 Mon Sep 17 00:00:00 2001 From: BobTheBuidler <70677534+BobTheBuidler@users.noreply.github.com> Date: Thu, 11 Jul 2024 14:20:33 -0400 Subject: [PATCH 02/35] chore: update requirements.txt --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 9758d4e63..5987e97a7 100644 --- a/requirements.txt +++ b/requirements.txt @@ -222,7 +222,7 @@ urllib3==2.2.1 # via requests vvm==0.1.0 # via -r requirements.in -vyper==0.3.10 +vyper==0.4.0 # via -r requirements.in wcwidth==0.2.13 # via prompt-toolkit From 5edb051a4c0cab69a8d3ee082425cbd5aa5a9b0c Mon Sep 17 00:00:00 2001 From: BobTheBuidler <70677534+BobTheBuidler@users.noreply.github.com> Date: Thu, 11 Jul 2024 14:31:41 -0400 Subject: [PATCH 03/35] fix: remove root_path kwarg --- brownie/project/compiler/vyper.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/brownie/project/compiler/vyper.py b/brownie/project/compiler/vyper.py index 1dafedfe2..c890b38e6 100644 --- a/brownie/project/compiler/vyper.py +++ b/brownie/project/compiler/vyper.py @@ -236,8 +236,10 @@ def compile_from_input_json( outputs.remove("userdoc") outputs.remove("devdoc") if version == Version(vyper.__version__): + if allow_paths is not None: + raise NotImplementedError(allow_paths) try: - return vyper_json.compile_json(input_json, root_path=allow_paths) + return vyper_json.compile_json(input_json) except VyperException as exc: raise exc.with_traceback(None) else: From de3309b2c6ec22fb4df30c83688b8593b5157fcc Mon Sep 17 00:00:00 2001 From: BobTheBuidler <70677534+BobTheBuidler@users.noreply.github.com> Date: Thu, 11 Jul 2024 14:33:35 -0400 Subject: [PATCH 04/35] chore: force long method --- brownie/project/compiler/vyper.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/brownie/project/compiler/vyper.py b/brownie/project/compiler/vyper.py index c890b38e6..be7d84254 100644 --- a/brownie/project/compiler/vyper.py +++ b/brownie/project/compiler/vyper.py @@ -66,7 +66,8 @@ def get_abi(contract_source: str, name: str) -> Dict: "sources": {name: {"content": contract_source}}, "settings": {"outputSelection": {"*": {"*": ["abi"]}}}, } - if _active_version == Version(vyper.__version__): + if False: + #if _active_version == Version(vyper.__version__): try: compiled = vyper_json.compile_json(input_json) except VyperException as exc: From 1a553955da4d24e0eb85832b36b17f4a83bff4f6 Mon Sep 17 00:00:00 2001 From: BobTheBuidler <70677534+BobTheBuidler@users.noreply.github.com> Date: Thu, 11 Jul 2024 14:35:18 -0400 Subject: [PATCH 05/35] chore: disable if branch --- brownie/project/compiler/vyper.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/brownie/project/compiler/vyper.py b/brownie/project/compiler/vyper.py index be7d84254..6b31a3344 100644 --- a/brownie/project/compiler/vyper.py +++ b/brownie/project/compiler/vyper.py @@ -66,8 +66,7 @@ def get_abi(contract_source: str, name: str) -> Dict: "sources": {name: {"content": contract_source}}, "settings": {"outputSelection": {"*": {"*": ["abi"]}}}, } - if False: - #if _active_version == Version(vyper.__version__): + if _active_version == Version(vyper.__version__): try: compiled = vyper_json.compile_json(input_json) except VyperException as exc: @@ -236,7 +235,8 @@ def compile_from_input_json( outputs = input_json["settings"]["outputSelection"]["*"]["*"] outputs.remove("userdoc") outputs.remove("devdoc") - if version == Version(vyper.__version__): + #if version == Version(vyper.__version__): + if False: if allow_paths is not None: raise NotImplementedError(allow_paths) try: From 7ac6ab5c3fc26fbc14c91095f1937c3f2278bd3a Mon Sep 17 00:00:00 2001 From: BobTheBuidler <70677534+BobTheBuidler@users.noreply.github.com> Date: Thu, 11 Jul 2024 14:36:37 -0400 Subject: [PATCH 06/35] fix: raise naked exc --- brownie/project/compiler/vyper.py | 1 + 1 file changed, 1 insertion(+) diff --git a/brownie/project/compiler/vyper.py b/brownie/project/compiler/vyper.py index 6b31a3344..36f0119df 100644 --- a/brownie/project/compiler/vyper.py +++ b/brownie/project/compiler/vyper.py @@ -247,6 +247,7 @@ def compile_from_input_json( try: return vvm.compile_standard(input_json, base_path=allow_paths, vyper_version=version) except vvm.exceptions.VyperError as exc: + raise raise CompilerError(exc, "vyper") From b73b7ebf14a9ca43563c7c27777eb9035f62f1d5 Mon Sep 17 00:00:00 2001 From: BobTheBuidler <70677534+BobTheBuidler@users.noreply.github.com> Date: Thu, 11 Jul 2024 14:49:56 -0400 Subject: [PATCH 07/35] chore: use custom vvm --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 5987e97a7..fd6ed675f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -220,7 +220,7 @@ typing-extensions==4.9.0 # web3 urllib3==2.2.1 # via requests -vvm==0.1.0 +vvm==0.2.1 # via -r requirements.in vyper==0.4.0 # via -r requirements.in From 91b7bf695e6565b734657c017e5279d4a6150364 Mon Sep 17 00:00:00 2001 From: BobTheBuidler <70677534+BobTheBuidler@users.noreply.github.com> Date: Thu, 11 Jul 2024 15:18:09 -0400 Subject: [PATCH 08/35] fix: stringify versions --- brownie/project/compiler/vyper.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/brownie/project/compiler/vyper.py b/brownie/project/compiler/vyper.py index 36f0119df..d83667457 100644 --- a/brownie/project/compiler/vyper.py +++ b/brownie/project/compiler/vyper.py @@ -93,7 +93,7 @@ def _get_vyper_version_list() -> Tuple[List, List]: if not installed_versions: raise ConnectionError("Vyper not installed and cannot connect to GitHub") AVAILABLE_VYPER_VERSIONS = installed_versions - return AVAILABLE_VYPER_VERSIONS, installed_versions + return AVAILABLE_VYPER_VERSIONS, [str(v) for v in installed_versions] def install_vyper(*versions: str) -> None: From 1d73e2043f05ceee6998cca6f3872a7dca4a1cae Mon Sep 17 00:00:00 2001 From: BobTheBuidler <70677534+BobTheBuidler@users.noreply.github.com> Date: Thu, 11 Jul 2024 15:26:55 -0400 Subject: [PATCH 09/35] chore: print stuff --- brownie/project/compiler/vyper.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/brownie/project/compiler/vyper.py b/brownie/project/compiler/vyper.py index d83667457..777a6c6e9 100644 --- a/brownie/project/compiler/vyper.py +++ b/brownie/project/compiler/vyper.py @@ -93,7 +93,10 @@ def _get_vyper_version_list() -> Tuple[List, List]: if not installed_versions: raise ConnectionError("Vyper not installed and cannot connect to GitHub") AVAILABLE_VYPER_VERSIONS = installed_versions - return AVAILABLE_VYPER_VERSIONS, [str(v) for v in installed_versions] + for v in installed_versions: + print(v) + print(type(v)) + return AVAILABLE_VYPER_VERSIONS, installed_versions def install_vyper(*versions: str) -> None: From faadb16c182fe5c502b7e6b2a45c192bca53adab Mon Sep 17 00:00:00 2001 From: BobTheBuidler <70677534+BobTheBuidler@users.noreply.github.com> Date: Thu, 11 Jul 2024 15:27:57 -0400 Subject: [PATCH 10/35] chore: print more --- brownie/project/compiler/vyper.py | 1 + 1 file changed, 1 insertion(+) diff --git a/brownie/project/compiler/vyper.py b/brownie/project/compiler/vyper.py index 777a6c6e9..673cb601c 100644 --- a/brownie/project/compiler/vyper.py +++ b/brownie/project/compiler/vyper.py @@ -96,6 +96,7 @@ def _get_vyper_version_list() -> Tuple[List, List]: for v in installed_versions: print(v) print(type(v)) + print(v.__dict__) return AVAILABLE_VYPER_VERSIONS, installed_versions From 565cd0751120629d162cb1f86e9e25c1fa1598d6 Mon Sep 17 00:00:00 2001 From: BobTheBuidler <70677534+BobTheBuidler@users.noreply.github.com> Date: Thu, 11 Jul 2024 15:28:57 -0400 Subject: [PATCH 11/35] Update vyper.py --- brownie/project/compiler/vyper.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/brownie/project/compiler/vyper.py b/brownie/project/compiler/vyper.py index 673cb601c..79f33070d 100644 --- a/brownie/project/compiler/vyper.py +++ b/brownie/project/compiler/vyper.py @@ -97,6 +97,8 @@ def _get_vyper_version_list() -> Tuple[List, List]: print(v) print(type(v)) print(v.__dict__) + print(v._version) + print(type(v._version)) return AVAILABLE_VYPER_VERSIONS, installed_versions From 9306b757427c6933813c102aae4b47141267c651 Mon Sep 17 00:00:00 2001 From: BobTheBuidler <70677534+BobTheBuidler@users.noreply.github.com> Date: Thu, 11 Jul 2024 15:29:36 -0400 Subject: [PATCH 12/35] Update vyper.py --- brownie/project/compiler/vyper.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/brownie/project/compiler/vyper.py b/brownie/project/compiler/vyper.py index 79f33070d..c4db2ebe2 100644 --- a/brownie/project/compiler/vyper.py +++ b/brownie/project/compiler/vyper.py @@ -99,7 +99,7 @@ def _get_vyper_version_list() -> Tuple[List, List]: print(v.__dict__) print(v._version) print(type(v._version)) - return AVAILABLE_VYPER_VERSIONS, installed_versions + return AVAILABLE_VYPER_VERSIONS, [v._version for v in installed_versions] def install_vyper(*versions: str) -> None: From 569a3628b50c5a0985b9c6900489153c8863ef15 Mon Sep 17 00:00:00 2001 From: BobTheBuidler <70677534+BobTheBuidler@users.noreply.github.com> Date: Thu, 11 Jul 2024 15:31:29 -0400 Subject: [PATCH 13/35] Update vyper.py --- brownie/project/compiler/vyper.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/brownie/project/compiler/vyper.py b/brownie/project/compiler/vyper.py index c4db2ebe2..0bc63316b 100644 --- a/brownie/project/compiler/vyper.py +++ b/brownie/project/compiler/vyper.py @@ -94,11 +94,10 @@ def _get_vyper_version_list() -> Tuple[List, List]: raise ConnectionError("Vyper not installed and cannot connect to GitHub") AVAILABLE_VYPER_VERSIONS = installed_versions for v in installed_versions: - print(v) - print(type(v)) - print(v.__dict__) - print(v._version) - print(type(v._version)) + if '_version' not in v.__dict__: + print(v) + print(type(v)) + print(v.__dict__) return AVAILABLE_VYPER_VERSIONS, [v._version for v in installed_versions] From ecbc162c2c4d15ffec4d7e90fe460d24a6b5935e Mon Sep 17 00:00:00 2001 From: BobTheBuidler <70677534+BobTheBuidler@users.noreply.github.com> Date: Thu, 11 Jul 2024 15:32:55 -0400 Subject: [PATCH 14/35] Update vyper.py --- brownie/project/compiler/vyper.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/brownie/project/compiler/vyper.py b/brownie/project/compiler/vyper.py index 0bc63316b..37020c94f 100644 --- a/brownie/project/compiler/vyper.py +++ b/brownie/project/compiler/vyper.py @@ -98,7 +98,7 @@ def _get_vyper_version_list() -> Tuple[List, List]: print(v) print(type(v)) print(v.__dict__) - return AVAILABLE_VYPER_VERSIONS, [v._version for v in installed_versions] + return AVAILABLE_VYPER_VERSIONS, [v if isinstance(v, Version) else v._version for v in installed_versions] def install_vyper(*versions: str) -> None: From c57ae769a9ffece7cb5be053d85f04cd2f2dcdff Mon Sep 17 00:00:00 2001 From: BobTheBuidler <70677534+BobTheBuidler@users.noreply.github.com> Date: Thu, 11 Jul 2024 15:34:04 -0400 Subject: [PATCH 15/35] Update vyper.py --- brownie/project/compiler/vyper.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/brownie/project/compiler/vyper.py b/brownie/project/compiler/vyper.py index 37020c94f..ddc34ffb9 100644 --- a/brownie/project/compiler/vyper.py +++ b/brownie/project/compiler/vyper.py @@ -98,7 +98,7 @@ def _get_vyper_version_list() -> Tuple[List, List]: print(v) print(type(v)) print(v.__dict__) - return AVAILABLE_VYPER_VERSIONS, [v if isinstance(v, Version) else v._version for v in installed_versions] + return AVAILABLE_VYPER_VERSIONS, [v if isinstance(v, Version) else Version(v) for v in installed_versions] def install_vyper(*versions: str) -> None: From 5c9a9f55d5b235a719c532b614d98d05d97dda03 Mon Sep 17 00:00:00 2001 From: BobTheBuidler <70677534+BobTheBuidler@users.noreply.github.com> Date: Thu, 11 Jul 2024 15:36:15 -0400 Subject: [PATCH 16/35] Update vyper.py --- brownie/project/compiler/vyper.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/brownie/project/compiler/vyper.py b/brownie/project/compiler/vyper.py index ddc34ffb9..346ad162a 100644 --- a/brownie/project/compiler/vyper.py +++ b/brownie/project/compiler/vyper.py @@ -98,7 +98,7 @@ def _get_vyper_version_list() -> Tuple[List, List]: print(v) print(type(v)) print(v.__dict__) - return AVAILABLE_VYPER_VERSIONS, [v if isinstance(v, Version) else Version(v) for v in installed_versions] + return AVAILABLE_VYPER_VERSIONS, [v if isinstance(v, Version) else Version(str(v)) for v in installed_versions] def install_vyper(*versions: str) -> None: From 97060d86fbdf42453dda99241252a1dfba456514 Mon Sep 17 00:00:00 2001 From: BobTheBuidler <70677534+BobTheBuidler@users.noreply.github.com> Date: Fri, 16 Aug 2024 12:41:02 -0400 Subject: [PATCH 17/35] Update vyper.py --- brownie/project/compiler/vyper.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/brownie/project/compiler/vyper.py b/brownie/project/compiler/vyper.py index 346ad162a..d1cc9c7ad 100644 --- a/brownie/project/compiler/vyper.py +++ b/brownie/project/compiler/vyper.py @@ -240,8 +240,8 @@ def compile_from_input_json( outputs = input_json["settings"]["outputSelection"]["*"]["*"] outputs.remove("userdoc") outputs.remove("devdoc") - #if version == Version(vyper.__version__): - if False: + if version == Version(vyper.__version__): + #if False: if allow_paths is not None: raise NotImplementedError(allow_paths) try: @@ -252,6 +252,7 @@ def compile_from_input_json( try: return vvm.compile_standard(input_json, base_path=allow_paths, vyper_version=version) except vvm.exceptions.VyperError as exc: + print(version) raise raise CompilerError(exc, "vyper") From 5142f4b851345ff98921390a7da1ea8fd0c5f675 Mon Sep 17 00:00:00 2001 From: BobTheBuidler <70677534+BobTheBuidler@users.noreply.github.com> Date: Fri, 16 Aug 2024 12:44:58 -0400 Subject: [PATCH 18/35] Update vyper.py --- brownie/project/compiler/vyper.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/brownie/project/compiler/vyper.py b/brownie/project/compiler/vyper.py index d1cc9c7ad..d9fc525f6 100644 --- a/brownie/project/compiler/vyper.py +++ b/brownie/project/compiler/vyper.py @@ -253,7 +253,7 @@ def compile_from_input_json( return vvm.compile_standard(input_json, base_path=allow_paths, vyper_version=version) except vvm.exceptions.VyperError as exc: print(version) - raise + raise Exception(version, type(version), exc) raise CompilerError(exc, "vyper") From 93c161ae68b6fe5f0e2a6061fdee47ba3564374f Mon Sep 17 00:00:00 2001 From: BobTheBuidler <70677534+BobTheBuidler@users.noreply.github.com> Date: Fri, 16 Aug 2024 14:26:08 -0400 Subject: [PATCH 19/35] Update vyper.py --- brownie/project/compiler/vyper.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/brownie/project/compiler/vyper.py b/brownie/project/compiler/vyper.py index d9fc525f6..e6e413819 100644 --- a/brownie/project/compiler/vyper.py +++ b/brownie/project/compiler/vyper.py @@ -82,13 +82,13 @@ def get_abi(contract_source: str, name: str) -> Dict: def _get_vyper_version_list() -> Tuple[List, List]: global AVAILABLE_VYPER_VERSIONS - installed_versions = vvm.get_installed_vyper_versions() + installed_versions = [Version(str(v)) for v in vvm.get_installed_vyper_versions()] lib_version = Version(vyper.__version__) if lib_version not in installed_versions: installed_versions.append(lib_version) if AVAILABLE_VYPER_VERSIONS is None: try: - AVAILABLE_VYPER_VERSIONS = vvm.get_installable_vyper_versions() + AVAILABLE_VYPER_VERSIONS = [Version(str(v)) for v in vvm.get_installable_vyper_versions()] except ConnectionError: if not installed_versions: raise ConnectionError("Vyper not installed and cannot connect to GitHub") From 88227c369ad26a9a0ec4f38ac4e4a0886ac8a988 Mon Sep 17 00:00:00 2001 From: BobTheBuidler <70677534+BobTheBuidler@users.noreply.github.com> Date: Fri, 16 Aug 2024 14:42:53 -0400 Subject: [PATCH 20/35] Update vyper.py --- brownie/project/compiler/vyper.py | 1 + 1 file changed, 1 insertion(+) diff --git a/brownie/project/compiler/vyper.py b/brownie/project/compiler/vyper.py index e6e413819..58ae1b201 100644 --- a/brownie/project/compiler/vyper.py +++ b/brownie/project/compiler/vyper.py @@ -46,6 +46,7 @@ def set_vyper_version(version: Union[str, Version]) -> str: if isinstance(version, str): version = Version(version) if version != Version(vyper.__version__): + raise Exception(version) try: vvm.set_vyper_version(version, silent=True) except vvm.exceptions.VyperNotInstalled: From 84837ac49034524b0cc4e0c993e5e2af50ee64fb Mon Sep 17 00:00:00 2001 From: BobTheBuidler <70677534+BobTheBuidler@users.noreply.github.com> Date: Fri, 16 Aug 2024 14:44:26 -0400 Subject: [PATCH 21/35] Update vyper.py --- brownie/project/compiler/vyper.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/brownie/project/compiler/vyper.py b/brownie/project/compiler/vyper.py index 58ae1b201..b235f5cf3 100644 --- a/brownie/project/compiler/vyper.py +++ b/brownie/project/compiler/vyper.py @@ -46,7 +46,7 @@ def set_vyper_version(version: Union[str, Version]) -> str: if isinstance(version, str): version = Version(version) if version != Version(vyper.__version__): - raise Exception(version) + raise Exception(version, type(version), vyper.__version__) try: vvm.set_vyper_version(version, silent=True) except vvm.exceptions.VyperNotInstalled: From ffa56261178847247efbb2128c6a66c74fb69270 Mon Sep 17 00:00:00 2001 From: BobTheBuidler <70677534+BobTheBuidler@users.noreply.github.com> Date: Fri, 16 Aug 2024 14:45:42 -0400 Subject: [PATCH 22/35] Update vyper.py --- brownie/project/compiler/vyper.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/brownie/project/compiler/vyper.py b/brownie/project/compiler/vyper.py index b235f5cf3..f2608c9c8 100644 --- a/brownie/project/compiler/vyper.py +++ b/brownie/project/compiler/vyper.py @@ -46,12 +46,11 @@ def set_vyper_version(version: Union[str, Version]) -> str: if isinstance(version, str): version = Version(version) if version != Version(vyper.__version__): - raise Exception(version, type(version), vyper.__version__) try: - vvm.set_vyper_version(version, silent=True) + vvm.set_vyper_version(str(version), silent=True) except vvm.exceptions.VyperNotInstalled: install_vyper(version) - vvm.set_vyper_version(version, silent=True) + vvm.set_vyper_version(str(version), silent=True) _active_version = version return str(_active_version) From cf7552356096cc4847fd1e09f60d7dbeeea8a114 Mon Sep 17 00:00:00 2001 From: BobTheBuidler <70677534+BobTheBuidler@users.noreply.github.com> Date: Fri, 16 Aug 2024 14:49:07 -0400 Subject: [PATCH 23/35] Update vyper.py --- brownie/project/compiler/vyper.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/brownie/project/compiler/vyper.py b/brownie/project/compiler/vyper.py index f2608c9c8..86d7a93db 100644 --- a/brownie/project/compiler/vyper.py +++ b/brownie/project/compiler/vyper.py @@ -250,7 +250,7 @@ def compile_from_input_json( raise exc.with_traceback(None) else: try: - return vvm.compile_standard(input_json, base_path=allow_paths, vyper_version=version) + return vvm.compile_standard(input_json, base_path=allow_paths, vyper_version=str(version)) except vvm.exceptions.VyperError as exc: print(version) raise Exception(version, type(version), exc) From df848963200f4c9e2c377c16c4123e3354c480e1 Mon Sep 17 00:00:00 2001 From: BobTheBuidler <70677534+BobTheBuidler@users.noreply.github.com> Date: Fri, 16 Aug 2024 14:50:05 -0400 Subject: [PATCH 24/35] Update vyper.py --- brownie/project/compiler/vyper.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/brownie/project/compiler/vyper.py b/brownie/project/compiler/vyper.py index 86d7a93db..10737db46 100644 --- a/brownie/project/compiler/vyper.py +++ b/brownie/project/compiler/vyper.py @@ -253,7 +253,7 @@ def compile_from_input_json( return vvm.compile_standard(input_json, base_path=allow_paths, vyper_version=str(version)) except vvm.exceptions.VyperError as exc: print(version) - raise Exception(version, type(version), exc) + #raise Exception(version, type(version), exc) raise CompilerError(exc, "vyper") From 1224906af840717f8a35e1c4a9adae0ce1948ff1 Mon Sep 17 00:00:00 2001 From: BobTheBuidler <70677534+BobTheBuidler@users.noreply.github.com> Date: Fri, 16 Aug 2024 14:51:37 -0400 Subject: [PATCH 25/35] Update vyper.py --- brownie/project/compiler/vyper.py | 1 + 1 file changed, 1 insertion(+) diff --git a/brownie/project/compiler/vyper.py b/brownie/project/compiler/vyper.py index 10737db46..2107ef3f9 100644 --- a/brownie/project/compiler/vyper.py +++ b/brownie/project/compiler/vyper.py @@ -253,6 +253,7 @@ def compile_from_input_json( return vvm.compile_standard(input_json, base_path=allow_paths, vyper_version=str(version)) except vvm.exceptions.VyperError as exc: print(version) + raise exc #raise Exception(version, type(version), exc) raise CompilerError(exc, "vyper") From dcdd39f1452196a26ff9a1e9eb5bf02e98a2af66 Mon Sep 17 00:00:00 2001 From: BobTheBuidler <70677534+BobTheBuidler@users.noreply.github.com> Date: Fri, 16 Aug 2024 14:52:50 -0400 Subject: [PATCH 26/35] Update vyper.py --- brownie/project/compiler/vyper.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/brownie/project/compiler/vyper.py b/brownie/project/compiler/vyper.py index 2107ef3f9..77b2e50d5 100644 --- a/brownie/project/compiler/vyper.py +++ b/brownie/project/compiler/vyper.py @@ -243,7 +243,8 @@ def compile_from_input_json( if version == Version(vyper.__version__): #if False: if allow_paths is not None: - raise NotImplementedError(allow_paths) + pass + #raise NotImplementedError(allow_paths) try: return vyper_json.compile_json(input_json) except VyperException as exc: From 4fa83d87a08aa5aea333d9dd0591bf021a6800ed Mon Sep 17 00:00:00 2001 From: BobTheBuidler <70677534+BobTheBuidler@users.noreply.github.com> Date: Fri, 16 Aug 2024 16:37:54 -0400 Subject: [PATCH 27/35] Update vyper.py --- brownie/project/compiler/vyper.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/brownie/project/compiler/vyper.py b/brownie/project/compiler/vyper.py index 77b2e50d5..3d4a77671 100644 --- a/brownie/project/compiler/vyper.py +++ b/brownie/project/compiler/vyper.py @@ -305,6 +305,9 @@ def _generate_coverage_data( if not opcodes_str: return {}, {}, {} + if not isinstance(source_map_str, str): + raise TypeError(source_map_str) from None + source_map = deque(expand_source_map(source_map_str)) opcodes = deque(opcodes_str.split(" ")) From ca4e3b101536dbe9044629adcf852d73c402b0dc Mon Sep 17 00:00:00 2001 From: BobTheBuidler <70677534+BobTheBuidler@users.noreply.github.com> Date: Fri, 16 Aug 2024 16:47:50 -0400 Subject: [PATCH 28/35] Update utils.py --- brownie/project/compiler/utils.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/brownie/project/compiler/utils.py b/brownie/project/compiler/utils.py index 7c0627094..c4e7be4e7 100644 --- a/brownie/project/compiler/utils.py +++ b/brownie/project/compiler/utils.py @@ -8,6 +8,12 @@ def expand_source_map(source_map_str: str) -> List: # Expands the compressed sourceMap supplied by solc into a list of lists + + if isinstance(source_map_str, dict): + source_map_str = str(source_map_str) + if not isinstance(source_map_str, str): + raise TypeError(source_map_str) from None + source_map: List = [_expand_row(i) if i else None for i in source_map_str.split(";")] for i, value in enumerate(source_map[1:], 1): if value is None: From 951caa054e1f6387bbe4498ebad392dadaf8e24f Mon Sep 17 00:00:00 2001 From: BobTheBuidler <70677534+BobTheBuidler@users.noreply.github.com> Date: Fri, 16 Aug 2024 16:48:07 -0400 Subject: [PATCH 29/35] Update vyper.py --- brownie/project/compiler/vyper.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/brownie/project/compiler/vyper.py b/brownie/project/compiler/vyper.py index 3d4a77671..c1d4c77fa 100644 --- a/brownie/project/compiler/vyper.py +++ b/brownie/project/compiler/vyper.py @@ -304,9 +304,6 @@ def _generate_coverage_data( ) -> Tuple: if not opcodes_str: return {}, {}, {} - - if not isinstance(source_map_str, str): - raise TypeError(source_map_str) from None source_map = deque(expand_source_map(source_map_str)) opcodes = deque(opcodes_str.split(" ")) From 68577b44fe34aaec73cfdb8ff2f91b772a5a4199 Mon Sep 17 00:00:00 2001 From: BobTheBuidler <70677534+BobTheBuidler@users.noreply.github.com> Date: Fri, 16 Aug 2024 16:51:29 -0400 Subject: [PATCH 30/35] Update utils.py --- brownie/project/compiler/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/brownie/project/compiler/utils.py b/brownie/project/compiler/utils.py index c4e7be4e7..189d43569 100644 --- a/brownie/project/compiler/utils.py +++ b/brownie/project/compiler/utils.py @@ -10,7 +10,7 @@ def expand_source_map(source_map_str: str) -> List: # Expands the compressed sourceMap supplied by solc into a list of lists if isinstance(source_map_str, dict): - source_map_str = str(source_map_str) + source_map_str = source_map_str["pc_pos_map_compressed"] if not isinstance(source_map_str, str): raise TypeError(source_map_str) from None From 425fb4045b22cccf56491e92c55953be4ac85b39 Mon Sep 17 00:00:00 2001 From: BobTheBuidler <70677534+BobTheBuidler@users.noreply.github.com> Date: Fri, 16 Aug 2024 17:06:43 -0400 Subject: [PATCH 31/35] chore: cleanup --- brownie/project/compiler/vyper.py | 7 ------- 1 file changed, 7 deletions(-) diff --git a/brownie/project/compiler/vyper.py b/brownie/project/compiler/vyper.py index c1d4c77fa..f75989d99 100644 --- a/brownie/project/compiler/vyper.py +++ b/brownie/project/compiler/vyper.py @@ -241,10 +241,6 @@ def compile_from_input_json( outputs.remove("userdoc") outputs.remove("devdoc") if version == Version(vyper.__version__): - #if False: - if allow_paths is not None: - pass - #raise NotImplementedError(allow_paths) try: return vyper_json.compile_json(input_json) except VyperException as exc: @@ -253,9 +249,6 @@ def compile_from_input_json( try: return vvm.compile_standard(input_json, base_path=allow_paths, vyper_version=str(version)) except vvm.exceptions.VyperError as exc: - print(version) - raise exc - #raise Exception(version, type(version), exc) raise CompilerError(exc, "vyper") From 8fce5fa25362ef4e3a095d9ee339ff6cd92acf09 Mon Sep 17 00:00:00 2001 From: BobTheBuidler <70677534+BobTheBuidler@users.noreply.github.com> Date: Fri, 16 Aug 2024 17:11:34 -0400 Subject: [PATCH 32/35] revert kwarg removal --- brownie/project/compiler/vyper.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/brownie/project/compiler/vyper.py b/brownie/project/compiler/vyper.py index f75989d99..c774e5c17 100644 --- a/brownie/project/compiler/vyper.py +++ b/brownie/project/compiler/vyper.py @@ -242,7 +242,7 @@ def compile_from_input_json( outputs.remove("devdoc") if version == Version(vyper.__version__): try: - return vyper_json.compile_json(input_json) + return vyper_json.compile_json(input_json, root_path=allow_paths) except VyperException as exc: raise exc.with_traceback(None) else: From 1e005d65e56415ca8d6b4b85fe8dd98cdddc5897 Mon Sep 17 00:00:00 2001 From: BobTheBuidler <70677534+BobTheBuidler@users.noreply.github.com> Date: Fri, 16 Aug 2024 17:20:18 -0400 Subject: [PATCH 33/35] Update vyper.py --- brownie/project/compiler/vyper.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/brownie/project/compiler/vyper.py b/brownie/project/compiler/vyper.py index c774e5c17..4450d9c0f 100644 --- a/brownie/project/compiler/vyper.py +++ b/brownie/project/compiler/vyper.py @@ -242,7 +242,7 @@ def compile_from_input_json( outputs.remove("devdoc") if version == Version(vyper.__version__): try: - return vyper_json.compile_json(input_json, root_path=allow_paths) + return vyper_json.compile_json(input_json, json_path=allow_paths) except VyperException as exc: raise exc.with_traceback(None) else: From f2a339fbc6dc6444c87ac66d4110f4e6e41d4473 Mon Sep 17 00:00:00 2001 From: BobTheBuidler <70677534+BobTheBuidler@users.noreply.github.com> Date: Fri, 16 Aug 2024 17:22:46 -0400 Subject: [PATCH 34/35] Update vyper.py --- brownie/project/compiler/vyper.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/brownie/project/compiler/vyper.py b/brownie/project/compiler/vyper.py index 4450d9c0f..f75989d99 100644 --- a/brownie/project/compiler/vyper.py +++ b/brownie/project/compiler/vyper.py @@ -242,7 +242,7 @@ def compile_from_input_json( outputs.remove("devdoc") if version == Version(vyper.__version__): try: - return vyper_json.compile_json(input_json, json_path=allow_paths) + return vyper_json.compile_json(input_json) except VyperException as exc: raise exc.with_traceback(None) else: From 846d95212c4a72d304b3ff0b49f2596bcab1aab7 Mon Sep 17 00:00:00 2001 From: BobTheBuidler <70677534+BobTheBuidler@users.noreply.github.com> Date: Fri, 16 Aug 2024 17:24:28 -0400 Subject: [PATCH 35/35] chore: cleanup --- brownie/project/compiler/vyper.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/brownie/project/compiler/vyper.py b/brownie/project/compiler/vyper.py index f75989d99..477cc9901 100644 --- a/brownie/project/compiler/vyper.py +++ b/brownie/project/compiler/vyper.py @@ -93,12 +93,7 @@ def _get_vyper_version_list() -> Tuple[List, List]: if not installed_versions: raise ConnectionError("Vyper not installed and cannot connect to GitHub") AVAILABLE_VYPER_VERSIONS = installed_versions - for v in installed_versions: - if '_version' not in v.__dict__: - print(v) - print(type(v)) - print(v.__dict__) - return AVAILABLE_VYPER_VERSIONS, [v if isinstance(v, Version) else Version(str(v)) for v in installed_versions] + return AVAILABLE_VYPER_VERSIONS, installed_versions def install_vyper(*versions: str) -> None: