diff --git a/js/src/api/format/input.js b/js/src/api/format/input.js index 16ca2b7f2..27c834ead 100644 --- a/js/src/api/format/input.js +++ b/js/src/api/format/input.js @@ -46,6 +46,10 @@ export function inData (data) { return inHex(data); } +export function inHash (hash) { + return inHex(hash); +} + export function inTopics (_topics) { let topics = (_topics || []) .filter((topic) => topic) diff --git a/js/src/api/rpc/eth/eth.js b/js/src/api/rpc/eth/eth.js index 60eb172a3..3d99f82b8 100644 --- a/js/src/api/rpc/eth/eth.js +++ b/js/src/api/rpc/eth/eth.js @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Parity. If not, see . -import { inAddress, inBlockNumber, inData, inFilter, inHex, inNumber16, inOptions } from '../../format/input'; +import { inAddress, inBlockNumber, inData, inFilter, inHash, inHex, inNumber16, inOptions } from '../../format/input'; import { outAddress, outBlock, outLog, outNumber, outReceipt, outTransaction } from '../../format/output'; export default class Eth { @@ -292,9 +292,9 @@ export default class Eth { .execute('eth_sendTransaction', inOptions(options)); } - sign () { + sign (address, hash) { return this._transport - .execute('eth_sign'); + .execute('eth_sign', inAddress(address), inHash(hash)); } signTransaction () { diff --git a/js/src/jsonrpc/interfaces/eth.js b/js/src/jsonrpc/interfaces/eth.js index b8bbcbd61..33bf9d66d 100644 --- a/js/src/jsonrpc/interfaces/eth.js +++ b/js/src/jsonrpc/interfaces/eth.js @@ -924,7 +924,7 @@ export default { }, sign: { - desc: 'Signs data with a given address.\n**Note** the address to sign must be unlocked.', + desc: 'Signs transaction hash with a given address.', params: [ { type: Address, @@ -933,7 +933,7 @@ export default { }, { type: Data, - desc: 'Data to sign' + desc: 'Transaction hash to sign' } ], returns: {