Extract helper for converting hex to keccak256 hash
- Also prefer crypto.Keccak256Hash(x) to common.BytesToHash(crypto.Keccak256(x))
This commit is contained in:
committed by
Elizabeth Engelman
parent
d06dddbfaa
commit
2ff88de859
@@ -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, ","))))
|
||||
}
|
||||
|
||||
@@ -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, ","))))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user