diff options
author | bas-vk <bas-vk@users.noreply.github.com> | 2016-10-29 03:25:49 +0800 |
---|---|---|
committer | Felix Lange <fjl@twurst.com> | 2016-10-29 03:25:49 +0800 |
commit | b59c8399fbe42390a3d41e945d03b1f21c1a9b8d (patch) | |
tree | e7fd68d7619ef4cc2f7739c6fb85096238ae7a17 /accounts/abi | |
parent | 289b30715d097edafd5562f66cb3567a70b2d330 (diff) | |
download | go-tangerine-b59c8399fbe42390a3d41e945d03b1f21c1a9b8d.tar.gz go-tangerine-b59c8399fbe42390a3d41e945d03b1f21c1a9b8d.tar.zst go-tangerine-b59c8399fbe42390a3d41e945d03b1f21c1a9b8d.zip |
internal/ethapi: add personal_sign and fix eth_sign to hash message (#2940)
This commit includes several API changes:
- The behavior of eth_sign is changed. It now accepts an arbitrary
message, prepends the well-known string
\x19Ethereum Signed Message:\n<length of message>
hashes the result using keccak256 and calculates the signature of
the hash. This breaks backwards compatability!
- personal_sign(hash, address [, password]) is added. It has the same
semantics as eth_sign but also accepts a password. The private key
used to sign the hash is temporarily unlocked in the scope of the
request.
- personal_recover(message, signature) is added and returns the
address for the account that created a signature.
Diffstat (limited to 'accounts/abi')
-rw-r--r-- | accounts/abi/bind/auth.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/accounts/abi/bind/auth.go b/accounts/abi/bind/auth.go index 2cf22768c..cd6adc746 100644 --- a/accounts/abi/bind/auth.go +++ b/accounts/abi/bind/auth.go @@ -52,7 +52,7 @@ func NewKeyedTransactor(key *ecdsa.PrivateKey) *TransactOpts { if address != keyAddr { return nil, errors.New("not authorized to sign this account") } - signature, err := crypto.Sign(tx.SigHash().Bytes(), key) + signature, err := crypto.SignEthereum(tx.SigHash().Bytes(), key) if err != nil { return nil, err } |