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

fix: export interface for data structure with link and height #17

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,14 +129,22 @@ export interface PieceInfo {
size: PaddedPieceSize
}

export interface PieceInfoView extends PieceInfo {
export interface PieceView {
/**
* Commitment to the data segment (Merkle node which is the root of the
* subtree containing all the nodes making up the data segment)
*/
link: PieceLink

/**
* Height of the perfect binary merkle tree representing
* this piece.
*/
height: number
}

export interface PieceInfoView extends PieceInfo, PieceView {}

/**
* Represents a piece tree and underlying merkle tree.
*/
Expand Down