-
Notifications
You must be signed in to change notification settings - Fork 251
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
base: master
Are you sure you want to change the base?
Impr docs #1262
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
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. |
near-sdk/src/environment/env.rs
Outdated
@@ -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. |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this 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
@@ -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()); |
There was a problem hiding this comment.
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
/// ```
No description provided.