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

Impr docs #1262

Open
wants to merge 33 commits into
base: master
Choose a base branch
from
Open

Impr docs #1262

wants to merge 33 commits into from

Conversation

PolyProgrammist
Copy link
Collaborator

No description provided.

Copy link

codecov bot commented Nov 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 80.16%. Comparing base (ae0d1c4) to head (b1b185f).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1262      +/-   ##
==========================================
- Coverage   80.26%   80.16%   -0.11%     
==========================================
  Files         104      104              
  Lines       14855    14855              
==========================================
- Hits        11924    11909      -15     
- Misses       2931     2946      +15     

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

@@ -500,6 +500,8 @@ pub fn alt_bn128_pairing_check(value: &[u8]) -> bool {
// ################
/// Creates a promise that will execute a method on account with given arguments and attaches
/// the given amount and gas.
Copy link
Collaborator

Choose a reason for hiding this comment

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

@PolyProgrammist suggest adding more links, mentioned in #1265 and marked up in review of #1259,
in addition to ones, added in scope of current pr, after fixing conflicts, if you plan to finish current pr

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Which links do you mean? @dj8yfo

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Added half of the comments. Left the other for the future

Copy link
Contributor

@denbite denbite left a comment

Choose a reason for hiding this comment

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

Great job on this, I've dropped a few comments with some thoughts on how it could be even better
it's mainly focused on adding more examples

near-sdk-macros/src/lib.rs Outdated Show resolved Hide resolved
near-sdk-macros/src/lib.rs Outdated Show resolved Hide resolved
near-sdk-macros/src/lib.rs Outdated Show resolved Hide resolved
near-sdk-macros/src/lib.rs Outdated Show resolved Hide resolved
near-sdk-macros/src/lib.rs Show resolved Hide resolved
near-sdk-macros/src/lib.rs Show resolved Hide resolved
near-sdk-macros/src/lib.rs Show resolved Hide resolved
near-sdk/src/lib.rs Show resolved Hide resolved
@PolyProgrammist PolyProgrammist marked this pull request as ready for review December 20, 2024 17:15
@PolyProgrammist
Copy link
Collaborator Author

@dj8yfo @denbite thanks for the review. Please check again

@@ -159,7 +159,7 @@ pub fn register_len(register_id: u64) -> Option<u64> {
/// use near_sdk::AccountId;
/// use std::str::FromStr;
///
/// assert_eq!(current_account_id(), AccountId::from_str("alice.near").unwrap());
/// assert_eq!(current_account_id(), "alice.near".parse().unwrap());
Copy link
Collaborator

Choose a reason for hiding this comment

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

adding turbofishes helps in this and similar occasions

diff --git a/near-sdk/src/environment/env.rs b/near-sdk/src/environment/env.rs
index f04121cd..28bd0e75 100644
--- a/near-sdk/src/environment/env.rs
+++ b/near-sdk/src/environment/env.rs
@@ -152,21 +152,21 @@ pub fn register_len(register_id: u64) -> Option<u64> {
 // # Context API #
 // ###############
 /// The id of the account that owns the current contract.
 ///
 /// # Examples
 /// ```
 /// use near_sdk::env::current_account_id;
 /// use near_sdk::AccountId;
 /// use std::str::FromStr;
 ///
-/// assert_eq!(current_account_id(), "alice.near".parse().unwrap());
+/// assert_eq!(current_account_id(), "alice.near".parse::<AccountId>().unwrap());
 /// ```
 pub fn current_account_id() -> AccountId {
     assert_valid_account_id(method_into_register!(current_account_id))
 }
 
 /// The id of the account that either signed the original transaction or issued the initial
 /// cross-contract call.
 ///
 /// # Examples
 /// ```

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

Successfully merging this pull request may close these issues.

3 participants