add signer assertion to Stake validator
This commit is contained in:
parent
01ce1c2cec
commit
fa9bf56f4a
1 changed files with 5 additions and 0 deletions
|
|
@ -215,6 +215,7 @@ stakeValidator stake =
|
||||||
PJust txInInfo <- pmatch $ pfindTxInByTxOutRef # (pfield @"_0" # txOutRef) # txInfo'
|
PJust txInInfo <- pmatch $ pfindTxInByTxOutRef # (pfield @"_0" # txOutRef) # txInfo'
|
||||||
ownAddress <- plet $ pfield @"address" #$ pfield @"resolved" # txInInfo
|
ownAddress <- plet $ pfield @"address" #$ pfield @"resolved" # txInInfo
|
||||||
let continuingValue = pfield @"value" #$ pfield @"resolved" # txInInfo
|
let continuingValue = pfield @"value" #$ pfield @"resolved" # txInInfo
|
||||||
|
ownerSignsTransaction <- plet $ ptxSignedBy # ctx.txInfo # stakeDatum.owner
|
||||||
stCurrencySymbol <- plet $ pconstant $ mintingPolicySymbol $ mkMintingPolicy (stakePolicy stake)
|
stCurrencySymbol <- plet $ pconstant $ mintingPolicySymbol $ mkMintingPolicy (stakePolicy stake)
|
||||||
mintedST <- plet $ psymbolValueOf # stCurrencySymbol # txInfo.mint
|
mintedST <- plet $ psymbolValueOf # stCurrencySymbol # txInfo.mint
|
||||||
spentST <- plet $ psymbolValueOf # stCurrencySymbol #$ pvalueSpent # txInfo'
|
spentST <- plet $ psymbolValueOf # stCurrencySymbol #$ pvalueSpent # txInfo'
|
||||||
|
|
@ -227,12 +228,16 @@ stakeValidator stake =
|
||||||
mintedST #== -1
|
mintedST #== -1
|
||||||
passert "Stake unlocked" $
|
passert "Stake unlocked" $
|
||||||
pnot #$ stakeLocked # stakeDatum'
|
pnot #$ stakeLocked # stakeDatum'
|
||||||
|
passert "Owner signs this transaction" $
|
||||||
|
ownerSignsTransaction
|
||||||
popaque (pconstant ())
|
popaque (pconstant ())
|
||||||
PDepositWithdraw r -> P.do
|
PDepositWithdraw r -> P.do
|
||||||
passert "ST at inputs must be 1" $
|
passert "ST at inputs must be 1" $
|
||||||
spentST #== 1
|
spentST #== 1
|
||||||
passert "Stake unlocked" $
|
passert "Stake unlocked" $
|
||||||
pnot #$ stakeLocked # stakeDatum'
|
pnot #$ stakeLocked # stakeDatum'
|
||||||
|
passert "Owner signs this transaction" $
|
||||||
|
ownerSignsTransaction
|
||||||
passert "A UTXO must exist with the correct output" $
|
passert "A UTXO must exist with the correct output" $
|
||||||
anyOutput @(PStakeDatum gt) # txInfo'
|
anyOutput @(PStakeDatum gt) # txInfo'
|
||||||
#$ plam
|
#$ plam
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue