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

Introduce near macro #1147

Merged
merged 69 commits into from
Mar 15, 2024
Merged

Introduce near macro #1147

merged 69 commits into from
Mar 15, 2024

Conversation

PolyProgrammist
Copy link
Contributor

@PolyProgrammist PolyProgrammist commented Feb 21, 2024

Resolves #1142

@PolyProgrammist PolyProgrammist changed the title Boilerplate Introduce near macro Feb 27, 2024
@PolyProgrammist PolyProgrammist marked this pull request as ready for review March 14, 2024 15:05
frol
frol previously approved these changes Mar 14, 2024
Comment on lines 18 to 20
#[derive(BorshSerialize, BorshDeserialize, NearSchema)]
#[inside_nearsdk]
#[abi(borsh)]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Do we need to manually derive Borsh/Schema? I would expect that #[near] would also work here
  2. Instead of #[inside_nearsdk], can we add a parameter, so you can just write #[near(crate="crate")]? This way we will also allow re-embedding near_sdk if necessary

@frol
Copy link
Collaborator

frol commented Mar 14, 2024

Overall, this looks great to me! I have only one question, but if it would take longer than a day to implement, let's ignore it since everything else is already implemented and looks great!

@PolyProgrammist
Copy link
Contributor Author

Instead of #[inside_nearsdk], can we add a parameter, so you can just write #[near(crate="crate")]? This way we will also allow re-embedding near_sdk if necessary

Decided to skip it with Vlad for now. Since crate is a keyword and darling can't handle that. It requires a manual attribute parsing

frol
frol previously approved these changes Mar 15, 2024
frol
frol previously approved these changes Mar 15, 2024
@frol frol enabled auto-merge (squash) March 15, 2024 12:59
@frol frol merged commit 1408127 into near:master Mar 15, 2024
14 checks passed
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.

Investigate how to reduce boilerplate that needs to be added almost to every struct
2 participants