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 Mar 1, 2023
1 parent cf84911 commit 27b77b1
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 27b77b1

Please sign in to comment.