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

docs: Lake Primitives documentation added #75

Merged
merged 3 commits into from
Jun 6, 2023

Conversation

khorolets
Copy link
Member

@khorolets khorolets commented May 23, 2023

In this PR I've added docs on NEAR Lake Primitives being introduced in 0.8.0 (high-level update)

  • Add docstrings to the structs and methods
  • Add an index doc to the lib.rs

Note! The base branch for this PR is feat/ctx-parent-transaction-cache

@khorolets khorolets added the documentation Improvements or additions to documentation label May 23, 2023
@khorolets khorolets added this to the 0.8.0 High-level update milestone May 23, 2023
/// The `delegate_action` is the action that the receiver will be able to sign on behalf of the signer.
/// The `signature` is the signature of the signer on the hash of the `delegate_action`.
///
/// The `delegate_action` can be any action, except for another `Delegate` action. Thus not allowing the nesting of `Delegate` actions.
#[derive(Debug, Clone)]
pub struct Delegate {
Copy link
Contributor

Choose a reason for hiding this comment

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

Should it be delegate_actions plural?

@@ -2,6 +2,8 @@ use crate::AccountId;

use super::receipts::Receipt;

/// Hight-level representation of the Event according to the [Events Format](https://nomicon.io/Standards/EventsFormat.html).
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
/// Hight-level representation of the Event according to the [Events Format](https://nomicon.io/Standards/EventsFormat.html).
/// High-level representation of the Event according to the [Events Format](https://nomicon.io/Standards/EventsFormat.html).

@@ -3,7 +3,7 @@ use near_indexer_primitives::{views, IndexerTransactionWithOutcome};
use crate::actions::{Action, ActionMetadata, DelegateAction};

impl Action {
// Tries to convert a &ReceiptView into a vector of Action.
// Tries to convert a [&ReceiptView](views::ReceiptView) into a vector of [Action].
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// Tries to convert a [&ReceiptView](views::ReceiptView) into a vector of [Action].
/// Tries to convert a [&ReceiptView](views::ReceiptView) into a vector of [Action].

@@ -3,7 +3,7 @@ use near_indexer_primitives::{views, IndexerTransactionWithOutcome};
use crate::actions::{Action, ActionMetadata, DelegateAction};

impl Action {
// Tries to convert a &ReceiptView into a vector of Action.
// Tries to convert a [&ReceiptView](views::ReceiptView) into a vector of [Action].
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// Tries to convert a [&ReceiptView](views::ReceiptView) into a vector of [Action].
/// Tries to convert a [&ReceiptView](views::ReceiptView) into [Vec<Action>](Action).

Also maybe this?

@@ -104,7 +104,7 @@ impl Action {
}
}

// Tries to convert a IndexerTransactionWithOutcome to a Vec<Action>
// Tries to convert a [IndexerTransactionWithOutcome] to a [Vec<Action>]
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// Tries to convert a [IndexerTransactionWithOutcome] to a [Vec<Action>]
/// Tries to convert a [IndexerTransactionWithOutcome] to a [Vec<Action>](Action)

This will point to the outer most type, i.e. Vec

@khorolets khorolets changed the base branch from feat/ctx-parent-transaction-cache to dev-0.8.0 June 6, 2023 09:05
@khorolets khorolets force-pushed the feat/doc-lake-primitives branch from 183a73d to 368c513 Compare June 6, 2023 09:13
@khorolets
Copy link
Member Author

I am going to merge it in order to publish a beta.1 release, since IMO we can improve the docs a bit later on the final release of 0.8.0

@khorolets khorolets merged commit 2f92bb3 into dev-0.8.0 Jun 6, 2023
khorolets added a commit that referenced this pull request Jun 6, 2023
* feat: ParentTransactionCache context and example

* Update documentation, add docs about the LakeContext

* docs: Lake Primitives documentation added
khorolets added a commit that referenced this pull request Jun 6, 2023
* feat: NEAR Lake Helper (high-level Lake Framework) (#51)

* feat: NEAR Lake Helper (high-level Lake Framework)

* cover all top-level primitives

* Update changelog

* Add getters to fields in primitives, update the required function, change Event structure

* chore: Closes #61: Changes made to the lib should be picked to 0.8.0

* fix(tests): Resolved #60: Fix failing doc tests (#66)

* fix(tests): Resolved #60: Fix failing doc tests

* fix: add proper code annotations where possible

* feat(primitives): Add support for DelegateAction (NEP-366) + LEP-002 (Focus on action and Events) (#67)

* feat(primitives): Add support for DelegateAction (NEP-336)

* Refactor the structures completely (LEP-002)

* (examples) Address review suggestions

* remove refactoring commented leftovers

* (primitives) Address review suggestion, optimize the structure, do some renaming

* Return iterators from methods instead of clone, improve return types, handle tx actions

* add todo for later to create dedicated structures for possible errors of Failure ExecutionStatus

* DelegateAction struct, split receipts file

* remove commented code

* expose delegate_actions mod

* feat: Expose concurrency parameter to the Lake structure (and builder) (#69)

* feat: LEP-001 Introduce Lake Context (#68)

* feat: Implement LEP-001 (Context)

* clean up Lake impl to reuse code

* Update docstrings

* refactor: Resolves #42 replace anyhow with LakeError enum (thiserror) (#70)

* fix: typo in README

* fix: CHANGELOG typos and bring back the concurrency usage lost during merging

* feat: ParentTransactionCache context and example (#74)

* feat: ParentTransactionCache context and example

* Update README for ParentTransactionCache about advanced usage

* refactor: Add LakeContext derive and introduce a concept of LakeContext with calls before and after user function

* Update lake-parent-transaction-cache/README.md

Co-authored-by: Morgan McCauley <morgan@mccauley.co.nz>

* address review suggestion rename field accounts_id -> account_ids

* add comments to the example, add READMEs, drop accidental artifact

* Update documentation, add docs about the LakeContext

* Add ParentTransactionCache to the Lake Framework README

* refactor Lake::run method to drop code duplication

---------

Co-authored-by: Morgan McCauley <morgan@mccauley.co.nz>

* docs: Lake Primitives documentation added (#75)

* feat: ParentTransactionCache context and example

* Update documentation, add docs about the LakeContext

* docs: Lake Primitives documentation added

* chore: Upgrade near primitives to 0.17.0 version (#77)

* chore: Prepare 0.8.0-beta.1 release (#78)

* chore: Prepare 0.8.0-beta.1 release

* Change to use CUSTOM_GITHUB_TOKEN and add a link to the workflow for the reasoning

* Setup versioning and add release-plz.toml

* Drop the release-plz job limitation on the CI job

* Add missing versions to the changelog

* Add 0.7.x branch to the CI

---------

Co-authored-by: Morgan McCauley <morgan@mccauley.co.nz>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants