-
Notifications
You must be signed in to change notification settings - Fork 29
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
Enable external keys #753
base: develop
Are you sure you want to change the base?
Enable external keys #753
Conversation
6c13424
to
5c16914
Compare
5365888
to
5c67e0e
Compare
e92d7fe
to
e171c7b
Compare
Moved common singing functions to to Frontend.UI.Dialogs.Signing.Common
Changed pubKeyFromWiget to take a KeyStorage for key suggestions instead of using uiComboBoxGlobalDatalist to suggest keys directly from the global key store.
- Enable external PublicKeys to be provided for as keys for capabilites - When attempting to build the DeploymentSettingsResult, throw and error if not every Public Key in the payload matches has a KeyPair in the wallet. Other wise use the wallet to provide with KeyPairs for the payload.
TODO Make it so that when a user selects any key for a capability that is in the list of unrestricted keys the key is removed from the list of unrestricted keys. Prevent the user from inputing an unrestricted key if the key is already used as a key for a capability
The "signingKeys" and "extraKeys" were being treated the same anyways to this unifies it to "publicKeys"
Added new tab to deploy contract called "External Signatures". Users can provide private keys or signatues for every external public key in the payload.
forM pubKeys $ \pubKey -> do | ||
sig pubKey | ||
|
||
let sigs = distributeListOverDyn ddsigs |
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.
let let let
_ <- divClass "group" $ do | ||
uiPreviewItem "Request Key" $ el "code" $ text (Pact.hashToText hash) | ||
|
||
let mkKeyTuple (KeyPair pub priv) = (pub, priv) |
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.
let let
cmd <- buildCmdWithPayload payload [] | ||
-- Incomplete pattern match should be fine here because all the possible | ||
-- commands are statically generated by Chainweaver. | ||
let Right sd = commandToSigData cmd |
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.
let let
-- commands are statically generated by Chainweaver. | ||
let Right sd = commandToSigData cmd | ||
let hash = Pact.toUntypedHash $ _sigDataHash sd | ||
_ <- divClass "group" $ do |
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.
single line do (not a big deal)
(Set.toList allPublicKeys <> _deploymentSettingsConfig_extraSigners settings) | ||
code' (HM.union jsonData' deploySettingsJsonData) caps | ||
|
||
-- TODO: are we worried about multiple private keys with the same pubkey key? |
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.
TODO
uiSenderCapabilities m mCaps = do | ||
let keyPairDropdown ev = uiKeyPairDropdown m $ def & dropdownConfig_setValue .~ fmap Just ev | ||
let | ||
-- TODO: With the uiKeyPairDropdown it the user can select an empty item. |
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.
TODO (is it accounted for?)
pb <- getPostBuild | ||
|
||
let deploySettingsJsonData = fromMaybe mempty $ _deploymentSettingsConfig_data settings | ||
jsonData0 = fromMaybe mempty $ hush jData | ||
signingPairs = Map.keys capabilities <> Set.toList signers | ||
publicKeyCapabilities = disregardPrivateKey capabilities | ||
-- TODO: If we have PublicKeys that are not in the keyStore then signingPairs does not contain all the keys in the Paylaod! |
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.
What is the upshot of this TODO?
aed0586
to
9eaae75
Compare
No description provided.