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

Refine documentation for subspace-core-primitives #85

Merged
merged 15 commits into from
Oct 28, 2021
Merged

Conversation

liuchengxu
Copy link
Contributor

@liuchengxu liuchengxu commented Oct 27, 2021

Part of #80

This PR mainly takes care of subspace-core-primitives, reviewing by each commit should make more sense, I'm open to all suggestions as my current understanding of the big picture can be limited. The Object related concepts will be revisited later.

@liuchengxu liuchengxu changed the title Refine rustdoc 0 Refine documentation for subspace-core-primitives Oct 27, 2021
crates/subspace-core-primitives/Cargo.toml Outdated Show resolved Hide resolved
crates/subspace-core-primitives/src/lib.rs Outdated Show resolved Hide resolved
crates/subspace-core-primitives/src/lib.rs Outdated Show resolved Hide resolved
crates/subspace-core-primitives/src/lib.rs Outdated Show resolved Hide resolved
crates/subspace-core-primitives/src/lib.rs Show resolved Hide resolved
crates/subspace-core-primitives/src/lib.rs Outdated Show resolved Hide resolved
crates/subspace-core-primitives/src/lib.rs Outdated Show resolved Hide resolved
crates/subspace-core-primitives/src/lib.rs Outdated Show resolved Hide resolved
crates/subspace-core-primitives/src/lib.rs Show resolved Hide resolved
crates/subspace-core-primitives/src/lib.rs Show resolved Hide resolved
@liuchengxu liuchengxu force-pushed the refine-rustdoc-0 branch 2 times, most recently from 96ca9c5 to fb920e6 Compare October 28, 2021 02:15
So that we can make use of `force-debug` feature in the future, ref substrate-developer-hub/substrate-docs#355
`merkle_tree_root` does not give much useful information, here
`record_root` is the merkle root of records of a semgent, just like
`tx_root` is the merkle root of transactions of a block.
runtime normally does not need the serde feature, which increases the
compiled wasm size(even unnoticble). The serde is compiled under `std`
by default, so the farmer can still access it without any pain.
Make it consistent with `extrinsics_root`.
Comment on lines +113 to +126
/// Returns the number of partially archived bytes for a block.
pub fn partial_archived(&self) -> Option<u32> {
self.archived_progress.partial()
}

/// Sets new number of partially archived bytes.
pub fn set_partial_archived(&mut self, new_partial: u32) {
self.archived_progress.set_partial(new_partial);
}

/// Sets the archived state of this block to [`ArchivedBlockProgress::Complete`].
pub fn set_complete(&mut self) {
self.archived_progress = ArchivedBlockProgress::Complete;
}
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure these methods and methods on ArchivedBlockProgress are super useful, it feels like it might have been easier to work with the data types directly (considering that all of their fields are public anyway.

@liuchengxu liuchengxu merged commit d7fc9d0 into main Oct 28, 2021
@liuchengxu liuchengxu deleted the refine-rustdoc-0 branch October 28, 2021 15:44
@liuchengxu liuchengxu mentioned this pull request Oct 28, 2021
12 tasks
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.

None yet

2 participants