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

Update source compatibility suite for latest cadence v1.0.1 #3616

Merged
merged 8 commits into from
Oct 18, 2024

Conversation

RZhang05
Copy link
Contributor

Closes #3608

Description

  • Removes the parsing and typechecking functionality
  • Run go tests on flow-go v0.37.17, cadence v1.0.1 and pass

  • Targeted PR against master branch
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work
  • Code follows the standards mentioned here
  • Updated relevant documentation
  • Re-reviewed Files changed in the Github PR explorer
  • Added appropriate labels

Copy link
Member

@turbolent turbolent left a comment

Choose a reason for hiding this comment

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

Great work! I didn't realize we already had the go mod replace functionality

compat/main.py Outdated Show resolved Hide resolved
compat/main.py Outdated Show resolved Hide resolved
compat/main.py Show resolved Hide resolved
compat/main.py Outdated Show resolved Hide resolved
Copy link
Member

@turbolent turbolent left a comment

Choose a reason for hiding this comment

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

Now that the parsing and typechecking functionality has been removed, can you please remove the relevant parts from the configuration files, i.e. the files: property?

compat/main.py Outdated Show resolved Hide resolved
compat/main.py Outdated Show resolved Hide resolved
@turbolent turbolent self-assigned this Oct 17, 2024
Copy link
Member

@turbolent turbolent left a comment

Choose a reason for hiding this comment

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

Thank you for removing the unused code!

Could you please also remove the unused parts from the configuration files in https://github.com/onflow/cadence/blob/0bb1b6964b9ce61a29f0ce4359c169d724ee9813/compat/suite?

For example:

files:
- path: contracts/FlowToken.cdc
# language=Python prefix="replace: Callable[[str, str], None]\n"
prepare: |
from pathlib import Path
replace(
'import FungibleToken from 0xFUNGIBLETOKENADDRESS',
f'import FungibleToken from "{Path("../../flow-ft/contracts/FungibleToken.cdc").resolve()}"'
)
- path: contracts/FlowFees.cdc
# language=Python prefix="replace: Callable[[str, str], None]\n"
prepare: |
from pathlib import Path
replace(
'import FungibleToken from 0xFUNGIBLETOKENADDRESS',
f'import FungibleToken from "{Path("../../flow-ft/contracts/FungibleToken.cdc").resolve()}"'
)
replace(
'import FlowToken from 0xFLOWTOKENADDRESS',
f'import FlowToken from "{Path("FlowToken.cdc").resolve()}"'
)
- path: contracts/FlowIDTableStaking.cdc
# language=Python prefix="replace: Callable[[str, str], None]\n"
prepare: |
from pathlib import Path
replace(
'import FungibleToken from 0xFUNGIBLETOKENADDRESS',
f'import FungibleToken from "{Path("../../flow-ft/contracts/FungibleToken.cdc").resolve()}"'
)
replace(
'import FlowToken from 0xFLOWTOKENADDRESS',
f'import FlowToken from "{Path("FlowToken.cdc").resolve()}"'
)
- path: contracts/FlowStorageFees.cdc
# language=Python prefix="replace: Callable[[str, str], None]\n"
prepare: |
from pathlib import Path
replace(
'import FungibleToken from 0xFUNGIBLETOKENADDRESS',
f'import FungibleToken from "{Path("../../flow-ft/contracts/FungibleToken.cdc").resolve()}"'
)
replace(
'import FlowToken from 0xFLOWTOKENADDRESS',
f'import FlowToken from "{Path("FlowToken.cdc").resolve()}"'
)
- path: contracts/FlowServiceAccount.cdc
# language=Python prefix="replace: Callable[[str, str], None]\n"
prepare: |
from pathlib import Path
replace(
'import FungibleToken from 0xFUNGIBLETOKENADDRESS',
f'import FungibleToken from "{Path("../../flow-ft/contracts/FungibleToken.cdc").resolve()}"'
)
replace(
'import FlowToken from 0xFLOWTOKENADDRESS',
f'import FlowToken from "{Path("FlowToken.cdc").resolve()}"'
)
replace(
'import FlowFees from 0xFLOWFEESADDRESS',
f'import FlowFees from "{Path("FlowFees.cdc").resolve()}"'
)
replace(
'import FlowStorageFees from 0xFLOWSTORAGEFEESADDRESS',
f'import FlowStorageFees from "{Path("FlowStorageFees.cdc").resolve()}"'
)
- path: contracts/StakingProxy.cdc
- path: contracts/LockedTokens.cdc
# language=Python prefix="replace: Callable[[str, str], None]\n"
prepare: |
from pathlib import Path
replace(
'import FlowToken from 0xFLOWTOKENADDRESS',
f'import FlowToken from "{Path("FlowToken.cdc").resolve()}"'
)
replace(
'import FungibleToken from 0xFUNGIBLETOKENADDRESS',
f'import FungibleToken from "{Path("../../flow-ft/contracts/FungibleToken.cdc").resolve()}"'
)
replace(
'import FlowIDTableStaking from 0xFLOWIDTABLESTAKINGADDRESS',
f'import FlowIDTableStaking from "{Path("FlowIDTableStaking.cdc").resolve()}"'
)
replace(
'import FlowStorageFees from 0xFLOWSTORAGEFEESADDRESS',
f'import FlowStorageFees from "{Path("FlowStorageFees.cdc").resolve()}"'
)
replace(
'import StakingProxy from 0xSTAKINGPROXYADDRESS',
f'import StakingProxy from "{Path("StakingProxy.cdc").resolve()}"'
)
- path: contracts/FlowStakingCollection.cdc
member_account_access:
- 'LockedTokens.cdc'
# language=Python prefix="replace: Callable[[str, str], None]\n"
prepare: |
from pathlib import Path
replace(
'import FungibleToken from 0xFUNGIBLETOKENADDRESS',
f'import FungibleToken from "{Path("../../flow-ft/contracts/FungibleToken.cdc").resolve()}"'
)
replace(
'import FlowToken from 0xFLOWTOKENADDRESS',
f'import FlowToken from "{Path("FlowToken.cdc").resolve()}"'
)
replace(
'import FlowIDTableStaking from 0xFLOWIDTABLESTAKINGADDRESS',
f'import FlowIDTableStaking from "{Path("FlowIDTableStaking.cdc").resolve()}"'
)
replace(
'import LockedTokens from 0xLOCKEDTOKENSADDRESS',
f'import LockedTokens from "{Path("LockedTokens.cdc").resolve()}"'
)
replace(
'import FlowStorageFees from 0xFLOWSTORAGEFEESADDRESS',
f'import FlowStorageFees from "{Path("FlowStorageFees.cdc").resolve()}"'
)

@turbolent turbolent merged commit bdf0912 into onflow:master Oct 18, 2024
7 of 12 checks passed
@RZhang05 RZhang05 deleted the source-compatibility-update branch October 18, 2024 17:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Operationalize Source compatibility suite
2 participants