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

Support for addresses with staking keys and wallet lookups. #136

Merged
merged 40 commits into from
Oct 17, 2022

Conversation

zmrocze
Copy link
Contributor

@zmrocze zmrocze commented Sep 25, 2022

This is the current "Staking keys support" pr for plutip. related Issues: #103 #104

  • Add stake keys to BpiWallet.
  • Generate stake keys in addWallets
  • Set pcOwnStakePubKeyHash for BPI.
  • Pass WalletLookups to contracts instead of list of PubKeyHash's.
  • wallets initialized with WalletTag which specifies a) how wallet is generated b) how wallet is accessed in test case

Contains changes introducing staking keys support, but together with changes to the wallet initialization and to the interface of providing user with keys in the contract.

It aims to provide lookups like so:

assertExecution
  "Values asserted in correct order with withContract"
  (initAda (EnterpriseTag "w0") [100]
    <> initAda (BaseTag "w1") [200]
  )
  (withContract $ \wl -> do
    EnterpriseInfo w1pkh <- lookupWallet wl (EnterpriseTag "w0")
    BaseInfo w2pkh <- lookupWallet wl (BaseTag "w1")
    _ <- payTo w1pkh (toInteger payTo1Amt)
    _ <- waitNSlots 2
    payTo w2pkh (toInteger payTo2Amt))
  [shouldSucceed]

EDIT: nevermind

@zmrocze zmrocze force-pushed the karol/staking-keys-using-lookups branch from 9b33876 to 874340c Compare September 26, 2022 17:32
@@ -146,6 +148,8 @@ runContractWithLogLvl logLvl cEnv bpiWallet contract = do
, pcCollateralSize = fromInteger defCollateralSize
}

walletInfo = makeWalletInfo bpiWallet
Copy link
Contributor Author

@zmrocze zmrocze Sep 26, 2022

Choose a reason for hiding this comment

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

For this wallet WalletInfo is calculated twice from BpiWallet (second time in withContractAs). makeWalletInfo basically calculates pubkey hashes. runContract can be fed WalletInfo instead of BpiWallet, calculating one hash less, no problem. I only put it like that, to change less in interactive-plutip docs. Unsure..

@zmrocze zmrocze changed the title Staking keys using lookups [WIP]. Staking keys using lookups. Sep 26, 2022
@zmrocze zmrocze changed the title Staking keys using lookups. Support for addresses with staking keys and wallet lookups. Sep 26, 2022
@zmrocze zmrocze requested review from mikekeke and szg251 September 26, 2022 18:41
@zmrocze
Copy link
Contributor Author

zmrocze commented Sep 28, 2022

I removed substituteTags from withConfiguredCluster. Before it basically acted as identity, only adding the type info and making things compile, now can get rid of.
edit: A and removed comment "This test doesn't fail because negative amount". I dont get this comment now, I think i've been seeing ghosts haha

@zmrocze
Copy link
Contributor Author

zmrocze commented Sep 30, 2022

will note here, as probably won't be able to work on this, that this change enables #121 with no more api changes. Simmilarly extra-signing-keys could be initialized in TestWallets (tho no need to remove them from config as second option).

- hiding some internals
- renamings
- removing `TestWallet` from cluster's eDSL
- some renamings
- support for switching address type
- adding plutip-server to hie.yaml
@mikekeke mikekeke changed the base branch from master to staging October 17, 2022 07:24
@mikekeke mikekeke merged commit c3502d0 into staging Oct 17, 2022
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