-
Notifications
You must be signed in to change notification settings - Fork 6
NonMembership proof #54
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -337,35 +337,53 @@ func (pr *Prover) ProveState(ctx core.QueryContext, path string, value []byte) ( | |||||||||||||||||||||||
| if err != nil { | ||||||||||||||||||||||||
| return nil, clienttypes.Height{}, fmt.Errorf("failed originProver.ProveState: path=%v value=%x %w", path, value, err) | ||||||||||||||||||||||||
| } | ||||||||||||||||||||||||
| m := elc.MsgVerifyMembership{ | ||||||||||||||||||||||||
| ClientId: pr.config.ElcClientId, | ||||||||||||||||||||||||
| Prefix: []byte(exported.StoreKey), | ||||||||||||||||||||||||
| Path: path, | ||||||||||||||||||||||||
| Value: value, | ||||||||||||||||||||||||
| ProofHeight: proofHeight, | ||||||||||||||||||||||||
| Proof: proof, | ||||||||||||||||||||||||
| Signer: pr.activeEnclaveKey.GetEnclaveKeyAddress().Bytes(), | ||||||||||||||||||||||||
| } | ||||||||||||||||||||||||
| res, err := pr.lcpServiceClient.VerifyMembership(ctx.Context(), &m) | ||||||||||||||||||||||||
| if err != nil { | ||||||||||||||||||||||||
| return nil, clienttypes.Height{}, fmt.Errorf("failed ELC's VerifyMembership: elc_client_id=%v msg=%v %w", pr.config.ElcClientId, m, err) | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| var cp lcptypes.CommitmentProofs | ||||||||||||||||||||||||
| if len(value) == 0 { | ||||||||||||||||||||||||
| m := elc.MsgVerifyNonMembership{ | ||||||||||||||||||||||||
| ClientId: pr.config.ElcClientId, | ||||||||||||||||||||||||
| Prefix: []byte(exported.StoreKey), | ||||||||||||||||||||||||
| Path: path, | ||||||||||||||||||||||||
| ProofHeight: proofHeight, | ||||||||||||||||||||||||
| Proof: proof, | ||||||||||||||||||||||||
| Signer: pr.activeEnclaveKey.GetEnclaveKeyAddress().Bytes(), | ||||||||||||||||||||||||
| } | ||||||||||||||||||||||||
| res, err := pr.lcpServiceClient.VerifyNonMembership(ctx.Context(), &m) | ||||||||||||||||||||||||
| if err != nil { | ||||||||||||||||||||||||
| return nil, clienttypes.Height{}, fmt.Errorf("failed ELC's VerifyNonMembership: elc_client_id=%v msg=%v %w", pr.config.ElcClientId, m, err) | ||||||||||||||||||||||||
| } | ||||||||||||||||||||||||
| cp.Message = res.Message | ||||||||||||||||||||||||
| cp.Signatures = [][]byte{res.Signature} | ||||||||||||||||||||||||
|
Comment on lines
+351
to
+356
|
||||||||||||||||||||||||
| res, err := pr.lcpServiceClient.VerifyNonMembership(ctx.Context(), &m) | |
| if err != nil { | |
| return nil, clienttypes.Height{}, fmt.Errorf("failed ELC's VerifyNonMembership: elc_client_id=%v msg=%v %w", pr.config.ElcClientId, m, err) | |
| } | |
| cp.Message = res.Message | |
| cp.Signatures = [][]byte{res.Signature} | |
| var err error | |
| res, err = pr.lcpServiceClient.VerifyNonMembership(ctx.Context(), &m) | |
| if err != nil { | |
| return nil, clienttypes.Height{}, fmt.Errorf("failed ELC's VerifyNonMembership: elc_client_id=%v msg=%v %w", pr.config.ElcClientId, m, err) | |
| } |
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 return type of VerifyMembership and VerifyMembership is not compatible.
I think generics is needed to commonalize these code, it is a bit over spec at this situation.
Uh oh!
There was an error while loading. Please reload this page.