rename AlterTrParams to AlterTreasuryParams

This commit is contained in:
Emily Martins 2022-03-04 17:16:16 +01:00
parent 657031508e
commit 16211998f6
3 changed files with 11 additions and 9 deletions

View file

@ -55,8 +55,8 @@ The script for an Agora treasury is described in this section. For clarity, all
### Datum
```hs
newtype TreasuryDtum = TreasuryDatum
{ -- | Currency symbol of the treasury state thread.
newtype TreasuryDatum = TreasuryDatum
{ -- | Currency symbol of the treasury state thread.
stateThread :: CurrencySymbol
}
```
@ -64,16 +64,16 @@ newtype TreasuryDtum = TreasuryDatum
### Redeemers
```hs
newtype TreasuryRedeemer = AlterTrParams
newtype TreasuryRedeemer = AlterTreasuryParams
```
At the current stage, it is sufficient to allow users to simply grant funds to the treasury, without an explicit redeemer. The only redeemer that is required is `AlterTrParams`, for when the treasury's parameters are subject to change by a proposal effect.
At the current stage, it is sufficient to allow users to simply grant funds to the treasury, without an explicit redeemer. The only redeemer that is required is `AlterTreasuryParams`, for when the treasury's parameters are subject to change by a proposal effect.
### Validators
```hs
treasuryV ::
CurrencySymbol ->
CurrencySymbol ->
TreasuryDatum ->
TreasuryRedeemer ->
ScriptContext ->

2
flake.lock generated
View file

@ -440,6 +440,8 @@
"hpc-coveralls": "hpc-coveralls",
"nix-tools": "nix-tools",
"nixpkgs": [
"plutarch",
"haskell-nix",
"nixpkgs-2111"
],
"nixpkgs-2003": "nixpkgs-2003",

View file

@ -38,12 +38,12 @@ treasuryV cs tn = plam $ \_d r ctx' -> P.do
-- plet required fields from script context.
ctx <- pletFields @["txInfo", "purpose"] ctx'
-- Ensure redeemer type is valid.
PAlterTrParams _ <- pmatch $ pfromData r
-- Ensure that script is for burning i.e. minting a negative amount.
PMinting _ <- pmatch ctx.purpose
-- Ensure redeemer type is valid.
PAlterTreasuryParams _ <- pmatch $ pfromData r
-- Get the minted value from txInfo.
txInfo' <- plet ctx.txInfo
txInfo <- pletFields @'["mint"] txInfo'
@ -84,7 +84,7 @@ newtype PTreasuryDatum (s :: S)
newtype PTreasuryRedeemer (s :: S)
= -- | Alters treasury parameters, subject to the burning of a
-- governance authority token.
PAlterTrParams (Term s (PDataRecord '[]))
PAlterTreasuryParams (Term s (PDataRecord '[]))
deriving stock (GHC.Generic)
deriving anyclass (Generic, PIsDataRepr)
deriving