// When the current proof chain is proofing existence, this method returns the root hash of
// the trie that generates the proof chain
When the current proof chain is proofing existence, this method returns the root hash of
the trie that generates the proof chain
// When the current proof chain is proofing existence this method returns the root hash of // the trie that generates the proof chain
func (c ProofChain) ExistenceHash() (rootHash []byte, err error) {
	if len(c) == 0 {
		return nil, ErrMissingValue
	}
	if c[0] == nil {
		return nil, common.ErrNil
	}
	if c[0].PType.IsProofExistence() == false {
		return nil, ErrMismatchProof
	} else {
		rootHash, err = c[0].ExistenceHash()
		if err != nil {
			return nil, err
		}
	}
	for i := 1; i < len(c); i++ {
		input := common.BytesToHash(rootHash)
		rootHash, err = c[i].Proof(input)
		if err != nil {
			return nil, err
		}
	}
	return
}
func ( c ProofChain ) ExistenceHash ( ) ( rootHash [ ] byte , err error ) { if len ( c ) == 0 { return nil , ErrMissingValue } if c [ 0 ] == nil { return nil , common . ErrNil } if c [ 0 ] . PType . IsProofExistence ( ) == false { return nil , ErrMismatchProof } else { rootHash , err = c [ 0 ] . ExistenceHash ( ) if err != nil { return nil , err } } for i := 1 ; i < len ( c ) ; i ++ { input := common . BytesToHash ( rootHash ) rootHash , err = c [ i ] . Proof ( input ) if err != nil { return nil , err } } return }
When the current proof chain is proofing existence, this method returns the root hash of
the trie that generates the proof chain
When the current proof chain is proofing existence this method returns the root hash of the trie that generates the proof chain
// The current proof node only supports the proof of existence, other types must provide // the value of tobeproof to calculate