rename AlterTrParams to AlterTreasuryParams
This commit is contained in:
parent
20651235f8
commit
1714a8fe0b
3 changed files with 11 additions and 9 deletions
|
|
@ -55,8 +55,8 @@ The script for an Agora treasury is described in this section. For clarity, all
|
||||||
### Datum
|
### Datum
|
||||||
|
|
||||||
```hs
|
```hs
|
||||||
newtype TreasuryDtum = TreasuryDatum
|
newtype TreasuryDatum = TreasuryDatum
|
||||||
{ -- | Currency symbol of the treasury state thread.
|
{ -- | Currency symbol of the treasury state thread.
|
||||||
stateThread :: CurrencySymbol
|
stateThread :: CurrencySymbol
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
@ -64,16 +64,16 @@ newtype TreasuryDtum = TreasuryDatum
|
||||||
### Redeemers
|
### Redeemers
|
||||||
|
|
||||||
```hs
|
```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
|
### Validators
|
||||||
|
|
||||||
```hs
|
```hs
|
||||||
treasuryV ::
|
treasuryV ::
|
||||||
CurrencySymbol ->
|
CurrencySymbol ->
|
||||||
TreasuryDatum ->
|
TreasuryDatum ->
|
||||||
TreasuryRedeemer ->
|
TreasuryRedeemer ->
|
||||||
ScriptContext ->
|
ScriptContext ->
|
||||||
|
|
|
||||||
2
flake.lock
generated
2
flake.lock
generated
|
|
@ -440,6 +440,8 @@
|
||||||
"hpc-coveralls": "hpc-coveralls",
|
"hpc-coveralls": "hpc-coveralls",
|
||||||
"nix-tools": "nix-tools",
|
"nix-tools": "nix-tools",
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
|
"plutarch",
|
||||||
|
"haskell-nix",
|
||||||
"nixpkgs-2111"
|
"nixpkgs-2111"
|
||||||
],
|
],
|
||||||
"nixpkgs-2003": "nixpkgs-2003",
|
"nixpkgs-2003": "nixpkgs-2003",
|
||||||
|
|
|
||||||
|
|
@ -38,12 +38,12 @@ treasuryV cs tn = plam $ \_d r ctx' -> P.do
|
||||||
-- plet required fields from script context.
|
-- plet required fields from script context.
|
||||||
ctx <- pletFields @["txInfo", "purpose"] ctx'
|
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.
|
-- Ensure that script is for burning i.e. minting a negative amount.
|
||||||
PMinting _ <- pmatch ctx.purpose
|
PMinting _ <- pmatch ctx.purpose
|
||||||
|
|
||||||
|
-- Ensure redeemer type is valid.
|
||||||
|
PAlterTreasuryParams _ <- pmatch $ pfromData r
|
||||||
|
|
||||||
-- Get the minted value from txInfo.
|
-- Get the minted value from txInfo.
|
||||||
txInfo' <- plet ctx.txInfo
|
txInfo' <- plet ctx.txInfo
|
||||||
txInfo <- pletFields @'["mint"] txInfo'
|
txInfo <- pletFields @'["mint"] txInfo'
|
||||||
|
|
@ -84,7 +84,7 @@ newtype PTreasuryDatum (s :: S)
|
||||||
newtype PTreasuryRedeemer (s :: S)
|
newtype PTreasuryRedeemer (s :: S)
|
||||||
= -- | Alters treasury parameters, subject to the burning of a
|
= -- | Alters treasury parameters, subject to the burning of a
|
||||||
-- governance authority token.
|
-- governance authority token.
|
||||||
PAlterTrParams (Term s (PDataRecord '[]))
|
PAlterTreasuryParams (Term s (PDataRecord '[]))
|
||||||
deriving stock (GHC.Generic)
|
deriving stock (GHC.Generic)
|
||||||
deriving anyclass (Generic, PIsDataRepr)
|
deriving anyclass (Generic, PIsDataRepr)
|
||||||
deriving
|
deriving
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue