diff --git a/packages/page-sudo/src/Sudo.tsx b/packages/page-sudo/src/Sudo.tsx index 68a6e6e36f..e4ceef67e7 100644 --- a/packages/page-sudo/src/Sudo.tsx +++ b/packages/page-sudo/src/Sudo.tsx @@ -27,8 +27,7 @@ function Sudo ({ className, isMine, sudoKey }: Props): React.ReactElement const [weight, setWeight] = useState(BN_ZERO); const _onChangeExtrinsic = useCallback( - (method: SubmittableExtrinsic<'promise'> | null = null) => - setMethod(() => method), + (method: SubmittableExtrinsic<'promise'> | null = null) => setMethod(() => method), [] ); diff --git a/packages/react-components/src/InputFile.tsx b/packages/react-components/src/InputFile.tsx index e7272fc62a..8aa477ff72 100644 --- a/packages/react-components/src/InputFile.tsx +++ b/packages/react-components/src/InputFile.tsx @@ -34,6 +34,7 @@ interface FileState { const BYTE_STR_0 = '0'.charCodeAt(0); const BYTE_STR_X = 'x'.charCodeAt(0); +const STR_NL = '\n'; const NOOP = (): void => undefined; function convertResult (result: ArrayBuffer): Uint8Array { @@ -41,7 +42,11 @@ function convertResult (result: ArrayBuffer): Uint8Array { // this converts the input (if detected as hex), via the hex conversion route if (data[0] === BYTE_STR_0 && data[1] === BYTE_STR_X) { - const hex = u8aToString(data); + let hex = u8aToString(data); + + while (hex[hex.length - 1] === STR_NL) { + hex = hex.substr(0, hex.length - 1); + } if (isHex(hex)) { return hexToU8a(hex);