-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CU-86dt9vq5z - Implement a new import structure #1251
Conversation
Task linked: CU-86dt9vq5z Implement a new import structure |
@@ -50,7 +48,7 @@ def get_value(self, symbol_id) -> Any: | |||
|
|||
:return: the value if this type has this symbol. None otherwise. | |||
""" | |||
from boa3.builtin.interop.contract import CallFlags | |||
from boa3.sc.types import CallFlags |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this import necessary? there is a CallFlags import outside the class
# Deprecated Native Contract Names | ||
gas_name = 'GAS' | ||
ledger_name = 'Ledger' | ||
neo_name = 'NEO' | ||
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 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for the classes that were renamed you can set the id on the package definition instead of here (see next comments)
GasModule = Package(deprecated=True, | ||
new_location='boa3.sc.contracts', | ||
identifier=gas_name.lower(), | ||
types=[GAS_] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GasModule = Package(deprecated=True, | |
new_location='boa3.sc.contracts', | |
identifier=gas_name.lower(), | |
types=[GAS_] | |
GasModule = Package(deprecated=True, | |
new_location='boa3.sc.contracts', | |
identifier=gas_name.lower(), | |
other_symbols={ | |
gas_name: GAS | |
} |
LedgerModule = Package(deprecated=True, | ||
new_location='boa3.sc.contracts', | ||
identifier=ledger_name.lower(), | ||
types=[Ledger_] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LedgerModule = Package(deprecated=True, | |
new_location='boa3.sc.contracts', | |
identifier=ledger_name.lower(), | |
types=[Ledger_] | |
LedgerModule = Package(deprecated=True, | |
new_location='boa3.sc.contracts', | |
identifier=ledger_name.lower(), | |
other_symbols={ | |
ledger_name: Ledger | |
} |
NeoModule = Package(deprecated=True, | ||
new_location='boa3.sc.contracts', | ||
identifier=neo_name.lower(), | ||
types=[NEO_] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NeoModule = Package(deprecated=True, | |
new_location='boa3.sc.contracts', | |
identifier=neo_name.lower(), | |
types=[NEO_] | |
NeoModule = Package(deprecated=True, | |
new_location='boa3.sc.contracts', | |
identifier=neo_name.lower(), | |
other_symbols={ | |
neo_name: NEO | |
} |
OracleModule = Package(deprecated=True, | ||
new_location='boa3.sc.contracts', | ||
identifier=oracle_name.lower(), | ||
types=[Oracle_] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OracleModule = Package(deprecated=True, | |
new_location='boa3.sc.contracts', | |
identifier=oracle_name.lower(), | |
types=[Oracle_] | |
OracleModule = Package(deprecated=True, | |
new_location='boa3.sc.contracts', | |
identifier=oracle_name.lower(), | |
other_symbols={ | |
oracle_name: Oracle | |
} |
PolicyModule = Package(deprecated=True, | ||
new_location='boa3.sc.contracts', | ||
identifier=policy_name.lower(), | ||
types=[Policy_] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PolicyModule = Package(deprecated=True, | |
new_location='boa3.sc.contracts', | |
identifier=policy_name.lower(), | |
types=[Policy_] | |
PolicyModule = Package(deprecated=True, | |
new_location='boa3.sc.contracts', | |
identifier=policy_name.lower(), | |
other_symbols={ | |
policy_name: Policy | |
} |
Summary or solution description
Added a new folder
boa3.sc
and deprecated the oldboa3.builtin
Platform: