diff --git a/dist/v4.js b/dist/v4.js index e8ec50ec7fb5d3dab4f30cbc21fe36d0416f8a9d..cddc959ac2f0f396f17c18680d3d3fb0ca310f46 100644 --- a/dist/v4.js +++ b/dist/v4.js @@ -21,8 +21,23 @@ const getSignerType = (metadata) => { } if (address.type === "AccountId20" && signature.type === "array" && signature.len === 65 && signature.value.type === "primitive" && signature.value.value === "u8") return [1 /* Ethereum */, []]; - if (signature.type !== "enum" || ["Ecdsa", "Ed25519", "Sr25519"].some((x) => !(x in signature.value))) - throw unkownSignerType(); + // Quantus patch: the variant *names* are not load-bearing. + // + // Upstream required the signature enum to carry Ecdsa, Ed25519 and Sr25519. + // That whitelist exists only to tell the Substrate shape from the Ethereum + // one, and the Ethereum arm one line above already decides that structurally — + // AccountId20 plus a 65-byte array. Everything below this point is + // length-agnostic: createV4Tx concatenates whatever the signer returned and + // compact-prefixes the result. + // + // So this check fired before code that would have worked. Quantus's + // DilithiumSignatureScheme carries Dilithium87 and Dilithium65, and the + // metadata said so — getSignerType read the type out of the metadata and then + // threw the answer away in favour of three hardcoded names. Asking the runtime + // and then not believing it is the trap this whole port exists to avoid. + // + // See quantus/papi-console#1. + if (signature.type !== "enum") throw unkownSignerType(); if (address.type === "enum") { const id = address.value["Id"]; if (id.type === "lookupEntry" && id.value.type === "AccountId32")