Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ADP 3491] Relax policy key guard #4850

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

paweljakubas
Copy link
Contributor

@paweljakubas paweljakubas commented Nov 20, 2024

policyXPub is needed in constructTransaction in two cases:

  • tx contains minting/burning action
  • tx deals with reference scripting and has reference script template nonempty

instead of using policyXPub we use policyXPubM throught the function and only deconstruct it when checking those two cases. ErrReadPolicyPublicKeyAbsen is used for the those two valid situations when policy xpub is missing.

Comments

Issue Number

adp-3491

@paweljakubas paweljakubas self-assigned this Nov 20, 2024
@@ -2650,7 +2653,7 @@ constructTransaction api knownPools poolStatus apiWalletId body = do
makeLeft $
toTokenMapAndScript ShelleyKeyS
scriptT
(Map.singleton (Cosigner 0) policyXPub)
(Map.singleton (Cosigner 0) $ fromJust policyXPubM)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤔 Having to resort to an approach with fromJust seems unfortunate...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, fair point. Now no partial function fixing ;-)

@paweljakubas paweljakubas force-pushed the paweljakubas/adp-3491/relax-policy-key-guard branch 2 times, most recently from ea516e3 to 3d54963 Compare November 20, 2024 09:35
@paweljakubas paweljakubas marked this pull request as draft November 20, 2024 15:21
@paweljakubas
Copy link
Contributor Author

waiting for the daedalus team to confirm if the fix works. If yes then we will undraft it.

handle reference script situation

resign from fremJust
@abailly abailly force-pushed the paweljakubas/adp-3491/relax-policy-key-guard branch from d443f0e to eab1d67 Compare December 16, 2024 14:24
@abailly
Copy link
Collaborator

abailly commented Dec 16, 2024

There's a remaining issue: constructTransaction depends on decodeTransaction which unconditionally extract the policy pub key and throws an exception if it cannot find one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants