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

Adjust contract config structure to specify source files for aliases #63

Closed
psiemens opened this issue Feb 17, 2021 · 0 comments · Fixed by #64
Closed

Adjust contract config structure to specify source files for aliases #63

psiemens opened this issue Feb 17, 2021 · 0 comments · Fixed by #64
Assignees
Labels
Feature A new user feature or a new package API Feedback

Comments

@psiemens
Copy link
Contributor

Issue To Be Solved

The current alias structure works for resolving contract aliases during deployment, but it does not provide a way for code editors (e.g. VS Code) to resolve imports locally and perform semantic checking without reading from the chain.

Suggest A Solution

We can update the flow.json config structure to specify a source file for all contracts. This source file is resolved when developing locally, but is then replaced with the appropriate alias during deployment.

  "contracts": {
    "NonFungibleToken": {
      "source": "./cadence/kittyItems/contracts/NonFungibleToken.cdc",
      "aliases": {
        "testnet": "0xABC"
      }
    },
    "FungibleToken": {
      "source": "./cadence/kittyItems/contracts/FungibleToken.cdc",
      "aliases": {
        "emulator": "0xABC",
        "testnet": "0xABC"
      }
    }
  }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature A new user feature or a new package API Feedback
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants