Correct parameters for eth_sign (#2703)
* Cherry-pick eth_sign update/fix * Correct sign documentation (signs txhash)
This commit is contained in:
parent
6aed6a45d3
commit
dadd6b1e7c
@ -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)
|
||||
|
@ -14,7 +14,7 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
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 () {
|
||||
|
@ -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: {
|
||||
|
Loading…
Reference in New Issue
Block a user