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

Deploying contracts with Address init args breaks config #1427

Closed
sisyphusSmiling opened this issue Feb 22, 2024 · 1 comment
Closed

Deploying contracts with Address init args breaks config #1427

sisyphusSmiling opened this issue Feb 22, 2024 · 1 comment
Assignees
Labels
Bug The issue represents a bug, malfunction, regression Feedback

Comments

@sisyphusSmiling
Copy link
Contributor

Problem

When deploying a contract using flow accounts add-contract with an Address value in its initialization parameters, the contract deploys, but the value inserted into flow.json.deployments field breaks the config.

Steps to Reproduce

Running the emulator, try deploying the contract below with flow accounts add-contract ./contracts/C.cdc

access(all) contract C {
    access(all) let addressParam: Address
    init(addressParam: Address) {
        self.addressParam = addressParam
    }
}

Then try any other cli command and get the error

❯ flow accounts get 0xf8d6e0586b0a20c7
❌ Config Error: failed to decode JSON-Cadence value: invalid address prefix: (shown as hex) expected 3078, got 5b32

Check flow.json and see

"deployments": {
  "emulator": {
    "emulator-account": [
      {
        "name": "C",
	"args": [
	  {
	    "type": "Address",
            "value": "[248 214 224 88 107 10 32 199]"
          }
        ]
      }
    ]
}

Where value should be 0xf8d6e0586b0a20c7

Acceptance Criteria

Address values are inserted in current Cadence JSON format - see docs here

@sisyphusSmiling sisyphusSmiling added Bug The issue represents a bug, malfunction, regression Feedback labels Feb 22, 2024
@sisyphusSmiling
Copy link
Contributor Author

Following up on offline convos, this still seems to be an issue - using v1.15.0-cadence-v1.0.0-preview.12

@gregsantos gregsantos moved this to 🔖 Ready for Pickup in 🌊 Flow 4D Apr 25, 2024
@jribbink jribbink assigned jribbink and unassigned ianthpun May 3, 2024
@jribbink jribbink closed this as completed May 9, 2024
@github-project-automation github-project-automation bot moved this from 🔖 Ready for Pickup to ✅ Done in 🌊 Flow 4D May 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug The issue represents a bug, malfunction, regression Feedback
Projects
Archived in project
Development

No branches or pull requests

4 participants