Skip to content

Commit

Permalink
restrict to use exist proof
Browse files Browse the repository at this point in the history
  • Loading branch information
yutianwu committed Dec 2, 2022
1 parent 49a570d commit 9cd8f89
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions core/vm/lightclient/ics23_proof.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ func (op CommitmentOp) GetKey() []byte {
// If length 0 args is passed in, then CommitmentOp will attempt to prove the absence of the key
// in the CommitmentOp and return the CommitmentRoot of the proof.
func (op CommitmentOp) Run(args [][]byte) ([][]byte, error) {
if _, ok := op.Proof.Proof.(*ics23.CommitmentProof_Exist); !ok {
return nil, fmt.Errorf("only exist proof supported")
}

// calculate root from proof
root, err := op.Proof.Calculate()
if err != nil {
Expand Down

0 comments on commit 9cd8f89

Please sign in to comment.