From 341cf0c95edee33bcf6522564c8adcecffb56605 Mon Sep 17 00:00:00 2001 From: luc10921 Date: Mon, 13 May 2024 13:49:50 -0300 Subject: [PATCH] CU-86dt9vq5z - Implement a new import structure --- .../builtin/interop/contract/callflagstype.py | 2 -- .../model/builtin/native/nativecontract.py | 31 +++++++++---------- 2 files changed, 15 insertions(+), 18 deletions(-) diff --git a/boa3/internal/model/builtin/interop/contract/callflagstype.py b/boa3/internal/model/builtin/interop/contract/callflagstype.py index 878e36a9..eadb8963 100644 --- a/boa3/internal/model/builtin/interop/contract/callflagstype.py +++ b/boa3/internal/model/builtin/interop/contract/callflagstype.py @@ -48,8 +48,6 @@ def get_value(self, symbol_id) -> Any: :return: the value if this type has this symbol. None otherwise. """ - from boa3.sc.types import CallFlags - if symbol_id in self.symbols and symbol_id in CallFlags.__members__: return CallFlags.__members__[symbol_id] diff --git a/boa3/internal/model/builtin/native/nativecontract.py b/boa3/internal/model/builtin/native/nativecontract.py index cd3aa473..f6e6647f 100644 --- a/boa3/internal/model/builtin/native/nativecontract.py +++ b/boa3/internal/model/builtin/native/nativecontract.py @@ -24,17 +24,6 @@ class NativeContract: oracle_name = 'Oracle' policy_name = 'Policy' - GAS_ = GAS.clone() - GAS_._identifier = gas_name - Ledger_ = Ledger.clone() - Ledger_._identifier = ledger_name - NEO_ = NEO.clone() - NEO_._identifier = neo_name - Oracle_ = Oracle.clone() - Oracle_._identifier = oracle_name - Policy_ = Policy.clone() - Policy_._identifier = policy_name - # region Packages ContractManagementModule = Package(deprecated=True, @@ -54,31 +43,41 @@ class NativeContract: GasModule = Package(deprecated=True, new_location='boa3.sc.contracts', identifier=gas_name.lower(), - types=[GAS_] + other_symbols={ + gas_name: GAS + } ) LedgerModule = Package(deprecated=True, new_location='boa3.sc.contracts', identifier=ledger_name.lower(), - types=[Ledger_] + other_symbols={ + ledger_name: Ledger + } ) NeoModule = Package(deprecated=True, new_location='boa3.sc.contracts', identifier=neo_name.lower(), - types=[NEO_] + other_symbols={ + neo_name: NEO + } ) OracleModule = Package(deprecated=True, new_location='boa3.sc.contracts', identifier=oracle_name.lower(), - types=[Oracle_] + other_symbols={ + oracle_name: Oracle + } ) PolicyModule = Package(deprecated=True, new_location='boa3.sc.contracts', identifier=policy_name.lower(), - types=[Policy_] + other_symbols={ + policy_name: Policy + } ) RoleManagementModule = Package(deprecated=True,