Extract helper for converting hex to keccak256 hash

- Also prefer crypto.Keccak256Hash(x) to common.BytesToHash(crypto.Keccak256(x))
This commit is contained in:
Rob Mulholand
2019-09-25 16:36:08 -05:00
committed by Elizabeth Engelman
parent d06dddbfaa
commit 2ff88de859
8 changed files with 20 additions and 25 deletions
+1 -1
View File
@@ -92,5 +92,5 @@ func (e Event) Sig() common.Hash {
types[i] = input.Type.String()
}
return common.BytesToHash(crypto.Keccak256([]byte(fmt.Sprintf("%v(%v)", e.Name, strings.Join(types, ",")))))
return crypto.Keccak256Hash([]byte(fmt.Sprintf("%v(%v)", e.Name, strings.Join(types, ","))))
}
+1 -1
View File
@@ -107,5 +107,5 @@ func (m Method) Sig() common.Hash {
i++
}
return common.BytesToHash(crypto.Keccak256([]byte(fmt.Sprintf("%v(%v)", m.Name, strings.Join(types, ",")))))
return crypto.Keccak256Hash([]byte(fmt.Sprintf("%v(%v)", m.Name, strings.Join(types, ","))))
}