onflow / onflow/flowkit

[BUG] Construct Cadence objects from Cadence JSON

Open
#52 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Go
Stars
8
Forks
11
Avg merge
5d 59m
Merged PRs (30d)
1

Description

Current Behavior

Recently when trying to use ParseJSON with Overflow on a Cadence 1.0 project, I ran into what appeared to be a dependency issue. After adding the latest pre-release to my project, I got the following error

# github.com/onflow/flow-go/fvm/systemcontracts
/Users/gsanchez/go/pkg/mod/github.com/onflow/flow-go@v0.34.0-crescendo-preview.18/fvm/systemcontracts/system_contracts.go:176:3: unknown field FungibleTokenMetadataViewsAddress in struct literal of type templates.Environment
/Users/gsanchez/go/pkg/mod/github.com/onflow/flow-go@v0.34.0-crescendo-preview.18/fvm/systemcontracts/system_contracts.go:178:3: unknown field NonFungibleTokenAddress in struct literal of type templates.Environment
/Users/gsanchez/go/pkg/mod/github.com/onflow/flow-go@v0.34.0-crescendo-preview.18/fvm/systemcontracts/system_contracts.go:179:3: unknown field MetadataViewsAddress in struct literal of type templates.Environment
/Users/gsanchez/go/pkg/mod/github.com/onflow/flow-go@v0.34.0-crescendo-preview.18/fvm/systemcontracts/system_contracts.go:180:3: unknown field ViewResolverAddress in struct literal of type templates.Environment
/Users/gsanchez/go/pkg/mod/github.com/onflow/flow-go@v0.34.0-crescendo-preview.18/fvm/systemcontracts/system_contracts.go:181:3: unknown field FungibleTokenSwitchboardAddress in struct literal of type templates.Environment
# github.com/onflow/flow-core-contracts/lib/go/contracts
/Users/gsanchez/go/pkg/mod/github.com/onflow/flow-core-contracts/lib/go/contracts@v1.2.4-0.20231016154253-a00dbf7c061f/contracts.go:82:9: not enough arguments in call to ftcontracts.FungibleToken
	have ()
	want (string, string)
/Users/gsanchez/go/pkg/mod/github.com/onflow/flow-core-contracts/lib/go/contracts@v1.2.4-0.20231016154253-a00dbf7c061f/contracts.go:87:67: not enough arguments in call to ftcontracts.FungibleTokenMetadataViews
	have (string, string)
	want (string, string, string)
/Users/gsanchez/go/pkg/mod/github.com/onflow/flow-core-contracts/lib/go/contracts@v1.2.4-0.20231016154253-a00dbf7c061f/contracts.go:91:9: not enough arguments in call to nftcontracts.NonFungibleToken
	have ()
	want (string)
/Users/gsanchez/go/pkg/mod/github.com/onflow/flow-core-contracts/lib/go/contracts@v1.2.4-0.20231016154253-a00dbf7c061f/contracts.go:95:22: undefined: nftcontracts.Resolver
/Users/gsanchez/go/pkg/mod/github.com/onflow/flow-core-contracts/lib/go/contracts@v1.2.4-0.20231016154253-a00dbf7c061f/contracts.go:100:74: not enough arguments in call to nftcontracts.MetadataViews
	have (flow.Address, flow.Address)
	want (string, string, string)
Expected Behavior

I would expect flowkit & overflow to work well together.

Steps To Reproduce

Attempt to use flowkit v2.0.0-stable-cadence-alpha.19 with overflow v2.0.0-stable-cadence-beta.13and cadence v1.0.0-preview.25.

Environment
- OS: macOS 14.4 (23E214)
- go: go1.21.5 darwin/arm64
What are you currently working on that this is blocking?

No response

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the reported build with flowkit v2.0.0-stable-cadence-alpha.19, overflow v2.0.0-stable-cadence-beta.13, and cadence v1.0.0-preview.25, focusing on ParseJSON and the listed dependency errors. Check whether the version combination can construct Cadence objects from Cadence JSON; done means the dependencies build and the reported use case works together.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.