Ensure Bytes doesn't get double ellipsis (#7274)

This commit is contained in:
Jaco 2022-03-30 14:35:22 +02:00 committed by GitHub
parent 9320c4c7aa
commit 70ac44edfa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 4 deletions

View File

@ -30,7 +30,6 @@ function extract (extrinsic?: SubmittableExtrinsic<'promise'> | null): [string,
return [
u8aToHex(u8a),
extrinsic.registry.hash(u8a).toHex(),
// 0x410284009a81870b7ba4774b2a7efc31a635ec4042088d97ecbdaaf9552c3e21f74aae5201122fea94623d7aecda9870009506865a666d8a962aa2b58f12d5b512258f1a0aab569d7982bfd616c90d7ccf6960dadb29c5de46d2da73a159f5c6bbd5206f8b85029c00040300429599ba5f521844f2332524dec987f9cfb116a2570f83b2417184af0c74ab130700743ba40b
extrinsic.isSigned
? extrinsic.inspect()
: extrinsic.method.inspect()

View File

@ -38,8 +38,8 @@ function Output ({ children, className = '', help, isDisabled, isError, isFull,
withLabel={withLabel}
>
<div className={`ui--output ui dropdown selection ${isError ? ' error' : ''}${isMonospace ? ' monospace' : ''}${isDisabled ? 'isDisabled' : ''}`}>
{isTrimmed && value && (value.length > 256)
? `${value.substr(0, 96)}…${value.substr(-96)}`
{isTrimmed && value && (value.length > 512)
? `${value.substr(0, 256)}…${value.substr(-256)}`
: value
}
{children}

View File

@ -75,7 +75,7 @@ function BaseBytes ({ asHex, children, className = '', defaultValue: { value },
? u8aToString(value)
: isHex(value)
? value
: u8aToHex(value as Uint8Array, isDisabled ? 256 : -1)
: u8aToHex(value as Uint8Array)
: undefined
);
const [{ isAddress, isValid, lastValue }, setValidity] = useState<Validity>(() => ({