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

fix: populate default values for contract_metadata #1249

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mitinarseny
Copy link
Contributor

@mitinarseny mitinarseny commented Oct 14, 2024

Add #[darling(default)] attribute for link and version to make it possible to derive them from env:

#[near(contract_metadata(standard(standard = "nep141", version = "1.0.0")))
struct Contract {}

As current implementation returns an error:

error: expected an expression
 │   --> src/lib.rs:49:1
 │    |
 │ 49 | / #[near(
 │ 50 | |     contract_state,
 │ 51 | |     contract_metadata(standard(standard = "nep141", version = "1.0.0"))
 │ 52 | | )]
 │    | |__^
 │    |
 │    = note: this error originates in the attribute macro `near` (in Nightly builds, run with -Z macro-backtrace for more info)
 │ 
 │ error[E0425]: cannot find value `CONTRACT_SOURCE_METADATA` in this scope
 │   -->src/lib.rs:49:1
 │    |
 │ 49 | / #[near(
 │ 50 | |     contract_state,
 │ 51 | |     contract_metadata(standard(standard = "nep141", version = "1.0.0"))
 │ 52 | | )]
 │    | |__^ not found in this scope
 │    |
 │    = note: this error originates in the attribute macro `::near_sdk::near_bindgen` (in Nightly builds, run with -Z macro-backtrace for more info)

Copy link

codecov bot commented Oct 14, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 80.03%. Comparing base (936ae63) to head (8bb0041).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1249   +/-   ##
=======================================
  Coverage   80.03%   80.03%           
=======================================
  Files         102      102           
  Lines       14597    14597           
=======================================
  Hits        11683    11683           
  Misses       2914     2914           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant