Skip to content

Commit

Permalink
Merge pull request #3352 from Emurgo/feat/YOEXT-783/pool-owner-witness
Browse files Browse the repository at this point in the history
[4.23.200] enable to register as pool owner
  • Loading branch information
vsubhuman authored Nov 18, 2023
2 parents aa24fc2 + ebaaa26 commit 4f0a873
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 9 deletions.
19 changes: 12 additions & 7 deletions packages/yoroi-extension/chrome/extension/connector/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,7 @@ function getTxRequiredSigningKeys(
return set;
}

function getCip95RequiredSignKeys(
function getCertificatesRequiredSignKeys(
txBody: RustModule.WalletV4.TransactionBody,
): Set<string> {
const result: Set<string> = new Set();
Expand Down Expand Up @@ -679,6 +679,14 @@ function getCip95RequiredSignKeys(
}
continue;
}
const poolRegCert = cert.as_pool_registration();
if (poolRegCert) {
const hashes = poolRegCert.pool_params().pool_owners();
for (let j = 0; j < hashes.len(); j++) {
result.add(hashes.get(j).to_hex());
}
continue;
}
}
}

Expand Down Expand Up @@ -765,13 +773,10 @@ async function __connectorSignCardanoTx(
throw new Error(`missing chains functionality`);
}

const requiredTxSignKeys = getTxRequiredSigningKeys(txBody);
const requiredScriptSignKeys = getScriptRequiredSigningKeys(witnessSet, RustModule);
const requiredCip95SignKeys = getCip95RequiredSignKeys(txBody);
const totalAdditionalRequiredSignKeys = new Set<string>([
...requiredTxSignKeys,
...requiredScriptSignKeys,
...requiredCip95SignKeys,
...getTxRequiredSigningKeys(txBody),
...getScriptRequiredSigningKeys(witnessSet, RustModule),
...getCertificatesRequiredSignKeys(txBody),
]);

console.log('totalAdditionalRequiredSignKeys', [...totalAdditionalRequiredSignKeys]);
Expand Down
2 changes: 1 addition & 1 deletion packages/yoroi-extension/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/yoroi-extension/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "yoroi",
"version": "4.23.100",
"version": "4.23.200",
"description": "Cardano ADA wallet",
"scripts": {
"dev-mv2": "rimraf dev/ && babel-node scripts-mv2/build --type=debug --env 'mainnet'",
Expand Down

0 comments on commit 4f0a873

Please sign in to comment.