flake: bump plutarch, fix resulting issues
Collection of things fixed: - `agora-test`: Fix compile resulting from some changes to hackage. - `agora-benchmark`: Switched to `plutarch`-style `evalScript`. - CI: Ported over new flake changes. This is quite a mess.
This commit is contained in:
parent
0348f72499
commit
5049441dfc
49 changed files with 3487 additions and 3829 deletions
|
|
@ -21,8 +21,8 @@ module Property.Generator (
|
|||
|
||||
import Control.Applicative (Applicative (liftA2))
|
||||
import Data.ByteString.Char8 qualified as C (ByteString, pack)
|
||||
import Data.ByteString.Hash (sha2)
|
||||
import Plutus.V1.Ledger.Api (
|
||||
import Data.ByteString.Hash (sha2_256)
|
||||
import PlutusLedgerApi.V1 (
|
||||
Address (Address),
|
||||
Credential (..),
|
||||
PubKeyHash (PubKeyHash),
|
||||
|
|
@ -30,7 +30,7 @@ import Plutus.V1.Ledger.Api (
|
|||
Value,
|
||||
toBuiltin,
|
||||
)
|
||||
import Plutus.V1.Ledger.Value (
|
||||
import PlutusLedgerApi.V1.Value (
|
||||
AssetClass (AssetClass),
|
||||
assetClassValue,
|
||||
currencySymbol,
|
||||
|
|
@ -50,7 +50,7 @@ Hashs cannot be shrunken; functions utilizing this function,
|
|||
therefore, cannot be shrunken as well.
|
||||
-}
|
||||
genHashByteString :: Gen C.ByteString
|
||||
genHashByteString = sha2 . C.pack . show <$> (chooseAny :: Gen Integer)
|
||||
genHashByteString = sha2_256 . C.pack . show <$> (chooseAny :: Gen Integer)
|
||||
|
||||
-- TODO: How do I need to ensure uniqueness?
|
||||
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ import Plutarch.Context.Spending (
|
|||
signedWith,
|
||||
spendingContext,
|
||||
)
|
||||
import Plutus.V1.Ledger.Api (
|
||||
import PlutusLedgerApi.V1 (
|
||||
ScriptContext (scriptContextTxInfo),
|
||||
TxInfo (txInfoSignatories),
|
||||
)
|
||||
|
|
|
|||
|
|
@ -24,8 +24,7 @@ import Agora.Proposal (ProposalId (..), ProposalThresholds (..))
|
|||
|
||||
import Data.Tagged (Tagged (..))
|
||||
import Plutarch.Api.V1 (mkValidator, validatorHash)
|
||||
import Plutus.V1.Ledger.Address (scriptHashAddress)
|
||||
import Plutus.V1.Ledger.Api (
|
||||
import PlutusLedgerApi.V1 (
|
||||
Address,
|
||||
Datum (..),
|
||||
ToData (..),
|
||||
|
|
@ -37,9 +36,10 @@ import Plutus.V1.Ledger.Api (
|
|||
Validator,
|
||||
ValidatorHash (..),
|
||||
)
|
||||
import Plutus.V1.Ledger.Api qualified as Interval
|
||||
import Plutus.V1.Ledger.Value (AssetClass, assetClass)
|
||||
import Plutus.V1.Ledger.Value qualified as Value
|
||||
import PlutusLedgerApi.V1 qualified as Interval
|
||||
import PlutusLedgerApi.V1.Address (scriptHashAddress)
|
||||
import PlutusLedgerApi.V1.Value (AssetClass, assetClass)
|
||||
import PlutusLedgerApi.V1.Value qualified as Value
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ module Sample.Effect.TreasuryWithdrawal (
|
|||
) where
|
||||
|
||||
import Plutarch.Api.V1 (mkValidator, validatorHash)
|
||||
import Plutus.V1.Ledger.Api (
|
||||
import PlutusLedgerApi.V1 (
|
||||
Address (Address),
|
||||
Credential (..),
|
||||
CurrencySymbol (CurrencySymbol),
|
||||
|
|
@ -50,11 +50,11 @@ import Plutus.V1.Ledger.Api (
|
|||
Value,
|
||||
toBuiltin,
|
||||
)
|
||||
import Plutus.V1.Ledger.Interval qualified as Interval
|
||||
import Plutus.V1.Ledger.Value qualified as Value
|
||||
import PlutusLedgerApi.V1.Interval qualified as Interval
|
||||
import PlutusLedgerApi.V1.Value qualified as Value
|
||||
|
||||
import Data.ByteString.Char8 qualified as C
|
||||
import Data.ByteString.Hash (sha2)
|
||||
import Data.ByteString.Hash (sha2_256)
|
||||
|
||||
import Agora.Effect.TreasuryWithdrawal (
|
||||
TreasuryWithdrawalDatum (TreasuryWithdrawalDatum),
|
||||
|
|
@ -71,11 +71,11 @@ signer = "8a30896c4fd5e79843e4ca1bd2cdbaa36f8c0bc3be7401214142019c"
|
|||
|
||||
-- | List of users who the effect will pay to.
|
||||
users :: [Credential]
|
||||
users = PubKeyCredential . PubKeyHash . toBuiltin . sha2 . C.pack . show <$> ([1 ..] :: [Integer])
|
||||
users = PubKeyCredential . PubKeyHash . toBuiltin . sha2_256 . C.pack . show <$> ([1 ..] :: [Integer])
|
||||
|
||||
-- | List of users who the effect will pay to.
|
||||
treasuries :: [Credential]
|
||||
treasuries = ScriptCredential . ValidatorHash . toBuiltin . sha2 . C.pack . show <$> ([1 ..] :: [Integer])
|
||||
treasuries = ScriptCredential . ValidatorHash . toBuiltin . sha2_256 . C.pack . show <$> ([1 ..] :: [Integer])
|
||||
|
||||
inputGAT :: TxInInfo
|
||||
inputGAT =
|
||||
|
|
|
|||
|
|
@ -19,10 +19,11 @@ import Plutarch.Api.V1 (mkValidator, validatorHash)
|
|||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
import Plutus.V1.Ledger.Address (scriptHashAddress)
|
||||
import Plutus.V1.Ledger.Api (
|
||||
import PlutusLedgerApi.V1 (
|
||||
Address (..),
|
||||
BuiltinData (BuiltinData),
|
||||
Credential (ScriptCredential),
|
||||
Data (I),
|
||||
Datum (..),
|
||||
ScriptContext (..),
|
||||
ScriptPurpose (Minting, Spending),
|
||||
|
|
@ -35,12 +36,12 @@ import Plutus.V1.Ledger.Api (
|
|||
Validator,
|
||||
ValidatorHash (..),
|
||||
)
|
||||
import Plutus.V1.Ledger.Interval qualified as Interval
|
||||
import Plutus.V1.Ledger.Scripts (unitDatum)
|
||||
import Plutus.V1.Ledger.Value (
|
||||
import PlutusLedgerApi.V1.Address (scriptHashAddress)
|
||||
import PlutusLedgerApi.V1.Interval qualified as Interval
|
||||
import PlutusLedgerApi.V1.Value (
|
||||
AssetClass (..),
|
||||
)
|
||||
import Plutus.V1.Ledger.Value qualified as Value
|
||||
import PlutusLedgerApi.V1.Value qualified as Value
|
||||
import PlutusTx.AssocMap qualified as AssocMap
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
|
@ -92,6 +93,10 @@ import Data.Default.Class (Default (def))
|
|||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
-- | Unit datum
|
||||
unitDatum :: Datum
|
||||
unitDatum = Datum . BuiltinData $ I 0 -- This could be anything, really. It doesn't matter.
|
||||
|
||||
{- | A valid 'ScriptContext' for minting GST.
|
||||
|
||||
- Only the minting policy will be ran in the transaction.
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ import Plutarch.Api.V1 (
|
|||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
import Plutus.V1.Ledger.Api (
|
||||
import PlutusLedgerApi.V1 (
|
||||
Address (Address),
|
||||
Credential (ScriptCredential),
|
||||
Datum (Datum),
|
||||
|
|
@ -46,7 +46,7 @@ import Plutus.V1.Ledger.Api (
|
|||
TxOutRef (TxOutRef),
|
||||
ValidatorHash,
|
||||
)
|
||||
import Plutus.V1.Ledger.Value qualified as Value
|
||||
import PlutusLedgerApi.V1.Value qualified as Value
|
||||
import PlutusTx.AssocMap qualified as AssocMap
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
|
@ -431,9 +431,9 @@ voteOnProposal params =
|
|||
-- | Parameters for state transition of proposals.
|
||||
data TransitionParameters = TransitionParameters
|
||||
{ -- The initial status of the propsoal.
|
||||
initialProposalStatus :: ProposalStatus
|
||||
initialProposalStatus :: ProposalStatus
|
||||
, -- The starting time of the propsoal.
|
||||
proposalStartingTime :: ProposalStartingTime
|
||||
proposalStartingTime :: ProposalStartingTime
|
||||
}
|
||||
|
||||
-- | Create a 'TxInfo' that update the status of a proposal.
|
||||
|
|
|
|||
|
|
@ -92,8 +92,7 @@ import Plutarch.Api.V1 (
|
|||
mkValidator,
|
||||
validatorHash,
|
||||
)
|
||||
import Plutus.V1.Ledger.Address (scriptHashAddress)
|
||||
import Plutus.V1.Ledger.Api (
|
||||
import PlutusLedgerApi.V1 (
|
||||
Address (Address),
|
||||
Credential (ScriptCredential),
|
||||
CurrencySymbol,
|
||||
|
|
@ -107,12 +106,13 @@ import Plutus.V1.Ledger.Api (
|
|||
UpperBound (..),
|
||||
Value,
|
||||
)
|
||||
import Plutus.V1.Ledger.Contexts (
|
||||
import PlutusLedgerApi.V1.Address (scriptHashAddress)
|
||||
import PlutusLedgerApi.V1.Contexts (
|
||||
TxOut (..),
|
||||
)
|
||||
import Plutus.V1.Ledger.Scripts (Validator, ValidatorHash (..))
|
||||
import Plutus.V1.Ledger.Value (AssetClass, TokenName)
|
||||
import Plutus.V1.Ledger.Value qualified as Value
|
||||
import PlutusLedgerApi.V1.Scripts (Validator, ValidatorHash (..))
|
||||
import PlutusLedgerApi.V1.Value (AssetClass, TokenName)
|
||||
import PlutusLedgerApi.V1.Value qualified as Value
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ import Plutarch.Api.V1 (
|
|||
mkValidator,
|
||||
validatorHash,
|
||||
)
|
||||
import Plutus.V1.Ledger.Api (
|
||||
import PlutusLedgerApi.V1 (
|
||||
Address (Address),
|
||||
Credential (ScriptCredential),
|
||||
Datum (Datum),
|
||||
|
|
@ -38,10 +38,10 @@ import Plutus.V1.Ledger.Api (
|
|||
TxOut (txOutAddress, txOutDatumHash, txOutValue),
|
||||
ValidatorHash (ValidatorHash),
|
||||
)
|
||||
import Plutus.V1.Ledger.Contexts (TxOut (TxOut), TxOutRef (TxOutRef))
|
||||
import Plutus.V1.Ledger.Interval qualified as Interval
|
||||
import Plutus.V1.Ledger.Value (TokenName (TokenName))
|
||||
import Plutus.V1.Ledger.Value qualified as Value
|
||||
import PlutusLedgerApi.V1.Contexts (TxOut (TxOut), TxOutRef (TxOutRef))
|
||||
import PlutusLedgerApi.V1.Interval qualified as Interval
|
||||
import PlutusLedgerApi.V1.Value (TokenName (TokenName))
|
||||
import PlutusLedgerApi.V1.Value qualified as Value
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
|
|
|
|||
|
|
@ -18,13 +18,13 @@ module Sample.Treasury (
|
|||
) where
|
||||
|
||||
import Plutarch.Api.V1 (validatorHash)
|
||||
import Plutus.V1.Ledger.Address (Address (..))
|
||||
import Plutus.V1.Ledger.Api (
|
||||
import PlutusLedgerApi.V1 (
|
||||
BuiltinByteString,
|
||||
Credential (PubKeyCredential),
|
||||
PubKeyHash (PubKeyHash),
|
||||
)
|
||||
import Plutus.V1.Ledger.Contexts (
|
||||
import PlutusLedgerApi.V1.Address (Address (..))
|
||||
import PlutusLedgerApi.V1.Contexts (
|
||||
ScriptContext (..),
|
||||
ScriptPurpose (Minting),
|
||||
TxInInfo (..),
|
||||
|
|
@ -32,12 +32,12 @@ import Plutus.V1.Ledger.Contexts (
|
|||
TxOut (..),
|
||||
TxOutRef (..),
|
||||
)
|
||||
import Plutus.V1.Ledger.Credential (Credential (ScriptCredential))
|
||||
import Plutus.V1.Ledger.Interval qualified as Interval
|
||||
import Plutus.V1.Ledger.Scripts (
|
||||
import PlutusLedgerApi.V1.Credential (Credential (ScriptCredential))
|
||||
import PlutusLedgerApi.V1.Interval qualified as Interval
|
||||
import PlutusLedgerApi.V1.Scripts (
|
||||
ValidatorHash (ValidatorHash),
|
||||
)
|
||||
import Plutus.V1.Ledger.Value qualified as Value
|
||||
import PlutusLedgerApi.V1.Value qualified as Value
|
||||
import Sample.Shared (
|
||||
gatCs,
|
||||
gatTn,
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ import Prelude
|
|||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
import Plutus.V1.Ledger.Api (
|
||||
import PlutusLedgerApi.V1 (
|
||||
Address (Address),
|
||||
Credential (PubKeyCredential, ScriptCredential),
|
||||
CurrencySymbol,
|
||||
|
|
@ -29,8 +29,8 @@ import Plutus.V1.Ledger.Api (
|
|||
ValidatorHash (ValidatorHash),
|
||||
Value,
|
||||
)
|
||||
import Plutus.V1.Ledger.Interval qualified as Interval
|
||||
import Plutus.V1.Ledger.Value qualified as Value
|
||||
import PlutusLedgerApi.V1.Interval qualified as Interval
|
||||
import PlutusLedgerApi.V1.Value qualified as Value
|
||||
import PlutusTx.AssocMap qualified as AssocMap
|
||||
import Test.Specification (
|
||||
SpecificationTree,
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import Agora.Governor (GovernorDatum (..), GovernorRedeemer (MutateGovernor))
|
|||
import Agora.Governor.Scripts (governorValidator)
|
||||
import Agora.Proposal (ProposalId (..))
|
||||
import Data.Default.Class (Default (def))
|
||||
import Plutus.V1.Ledger.Api (ScriptContext (ScriptContext), ScriptPurpose (Spending))
|
||||
import PlutusLedgerApi.V1 (ScriptContext (ScriptContext), ScriptPurpose (Spending))
|
||||
import Sample.Effect.GovernorMutation (
|
||||
effectRef,
|
||||
govRef,
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ import Agora.Effect.TreasuryWithdrawal (
|
|||
TreasuryWithdrawalDatum (TreasuryWithdrawalDatum),
|
||||
treasuryWithdrawalValidator,
|
||||
)
|
||||
import Plutus.V1.Ledger.Value qualified as Value
|
||||
import PlutusLedgerApi.V1.Value qualified as Value
|
||||
import Sample.Effect.TreasuryWithdrawal (
|
||||
buildReceiversOutputFromDatum,
|
||||
buildScriptContext,
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ import Agora.Stake (
|
|||
import Agora.Stake.Scripts (stakeValidator)
|
||||
import Data.Default.Class (Default (def))
|
||||
import Data.Tagged (Tagged (Tagged), untag)
|
||||
import Plutus.V1.Ledger.Api (ScriptContext (..), ScriptPurpose (..))
|
||||
import PlutusLedgerApi.V1 (ScriptContext (..), ScriptPurpose (..))
|
||||
import PlutusTx.AssocMap qualified as AssocMap
|
||||
import Sample.Proposal qualified as Proposal
|
||||
import Sample.Shared (signer, signer2)
|
||||
|
|
@ -184,8 +184,8 @@ specs =
|
|||
[
|
||||
( ResultTag 0
|
||||
, case initialState of
|
||||
Draft -> 0
|
||||
_ -> untag (def :: ProposalThresholds).countVoting + 1
|
||||
Draft -> 0
|
||||
_ -> untag (def :: ProposalThresholds).countVoting + 1
|
||||
)
|
||||
, (ResultTag 1, 0)
|
||||
]
|
||||
|
|
@ -231,8 +231,8 @@ specs =
|
|||
[
|
||||
( ResultTag 0
|
||||
, case initialState of
|
||||
Draft -> 0
|
||||
_ -> untag (def :: ProposalThresholds).countVoting + 1
|
||||
Draft -> 0
|
||||
_ -> untag (def :: ProposalThresholds).countVoting + 1
|
||||
)
|
||||
, (ResultTag 1, 0)
|
||||
]
|
||||
|
|
|
|||
|
|
@ -25,18 +25,18 @@ import Agora.Treasury (
|
|||
TreasuryRedeemer (SpendTreasuryGAT),
|
||||
treasuryValidator,
|
||||
)
|
||||
import Plutus.V1.Ledger.Api (
|
||||
import PlutusLedgerApi.V1 (
|
||||
DCert (DCertDelegRegKey),
|
||||
)
|
||||
import Plutus.V1.Ledger.Contexts (
|
||||
import PlutusLedgerApi.V1.Contexts (
|
||||
ScriptContext (scriptContextPurpose, scriptContextTxInfo),
|
||||
ScriptPurpose (Certifying, Rewarding, Spending),
|
||||
TxInfo (txInfoInputs, txInfoMint),
|
||||
)
|
||||
import Plutus.V1.Ledger.Credential (
|
||||
import PlutusLedgerApi.V1.Credential (
|
||||
StakingCredential (StakingHash),
|
||||
)
|
||||
import Plutus.V1.Ledger.Value qualified as Value
|
||||
import PlutusLedgerApi.V1.Value qualified as Value
|
||||
import Sample.Shared (
|
||||
trCredential,
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue