From 3e4dc51aefe70dfa63939c3403f11ff797f961e5 Mon Sep 17 00:00:00 2001 From: while0x1 <94356664+while0x1@users.noreply.github.com> Date: Sat, 1 Mar 2025 09:00:05 +0800 Subject: [PATCH 1/3] Update blockfrost.py cast script_type to int for the method PlutusScript.from_version --- pycardano/backend/blockfrost.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pycardano/backend/blockfrost.py b/pycardano/backend/blockfrost.py index cbd81285..b04c94ce 100644 --- a/pycardano/backend/blockfrost.py +++ b/pycardano/backend/blockfrost.py @@ -176,7 +176,7 @@ def _get_script(self, script_hash: str) -> ScriptType: script_type = self.api.script(script_hash).type if script_type.startsWith("plutusV"): ps = PlutusScript.from_version( - script_type[-1], bytes.fromhex(self.api.script_cbor(script_hash).cbor) + int(script_type[-1]), bytes.fromhex(self.api.script_cbor(script_hash).cbor) ) return _try_fix_script(script_hash, ps) else: From 4c61889c5d0007972972ca8203519bbaf8c18e46 Mon Sep 17 00:00:00 2001 From: while0x1 <94356664+while0x1@users.noreply.github.com> Date: Sat, 1 Mar 2025 09:07:09 +0800 Subject: [PATCH 2/3] Update blockfrost.py capitalisation mistake startswith in _gets_script --- pycardano/backend/blockfrost.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pycardano/backend/blockfrost.py b/pycardano/backend/blockfrost.py index b04c94ce..c662fc32 100644 --- a/pycardano/backend/blockfrost.py +++ b/pycardano/backend/blockfrost.py @@ -174,7 +174,7 @@ def protocol_param(self) -> ProtocolParameters: def _get_script(self, script_hash: str) -> ScriptType: script_type = self.api.script(script_hash).type - if script_type.startsWith("plutusV"): + if script_type.startswith("plutusV"): ps = PlutusScript.from_version( int(script_type[-1]), bytes.fromhex(self.api.script_cbor(script_hash).cbor) ) From 7bc531eccb93927c4c3197bb1fbee48e39dde761 Mon Sep 17 00:00:00 2001 From: Jerry Date: Fri, 28 Feb 2025 20:42:52 -0800 Subject: [PATCH 3/3] Fix format --- pycardano/backend/blockfrost.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pycardano/backend/blockfrost.py b/pycardano/backend/blockfrost.py index c662fc32..5008382b 100644 --- a/pycardano/backend/blockfrost.py +++ b/pycardano/backend/blockfrost.py @@ -176,7 +176,8 @@ def _get_script(self, script_hash: str) -> ScriptType: script_type = self.api.script(script_hash).type if script_type.startswith("plutusV"): ps = PlutusScript.from_version( - int(script_type[-1]), bytes.fromhex(self.api.script_cbor(script_hash).cbor) + int(script_type[-1]), + bytes.fromhex(self.api.script_cbor(script_hash).cbor), ) return _try_fix_script(script_hash, ps) else: