-
-
Notifications
You must be signed in to change notification settings - Fork 19
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
Add composite type leaves to proof #110
Conversation
When creating a proof with a path to a composite type, include all leaves of the type in the proof.
This pull request introduces 1 alert when merging b89df8b into 8c31f3e - view on LGTM.com new alerts:
|
src/types/composite/list.ts
Outdated
} | ||
const gindices = super.tree_getLeafGindices(target, root); | ||
// include the length chunk | ||
gindices.push(concatGindices([root, BigInt(3)])); |
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.
Why 3
here? Could you add a comment explaining
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.
The comment on the line above is an attempt to explain 😅 open to any suggestions to make it clearer
} | ||
} else { | ||
for (let i = 0, gindex = extendedStartIndex; i < chunkCount; i++, gindex++) { | ||
gindices.push(...this.elementType.tree_getLeafGindices(undefined, gindex)); |
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.
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.
Looks great! 🔥 Can't wait to deploy this to the lightclient demo site
This pull request introduces 1 alert when merging a8546a0 into 8c31f3e - view on LGTM.com new alerts:
|
When creating a proof with a path to a composite type, include all
leaves of the type in the proof.
CompositeType#tree_getLeafGindices(tree?: Tree, root?: Gindex): Gindex[]
state.validators
)CompositeType#createProof
is extended to calltree_getLeafGindices
when the type at a path is a composite type.