Support for signRaw on Ledger SubstrateApp (#1849)
* Support for signRaw on Ledger SubstrateApp * Adjust with callback return * Ensure message is wrapped before signing
This commit is contained in:
@@ -51,12 +51,14 @@ export function u8aUnwrapBytes (bytes: U8aLike): Uint8Array {
|
||||
|
||||
/**
|
||||
* @name u8aWrapBytes
|
||||
* @description Adds a <Bytes>...</Bytes> wrapper to the supplied value (if not already existing)
|
||||
* @description
|
||||
* Adds a <Bytes>...</Bytes> wrapper to the supplied value, if
|
||||
* - We don't already have a Bytes wrapper
|
||||
* - The message is not an Ethereum-style message
|
||||
*/
|
||||
export function u8aWrapBytes (bytes: U8aLike): Uint8Array {
|
||||
const u8a = u8aToU8a(bytes);
|
||||
|
||||
// if Ethereum-wrapping, we don't add our wrapping bytes
|
||||
return u8aIsWrapped(u8a, true)
|
||||
? u8a
|
||||
: u8aConcatStrict([U8A_WRAP_PREFIX, u8a, U8A_WRAP_POSTFIX]);
|
||||
|
||||
Reference in New Issue
Block a user