-
Notifications
You must be signed in to change notification settings - Fork 2
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
CLI deployment of Wst using Blockfrost #44
base: main
Are you sure you want to change the base?
Conversation
e01b4ca
to
88b78c6
Compare
@@ -250,41 +264,31 @@ registerAlwaysSucceedsStakingCert = failOnError $ do | |||
BuildTx.addConwayStakeCredentialRegistrationCertificate cred (pp ^. Ledger.ppKeyDepositL) | |||
void (tryBalanceAndSubmit mempty Wallet.w1 txBody TrailingChange []) | |||
|
|||
-- TODO: registration to be moved to the endpoints |
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.
Will it fail if we attempt to register a 2nd time?
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.
I believe so. Should we handle it?
src/test/unit/Wst/Test/UnitTest.hs
Outdated
txBody <- BuildTx.execBuildTxT $ do | ||
BuildTx.addStakeScriptWitness credMinting transferMintingScript () | ||
BuildTx.addConwayStakeCredentialRegistrationCertificate credMinting (pp ^. Ledger.ppKeyDepositL) | ||
-- pp <- fmap C.unLedgerProtocolParameters queryProtocolParameters |
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.
Commented out code
let root = DirectoryScriptRoot txi target | ||
(tx, _) <- Env.withEnv $ Env.withOperator opEnv $ Env.withDirectoryFor root $ Env.withTransferFromOperator | ||
$ Env.balanceTxEnv_ | ||
$ BuildTx.mintProtocolParams |
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.
This looks nice 👍
@@ -0,0 +1 @@ | |||
|
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.
empty file?
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.
Oops!
blacklistMintingScript :: ScriptTarget -> C.Hash C.PaymentKey -> C.PlutusScript C.PlutusScriptV3 | ||
blacklistMintingScript target cred = | ||
let script = Scripts.tryCompile target $ mkPermissionedMinting # pdata (pconstant $ transPubKeyHash cred) | ||
let script = Scripts.tryCompile target $ mkPermissionedMinting # pforgetData (pdata (pconstant "blacklist minting" :: ClosedTerm PByteString)) # pdata (pconstant $ transPubKeyHash cred) |
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's the different between "permissioned" minting / spending and "blacklist" minting / spending? If it's just nominal, why do we need both?
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.
No difference really, just though I'd nonce them differently to avoid confusions as it took me a while to debug as there were spending scripts, minting policies and stake scripts that had the same hash.
The missing ToSchema instance can be added to |
320b7ec
to
796332c
Compare
@@ -131,6 +135,13 @@ insertBlacklistNode cred blacklistNodes = Utils.inBabbage @era $ do | |||
opPkh <- asks (fst . Env.bteOperator . Env.operatorEnv) | |||
addRequiredSignature opPkh | |||
|
|||
spendBlacklistOutput :: forall era env m. (MonadReader env m, Env.HasOperatorEnv era env, Env.HasTransferLogicEnv env, C.IsBabbageBasedEra era, C.HasScriptLanguageInEra C.PlutusScriptV3 era, MonadBuildTx era m) => C.TxIn -> m () |
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.
This is currently unused in the endpoints. I only needed it to remove a duplicate blacklist node I accidentally pushed on preview. We could later cleanup the interface and add an endpoint if need be.
addConwayStakeCredentialCertificate credMinting | ||
addConwayStakeCredentialCertificate credSpending | ||
addConwayStakeCredentialCertificate credSeizeSpending |
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.
Registration step for transfer script was missing issuer spend (seize) stake script
@@ -216,7 +216,17 @@ seizeCredentialAssetsTx :: forall era env m. | |||
seizeCredentialAssetsTx sanctionedCred = do | |||
opPkh <- asks (fst . Env.bteOperator . Env.operatorEnv) | |||
directory <- Query.registryNodes @era | |||
seizeTxo <- head <$> Query.userProgrammableOutputs sanctionedCred | |||
let getTxOutValue (C.TxOut _a v _d _r) = v |
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.
Just selects the UTxO with the largest non ada asset quantities ignoring the asset names.
To seize all utxos the endpoints must be repeatedly called until NoTokensToSeize
is returned.
@@ -130,7 +131,8 @@ queryBlacklistedNodes _ (SerialiseAddress addr) = do | |||
. P.fromBuiltin | |||
. blnKey | |||
. uDatum | |||
Env.withEnv $ Env.withTransfer transferLogic (fmap (fmap getHash) (Query.blacklistNodes @era)) | |||
nonHeadNodes (P.fromBuiltin . blnKey . uDatum -> hsh) = hsh /= "" | |||
Env.withEnv $ Env.withTransfer transferLogic (fmap getHash . filter nonHeadNodes <$> (Query.blacklistNodes @era)) |
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.
Desezialization would fail in the case of the head node with an empty payment credential
No description provided.