Refactor signing functions to use blake2AsU8a for hashing instead of registry.hash in conditional sign of extrinsic payload (#6183)

* fix: Refactor signing functions to use blake2AsU8a for hashing instead of registry.hash in conditional sign of extrinsic payload

* fix: resolve lint error and discard unused hash

* fix: resolve lint err
This commit is contained in:
ZeroX-Toml
2025-07-25 08:18:25 +05:30
committed by GitHub
parent 3e8d4e0e24
commit 6b9e1b4d21
+4 -2
View File
@@ -5,10 +5,12 @@ import type { SignOptions } from '@polkadot/keyring/types';
import type { Registry } from '@polkadot/types-codec/types';
import type { IKeyringPair } from '../types/index.js';
import { blake2AsU8a } from '@polkadot/util-crypto';
// a helper function for both types of payloads, Raw and metadata-known
export function sign (registry: Registry, signerPair: IKeyringPair, u8a: Uint8Array, options?: SignOptions): Uint8Array {
export function sign (_registry: Registry, signerPair: IKeyringPair, u8a: Uint8Array, options?: SignOptions): Uint8Array {
const encoded = u8a.length > 256
? registry.hash(u8a)
? blake2AsU8a(u8a)
: u8a;
return signerPair.sign(encoded, options);