Skip to content

Commit

Permalink
Always pass hex to signRaw (#1945)
Browse files Browse the repository at this point in the history
  • Loading branch information
jacogr authored Nov 25, 2019
1 parent 0caf207 commit 99834b3
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions packages/app-toolbox/src/Sign.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import styled from 'styled-components';
import { web3FromSource } from '@polkadot/extension-dapp';
import { Button, Input, InputAddress, Output, Static } from '@polkadot/react-components';
import keyring from '@polkadot/ui-keyring';
import { hexToU8a, isFunction, isHex, stringToU8a, u8aToHex } from '@polkadot/util';
import { hexToU8a, isFunction, isHex, stringToHex, stringToU8a, u8aToHex } from '@polkadot/util';

import translate from './translate';
import Unlock from './Unlock';
Expand Down Expand Up @@ -83,7 +83,13 @@ function Sign ({ className, t }: Props): React.ReactElement<Props> {
setSignature('');

signer
.signRaw({ address: currentPair.address, data, type: 'bytes' })
.signRaw({
address: currentPair.address,
data: isHexData
? data
: stringToHex(data),
type: 'bytes'
})
.then(({ signature }): void => setSignature(signature));
} else {
setSignature(u8aToHex(
Expand Down

0 comments on commit 99834b3

Please sign in to comment.