Skip to content
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

Merged
merged 2 commits into from
May 13, 2024
Merged

Conversation

luc10921
Copy link
Collaborator

Summary or solution description
Added a new folder boa3.sc and deprecated the old boa3.builtin

Platform:

  • OS: Windows 11 x64
  • Python version: Python 3.11

@luc10921 luc10921 requested a review from meevee98 May 13, 2024 12:50
@luc10921 luc10921 self-assigned this May 13, 2024
@melanke
Copy link
Collaborator

melanke commented May 13, 2024

@@ -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
Copy link
Collaborator

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

Comment on lines 20 to 37
# 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

Copy link
Collaborator

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)

Comment on lines 54 to 57
GasModule = Package(deprecated=True,
new_location='boa3.sc.contracts',
identifier=gas_name.lower(),
types=[GAS_]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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
}

Comment on lines 60 to 63
LedgerModule = Package(deprecated=True,
new_location='boa3.sc.contracts',
identifier=ledger_name.lower(),
types=[Ledger_]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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
}

Comment on lines 66 to 69
NeoModule = Package(deprecated=True,
new_location='boa3.sc.contracts',
identifier=neo_name.lower(),
types=[NEO_]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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
}

Comment on lines 72 to 75
OracleModule = Package(deprecated=True,
new_location='boa3.sc.contracts',
identifier=oracle_name.lower(),
types=[Oracle_]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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
}

Comment on lines 78 to 81
PolicyModule = Package(deprecated=True,
new_location='boa3.sc.contracts',
identifier=policy_name.lower(),
types=[Policy_]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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
}

@meevee98 meevee98 merged commit e5e5e83 into development May 13, 2024
3 checks passed
@meevee98 meevee98 deleted the CU-86dt9vq5z branch May 13, 2024 17:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants