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

CLI deployment of Wst using Blockfrost #44

Merged
merged 24 commits into from
Jan 15, 2025
Merged

CLI deployment of Wst using Blockfrost #44

merged 24 commits into from
Jan 15, 2025

Conversation

amirmrad
Copy link
Collaborator

@amirmrad amirmrad commented Jan 6, 2025

No description provided.

@amirmrad amirmrad changed the base branch from main to j-mueller/issue-35/debug-mode January 6, 2025 13:22
Base automatically changed from j-mueller/issue-35/debug-mode to main January 6, 2025 19:13
@amirmrad amirmrad requested a review from j-mueller January 10, 2025 16:28
@amirmrad amirmrad marked this pull request as ready for review January 10, 2025 16:28
let root = DirectoryScriptRoot txi target
(tx, _) <- Env.withEnv $ Env.withOperator opEnv $ Env.withDirectoryFor root $ Env.withTransferFromOperator
$ Env.balanceTxEnv_
$ BuildTx.mintProtocolParams
Copy link
Collaborator

Choose a reason for hiding this comment

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

This looks nice 👍

@j-mueller
Copy link
Collaborator

The missing ToSchema instance can be added to Wst.Orphans() (should be pretty straightforward as it's just a Text value)

@@ -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 ()
Copy link
Collaborator Author

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
Copy link
Collaborator Author

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
Copy link
Collaborator Author

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))
Copy link
Collaborator Author

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

Copy link
Collaborator

@j-mueller j-mueller left a comment

Choose a reason for hiding this comment

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

LGTM. The generated code needs to be updated

@amirmrad amirmrad merged commit ebd5ea4 into main Jan 15, 2025
3 checks passed
@amirmrad amirmrad deleted the amir/deploy-all branch January 15, 2025 16:06
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.

2 participants