示例#1
0
func (data *Data) Hash() []byte {
	if data.hash == nil {
		bs := make([]interface{}, len(data.Txs))
		for i, tx := range data.Txs {
			bs[i] = acm.SignBytes(config.GetString("chain_id"), tx)
		}
		data.hash = merkle.SimpleHashFromBinaries(bs) // NOTE: leaves are TxIDs.
	}
	return data.hash
}
示例#2
0
func (v *Validation) Hash() []byte {
	if v.hash == nil {
		bs := make([]interface{}, len(v.Precommits))
		for i, precommit := range v.Precommits {
			bs[i] = precommit
		}
		v.hash = merkle.SimpleHashFromBinaries(bs)
	}
	return v.hash
}