Use bytes wrapping from @polkadot/util (#1266)
This commit is contained in:
parent
4b6b53d2f9
commit
4ca3237988
@ -7,8 +7,7 @@ import type { SignerPayloadRaw } from '@polkadot/types/types';
|
||||
import type { HexString } from '@polkadot/util/types';
|
||||
import type { RequestSign } from './types.js';
|
||||
|
||||
import { wrapBytes } from '@polkadot/extension-dapp/wrapBytes';
|
||||
import { u8aToHex } from '@polkadot/util';
|
||||
import { u8aToHex, u8aWrapBytes } from '@polkadot/util';
|
||||
|
||||
export default class RequestBytesSign implements RequestSign {
|
||||
public readonly payload: SignerPayloadRaw;
|
||||
@ -21,7 +20,7 @@ export default class RequestBytesSign implements RequestSign {
|
||||
return {
|
||||
signature: u8aToHex(
|
||||
pair.sign(
|
||||
wrapBytes(this.payload.data)
|
||||
u8aWrapBytes(this.payload.data)
|
||||
)
|
||||
)
|
||||
};
|
||||
|
||||
@ -6,8 +6,8 @@ import type { HexString } from '@polkadot/util/types';
|
||||
|
||||
import React, { useCallback, useMemo, useState } from 'react';
|
||||
|
||||
import { wrapBytes } from '@polkadot/extension-dapp/wrapBytes';
|
||||
import { QrDisplayPayload, QrScanSignature } from '@polkadot/react-qr';
|
||||
import { u8aWrapBytes } from '@polkadot/util';
|
||||
|
||||
import { Button } from '../../components/index.js';
|
||||
import useTranslation from '../../hooks/useTranslation.js';
|
||||
@ -35,7 +35,7 @@ function Qr ({ address, className, cmd, genesisHash, onSignature, payload }: Pro
|
||||
case CMD_MORTAL:
|
||||
return (payload as ExtrinsicPayload).toU8a();
|
||||
case CMD_SIGN_MESSAGE:
|
||||
return wrapBytes(payload as string);
|
||||
return u8aWrapBytes(payload as string);
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user