add make ps_bridge subcommand

This commit is contained in:
fanghr 2022-05-13 20:13:18 +08:00
parent 8c5f10279e
commit c4ee24461e
4 changed files with 12 additions and 5 deletions

View file

@ -1,7 +1,7 @@
# This really ought to be `/usr/bin/env bash`, but nix flakes don't like that. # This really ought to be `/usr/bin/env bash`, but nix flakes don't like that.
SHELL := /bin/sh SHELL := /bin/sh
.PHONY: hoogle format haddock usage tag lint .PHONY: hoogle format haddock usage tag lint ps_bridge
usage: usage:
@echo "usage: make <command> [OPTIONS]" @echo "usage: make <command> [OPTIONS]"
@ -12,6 +12,7 @@ usage:
@echo " haddock -- Generate Haddock docs for project" @echo " haddock -- Generate Haddock docs for project"
@echo " tag -- Generate CTAGS and ETAGS files for project" @echo " tag -- Generate CTAGS and ETAGS files for project"
@echo " lint -- Get hlint suggestions for project" @echo " lint -- Get hlint suggestions for project"
@echo " ps_bridge -- Generate purescript bridge files"
hoogle: hoogle:
pkill hoogle || true pkill hoogle || true
@ -43,3 +44,7 @@ tag:
lint: lint:
hlint agora agora-bench agora-test hlint agora agora-bench agora-test
PS_BRIDGE_OUTPUT_DIR := agora-purescript-bridge/
ps_bridge:
cabal run exe:agora-purescript-bridge -- -o $(PS_BRIDGE_OUTPUT_DIR)

View file

@ -46,6 +46,6 @@ parseOptions = Opt.execParser p
srcFilePath :: FilePath -> FilePath srcFilePath :: FilePath -> FilePath
srcFilePath path = fromRelDir $ srcFilePath path = fromRelDir $
fromJust $ do fromJust $ do
dir <- parseRelDir $ path dir <- parseRelDir path
srcSubDir <- parseRelDir "src" srcSubDir <- parseRelDir "src"
return $ dir </> srcSubDir return $ dir </> srcSubDir

View file

@ -24,10 +24,10 @@ import Plutarch.Api.V1 (
PTxOut (..), PTxOut (..),
) )
import Plutarch.Api.V1.AssocMap (PMap (PMap)) import Plutarch.Api.V1.AssocMap (PMap (PMap))
import Plutarch.Api.V1.Extra (passetClass, passetClassValueOf)
import Plutarch.Api.V1.Value (PValue (PValue)) import Plutarch.Api.V1.Value (PValue (PValue))
import Plutarch.Builtin (pforgetData) import Plutarch.Builtin (pforgetData)
import Plutus.V1.Ledger.Value (AssetClass (AssetClass)) import Plutus.V1.Ledger.Value (AssetClass (AssetClass))
import Plutarch.Api.V1.Extra (passetClass, passetClassValueOf)
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
@ -55,7 +55,8 @@ import Agora.Utils (
newtype AuthorityToken = AuthorityToken newtype AuthorityToken = AuthorityToken
{ authority :: AssetClass { authority :: AssetClass
-- ^ Token that must move in order for minting this to be valid. -- ^ Token that must move in order for minting this to be valid.
} deriving stock (GHC.Generic) }
deriving stock (GHC.Generic)
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------

View file

@ -81,7 +81,8 @@ data Stake = Stake
{ gtClassRef :: Tagged GTTag AssetClass { gtClassRef :: Tagged GTTag AssetClass
-- ^ Used when inlining the AssetClass of a 'PDiscrete' in the script code. -- ^ Used when inlining the AssetClass of a 'PDiscrete' in the script code.
, proposalSTClass :: AssetClass , proposalSTClass :: AssetClass
} deriving stock (GHC.Generic) }
deriving stock (GHC.Generic)
{- | A lock placed on a Stake datum in order to prevent {- | A lock placed on a Stake datum in order to prevent
depositing and withdrawing when votes are in place. depositing and withdrawing when votes are in place.