-
Notifications
You must be signed in to change notification settings - Fork 220
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
Conversation
@@ -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) |
There was a problem hiding this comment.
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...
There was a problem hiding this comment.
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 ;-)
ea516e3
to
3d54963
Compare
waiting for the daedalus team to confirm if the fix works. If yes then we will undraft it. |
9971ae7
to
d443f0e
Compare
d443f0e
to
eab1d67
Compare
There's a remaining issue: |
Fix #4872 |
5b4f4de
to
ca7546a
Compare
@abailly the last commit is huge (+3,919 −3,109). Unintentionally caused by some autoformatter? |
@Anviking I don't know, I ran the code checker and it did not complain 🤷 |
I must confess I pay exactly 0 attention to code format as I expect this to be handled by the tooling. In our case, I understand this is stylish-haskell, which I ran. |
@paweljakubas I think I would like to write a proper test for this, your guidance would be much appreciated. |
The most beautiful (and persuasive also) test (integration one) would be the following:
In essense, |
3af10dd
to
0937538
Compare
@Anviking I updated the PR, the size of the diff is much more reasonable :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, if you've tested this. I suspect the fromJust
pattern could be dropped but that already existed before this pr.
handle reference script situation resign from fremJust
Delegate that task to callers
0937538
to
085f5c1
Compare
@Anviking I agree an integration test would be useful, but I also don't want to add too many of those as they might become a liability pretty quickly. |
Yeah, I just meant that I presume you've verified (manually) that this did what you wanted it to |
Of course, but you're right and this feels a bit sloppy |
Fully share this concern though |
policyXPub
is needed in constructTransaction in two cases:instead of using
policyXPub
we usepolicyXPubM
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
Fix #4872