Allow verification of new-style message wrapping (#6144)
This commit is contained in:
parent
7a62234d34
commit
950a476f30
@ -6,6 +6,7 @@ import type { KeypairType } from '@polkadot/util-crypto/types';
|
||||
import React, { useCallback, useEffect, useState } from 'react';
|
||||
import styled from 'styled-components';
|
||||
|
||||
import { wrapBytes } from '@polkadot/extension-dapp';
|
||||
import { Badge, Dropdown, Input, InputAddress, Static } from '@polkadot/react-components';
|
||||
import { useApi } from '@polkadot/react-hooks';
|
||||
import { keyring } from '@polkadot/ui-keyring';
|
||||
@ -36,7 +37,11 @@ function Verify ({ className = '' }: Props): React.ReactElement {
|
||||
|
||||
// We use signatureVerify to detect validity and crypto type
|
||||
if (isValid && publicKey) {
|
||||
const verification = signatureVerify(data, signature, publicKey);
|
||||
let verification = signatureVerify(data, signature, publicKey);
|
||||
|
||||
if (verification.crypto === 'none') {
|
||||
verification = signatureVerify(wrapBytes(data), signature, publicKey);
|
||||
}
|
||||
|
||||
if (verification.crypto !== 'none') {
|
||||
isValid = verification.isValid;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user