具体是做什么ExtrinsicPayload
的?我想复制逻辑,但缺少一些东西。
import {
getRegistry
} from '@substrate/txwrapper-polkadot';
const registry = getRegistry({
chainName: 'Polkadot',
specName,
specVersion,
metadataRpc,
});
const extrinsicPayload = registry.createType('ExtrinsicPayload', unsigned, {version: unsigned.version});
const extrinsicPayloadU8a = extrinsicPayload.toU8a({method: true})
const actualPayload = extrinsicPayloadU8a.length > 256 ? registry.hash(extrinsicPayloadU8a) : extrinsicPayloadU8a;
const s1 = u8aToHex(alice.sign(actualPayload));
console.log("s1", s1, s1.length);
const s2 = extrinsicPayload.sign(alice).signature;
console.log("s2", s2, s2.length);
s1 和 s2 应该具有相同的长度,但它们没有。什么原因?