* #890: Add ECDSA#toEthSignedMessage for bytes type * refactor * add test, refactor * select overloaded function explicitly * use short test message string * add changelog entry Co-authored-by: Francisco Giordano <frangio.1@gmail.com> Co-authored-by: Hadrien Croubois <hadrien.croubois@gmail.com>
This commit is contained in:
@ -6,6 +6,7 @@ import "../utils/cryptography/ECDSA.sol";
|
||||
|
||||
contract ECDSAMock {
|
||||
using ECDSA for bytes32;
|
||||
using ECDSA for bytes;
|
||||
|
||||
function recover(bytes32 hash, bytes memory signature) public pure returns (address) {
|
||||
return hash.recover(signature);
|
||||
@ -33,4 +34,8 @@ contract ECDSAMock {
|
||||
function toEthSignedMessageHash(bytes32 hash) public pure returns (bytes32) {
|
||||
return hash.toEthSignedMessageHash();
|
||||
}
|
||||
|
||||
function toEthSignedMessageHash(bytes memory s) public pure returns (bytes32) {
|
||||
return s.toEthSignedMessageHash();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user