Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

`flow test` should deploy smart contracts defined in flow.json

Đang mở
#1,377 2 bình luận 1 reaction 1 người được giao Xem trên GitHub

@jribbink đang làm issue này rồi.

Từ ngày 8/2/2024.

Đánh giá

Issue này chưa được đánh giá.

Mô tả

Feature Feedback

Instructions

Issue To Be Solved

Currently we need to explicitly deploy a smart contract in the cadence unit or integration tests, e.g.:

import "FLIXRegistry"
...
...
access(all)
fun setup() {
    let flixRegistryErr = Test.deployContract(
        name: "FLIXRegistry",
        path: "../contracts/flix_registry.cdc",
        arguments: []
    )
...

In the above example FLIXRegistry cannot be referenced in the code before it was deployed with Test.deployContract, even if it is imported on the the top, and defined in the flow.json as follows:

{
  "contracts": {
    "FLIXRegistry": {
      "source": "cadence/contracts/flix_registry.cdc",
      "aliases": {
        "emulator": "0xf8d6e0586b0a20c7",
        "testing": "0x0000000000000007"
      }
    },
...
(Optional): Suggest A Solution

It could increase developer experience if smart contracts defined in the flow.json are readily available in the unit tests, so the developers only have to import those as dependencies.
Also it could keep the unit tests code more concise and clean.

(Optional): Context
Ngôn ngữ chính
Go
Star
209
Fork
88
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của onflow/flow-cli

Tất cả issue của onflow/flow-cli

Issue tương tự

Thêm issue về Go

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.