Skip to content

Commit 8225777

Browse files
committed
Change repo license to MIT, rename cardano-browser-tx -> ctl
1 parent cbaa91b commit 8225777

20 files changed

+44
-50
lines changed

LICENSE

+6-12
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,9 @@
1-
ISC License
1+
MIT License
22

33
Copyright (c) 2022 MLabs Ltd.
44

5-
Permission to use, copy, modify, and/or distribute this software for any
6-
purpose with or without fee is hereby granted, provided that the above
7-
copyright notice and this permission notice appear in all copies.
8-
9-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
10-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
11-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
12-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
13-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
14-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
15-
PERFORMANCE OF THIS SOFTWARE.
5+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6+
7+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8+
9+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ run-testnet-ogmios:
2626
--node-config "$$CARDANO_NODE_CONFIG"
2727

2828
run-haskell-server:
29-
nix run -L .#cardano-browser-tx-server:exe:cardano-browser-tx-server
29+
nix run -L .#cardano-trasaction-lib-server:exe:cardano-trasaction-lib-server
3030

3131
run-datum-cache-postgres:
3232
docker run -d --rm \

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
# Cardano Browser Tx
1+
# Cardano Transaction Lib
22
[![Hercules-ci][Herc badge]][Herc link]
33
[![Cachix Cache][Cachix badge]][Cachix link]
44

55
[Herc badge]: https://img.shields.io/badge/ci--by--hercules-green.svg
6-
[Herc link]: https://hercules-ci.com/github/Plutonomicon/cardano-browser-tx
6+
[Herc link]: https://hercules-ci.com/github/Plutonomicon/cardano-transaction-lib
77
[Cachix badge]: https://img.shields.io/badge/cachix-public_plutonomicon-blue.svg
88
[Cachix link]: https://public-plutonomicon.cachix.org
99

flake.nix

+1-1
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@
185185
apps = perSystem (system: {
186186
inherit
187187
(self.hsFlake.${system}.apps)
188-
"cardano-browser-tx-server:exe:cardano-browser-tx-server";
188+
"cardano-trasaction-lib-server:exe:cardano-trasaction-lib-server";
189189
});
190190

191191
defaultPackage = perSystem (system: (psProjectFor system).defaultPackage);

nix/default.nix

+5-5
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@ let
3333
(modules { }).shell.nodeDependencies;
3434
in
3535
{
36-
defaultPackage = self.packages.${system}.cardano-browser-tx;
36+
defaultPackage = self.packages.${system}.cardano-transaction-lib;
3737

3838
packages = {
39-
cardano-browser-tx = ps-lib.buildPursProject {
40-
name = "cardano-browser-tx";
39+
cardano-transaction-lib = ps-lib.buildPursProject {
40+
name = "cardano-transaction-lib";
4141
inherit src;
4242
};
4343
};
@@ -46,8 +46,8 @@ in
4646
# Since we depend on two haskell.nix projects, `nix flake check`
4747
# is currently broken because of IFD issues
4848
checks = {
49-
cardano-browser-tx = ps-lib.runPursTest {
50-
name = "cardano-browser-tx";
49+
cardano-transaction-lib = ps-lib.runPursTest {
50+
name = "cardano-transaction-lib";
5151
subdir = builtins.toString src;
5252
inherit src;
5353
};

server/README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# cardano-browser-tx-server
1+
# cardano-trasaction-lib-server
22

3-
This is a small Haskell project to provide services to the `cardano-browser-tx` frontend that cannot be achieved using Purescript
3+
This is a small Haskell project to provide services to the `cardano-transaction-lib` frontend that cannot be achieved using Purescript
44

55
## Goals
66

@@ -14,7 +14,7 @@ We plan on supporting at least the following features:
1414

1515
Run `nix develop .#hsDevShell` (or equivalently `nix develop .#package.x86_64-{linux|darwin}`; NB: not currently tested on macOS) in the repository root (i.e. up one level from `server`). This will place you in a development shell with `cabal`, `hoogle`, `haskell-language-server`, etc...
1616

17-
The server executable can be built with `nix build .#cardano-browser-tx-server:exe:cardano-browser-tx-server` and run with `./result/bin/cardano-browser-tx-server`. `cabal` can also be used once in the development shell. The server will run on port 8081. You can optionally pass the `--port`/`-p` flag to explicitly choose a port to run on
17+
The server executable can be built with `nix build .#cardano-trasaction-lib-server:exe:cardano-trasaction-lib-server` and run with `./result/bin/cardano-trasaction-lib-server`. `cabal` can also be used once in the development shell. The server will run on port 8081. You can optionally pass the `--port`/`-p` flag to explicitly choose a port to run on
1818

1919
---
2020

server/cardano-browser-tx-server.cabal

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
cabal-version: 2.4
2-
name: cardano-browser-tx-server
2+
name: cardano-trasaction-lib-server
33
version: 0.1.0.0
44
author: mlabs
55
build-type: Simple
@@ -76,11 +76,11 @@ library
7676
exposed-modules:
7777
Api
7878
Api.Handlers
79-
Paths_cardano_browser_tx_server
79+
Paths_cardano_transaction_lib_server
8080
Types
8181
Utils
8282

83-
executable cardano-browser-tx-server
83+
executable cardano-trasaction-lib-server
8484
import: common-language
8585
import: common-options
8686
ghc-options: -threaded -rtsopts
@@ -89,7 +89,7 @@ executable cardano-browser-tx-server
8989
main-is: Main.hs
9090
build-depends:
9191
, base
92-
, cardano-browser-tx-server
92+
, cardano-trasaction-lib-server
9393
, http-types
9494
, optparse-applicative
9595
, wai
@@ -106,7 +106,7 @@ test-suite test
106106
build-depends:
107107
, base
108108
, bytestring
109-
, cardano-browser-tx-server
109+
, cardano-trasaction-lib-server
110110
, hspec
111111
, hspec-core
112112
, http-client

server/nix/default.nix

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
pkgs.haskell-nix.cabalProject {
1010
inherit src;
1111

12-
name = "cardano-browser-tx-server";
12+
name = "cardano-trasaction-lib-server";
1313

1414
compiler-nix-name = "ghc8107";
1515

server/src/Types.hs

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ import Data.Text qualified as Text
4949
import Data.Text.Encoding qualified as Text.Encoding
5050
import GHC.Generics (Generic)
5151
import Network.Wai.Handler.Warp (Port)
52-
import Paths_cardano_browser_tx_server (getDataFileName)
52+
import Paths_cardano_transaction_lib_server (getDataFileName)
5353
import Plutus.V1.Ledger.Api qualified as Ledger
5454
import Plutus.V1.Ledger.Scripts qualified as Ledger.Scripts
5555
import Servant (FromHttpApiData, QueryParam', Required, ToHttpApiData)

server/test/Main.hs

+2-2
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ applyArgsSpec = around withTestApp $ do
7272
result `shouldBe` Right (AppliedScript unappliedScriptFixture)
7373

7474
-- FIXME
75-
-- See: https://github.com/Plutonomicon/cardano-browser-tx/issues/189
75+
-- See: https://github.com/Plutonomicon/cardano-transaction-lib/issues/189
7676
--
7777
-- This is returning a different applied script than the test fixtures. The
7878
-- fixtures were obtained with Plutus using `applyCode` (not `applyArguments`
@@ -101,7 +101,7 @@ feeEstimateSpec = around withTestApp $ do
101101
runClientM' (clientEnv port) $
102102
estimateTxFees (WitnessCount 1) cborTxFixture
103103
-- This is probably incorrect. See:
104-
-- https://github.com/Plutonomicon/cardano-browser-tx/issues/123
104+
-- https://github.com/Plutonomicon/cardano-transaction-lib/issues/123
105105
result `shouldBe` Right (Fee 168449)
106106

107107
it "catches invalid hex strings" $ \port -> do

src/Contract/Transaction.purs

+2-2
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ import ReindexRedeemers (reindexSpentScriptRedeemers) as ReindexRedeemers
5151
import ReindexRedeemers
5252
( ReindexErrors(CannotGetTxOutRefIndexForRedeemer)
5353
) as ReindexRedeemersExport
54-
import TxOutput -- Could potentially trim this down, -- FIX ME: https://github.com/Plutonomicon/cardano-browser-tx/issues/200
54+
import TxOutput -- Could potentially trim this down, -- FIX ME: https://github.com/Plutonomicon/cardano-transaction-lib/issues/200
5555
( ogmiosTxOutToScriptOutput
5656
, ogmiosTxOutToTransactionOutput
5757
, scriptOutputToOgmiosTxOut
@@ -63,7 +63,7 @@ import TxOutput -- Could potentially trim this down, -- FIX ME: https://github.c
6363
) as TxOutput
6464
import Types.ByteArray (ByteArray)
6565
import Types.Datum (Datum)
66-
import Types.JsonWsp (OgmiosTxOut, OgmiosTxOutRef) as JsonWsp -- FIX ME: https://github.com/Plutonomicon/cardano-browser-tx/issues/200
66+
import Types.JsonWsp (OgmiosTxOut, OgmiosTxOutRef) as JsonWsp -- FIX ME: https://github.com/Plutonomicon/cardano-transaction-lib/issues/200
6767
import Types.ScriptLookups (UnattachedUnbalancedTx(UnattachedUnbalancedTx))
6868
import Types.ScriptLookups
6969
( MkUnbalancedTxError(..) -- A lot errors so will refrain from explicit names.

src/QueryM.purs

+1-1
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,7 @@ calculateMinFee tx@(Transaction { body: Transaction.TxBody body }) = do
452452
-- FIXME
453453
-- Add some "padding" to the fees so the transaction will submit
454454
-- The server is calculating fees that are too low
455-
-- See https://github.com/Plutonomicon/cardano-browser-tx/issues/123
455+
-- See https://github.com/Plutonomicon/cardano-transaction-lib/issues/123
456456
coinFromEstimate :: FeeEstimate -> Coin
457457
coinFromEstimate = Coin <<< ((+) (BigInt.fromInt 500000)) <<< unwrap
458458

src/Serialization/Address.purs

+1-1
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ instance Eq Address where
191191
instance Ord Address where
192192
compare = compare `on` addressBytes
193193

194-
-- FIX ME: https://github.com/Plutonomicon/cardano-browser-tx/issues/193
194+
-- FIX ME: https://github.com/Plutonomicon/cardano-transaction-lib/issues/193
195195
-- Plutus uses `PlutusTx.makeIsDataIndexed ''Address [('Address,0)]` on their
196196
-- record, I'm not sure if this will become an issue given our foreign
197197
-- representation.

src/TxOutput.purs

+2-2
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ transactionInputToTxOutRef
5757

5858
-- https://ogmios.dev/ogmios.wsp.json see "datum", potential FIX ME: it says
5959
-- base64 but the example provided looks like a hexadecimal so use
60-
-- hexToByteArray for now. https://github.com/Plutonomicon/cardano-browser-tx/issues/78
60+
-- hexToByteArray for now. https://github.com/Plutonomicon/cardano-transaction-lib/issues/78
6161
-- | Converts an Ogmios transaction output to (internal) `TransactionOutput`
6262
ogmiosTxOutToTransactionOutput
6363
:: JsonWsp.OgmiosTxOut -> Maybe Transaction.TransactionOutput
@@ -155,4 +155,4 @@ utxoIndexToUtxo
155155
:: NetworkId
156156
-> Map Transaction.TransactionInput UTx.ScriptOutput
157157
-> Transaction.Utxo
158-
utxoIndexToUtxo networkId = map (scriptOutputToTransactionOutput networkId)
158+
utxoIndexToUtxo networkId = map (scriptOutputToTransactionOutput networkId)

src/Types/Interval.purs

+1-1
Original file line numberDiff line numberDiff line change
@@ -459,6 +459,6 @@ posixTimeToEnclosingSlot (SlotConfig { slotLength, slotZeroTime }) (POSIXTime t)
459459
in
460460
Slot <$> bigIntToUInt slotsPassed
461461

462-
-- TO DO: https://github.com/Plutonomicon/cardano-browser-tx/issues/169
462+
-- TO DO: https://github.com/Plutonomicon/cardano-transaction-lib/issues/169
463463
-- -- | Get the current slot number
464464
-- currentSlot :: SlotConfig -> Effect Slot

src/Types/ScriptLookups.purs

+4-4
Original file line numberDiff line numberDiff line change
@@ -260,14 +260,14 @@ typedValidatorLookupsM
260260
:: forall (a :: Type). TypedValidator a -> Maybe (ScriptLookups a)
261261
typedValidatorLookupsM = pure <<< typedValidatorLookups
262262

263-
-- FIX ME: https://github.com/Plutonomicon/cardano-browser-tx/issues/200
263+
-- FIX ME: https://github.com/Plutonomicon/cardano-transaction-lib/issues/200
264264
-- | A script lookups value that uses the map of unspent outputs to resolve
265265
-- | input constraints.
266266
unspentOutputs
267267
:: forall (a :: Type). Map TxOutRef TransactionOutput -> ScriptLookups a
268268
unspentOutputs mp = over ScriptLookups _ { txOutputs = mp } mempty
269269

270-
-- FIX ME: https://github.com/Plutonomicon/cardano-browser-tx/issues/200
270+
-- FIX ME: https://github.com/Plutonomicon/cardano-transaction-lib/issues/200
271271
-- | Same as `unspentOutputs` but in `Maybe` context for convenience. This
272272
-- | should not fail.
273273
unspentOutputsM
@@ -459,7 +459,7 @@ type ConstraintsM (a :: Type) (b :: Type) =
459459
-- use the type alias because they need to be fully applied so this is perhaps
460460
-- more readable.
461461
-- Fix me: add execution units from Ogmios where this function should be
462-
-- inside QueryM https://github.com/Plutonomicon/cardano-browser-tx/issues/174
462+
-- inside QueryM https://github.com/Plutonomicon/cardano-transaction-lib/issues/174
463463
-- | Resolve some `TxConstraints` by modifying the `UnbalancedTx` in the
464464
-- | `ConstraintProcessingState`
465465
processLookupsAndConstraints
@@ -1010,7 +1010,7 @@ processConstraint mpsMap osMap = do
10101010
where
10111011
-- The follow hardcoded before calling Ogmios to calculate execution
10121012
-- unit. Calling Ogmios is an outstanding issue:
1013-
-- https://github.com/Plutonomicon/cardano-browser-tx/issues/174
1013+
-- https://github.com/Plutonomicon/cardano-transaction-lib/issues/174
10141014
scriptExUnits :: ExUnits
10151015
scriptExUnits = { mem: fromInt 2000000, steps: fromInt 1000000000 }
10161016

src/Types/TxConstraints.purs

+1-1
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ mustBeSignedBy = singleton <<< MustBeSignedBy
178178
mustIncludeDatum :: forall (i :: Type) (o :: Type). Datum -> TxConstraints i o
179179
mustIncludeDatum = singleton <<< MustIncludeDatum
180180

181-
-- FIX ME: https://github.com/Plutonomicon/cardano-browser-tx/issues/200
181+
-- FIX ME: https://github.com/Plutonomicon/cardano-transaction-lib/issues/200
182182
-- | Lock the value to the script currently being validated
183183
mustPayToTheScript
184184
:: forall (i :: Type) (o :: Type)

src/Types/TypedValidator.purs

+2-2
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ forwardingMintingPolicy = _.forwardingMPS <<< unwrap
144144

145145
-- We have a few functions, I'm not sure if we even need these for off chain
146146
-- code:
147-
-- -- Broken, see below (we need some notion of `applyCode`) https://github.com/Plutonomicon/cardano-browser-tx/issues/24
147+
-- -- Broken, see below (we need some notion of `applyCode`) https://github.com/Plutonomicon/cardano-transaction-lib/issues/24
148148
-- -- | Make a `TypedValidator` (with no type constraints) from an untyped
149149
-- -- |`Validator` script.
150150
-- unsafeMkTypedValidator :: Scripts.Validator -> Maybe (TypedValidator Any)
@@ -163,4 +163,4 @@ forwardingMintingPolicy = _.forwardingMPS <<< unwrap
163163
-- -- mkTypedValidatorParam requires some notion
164164
-- -- of compiled code and `applyCode` also
165165
-- mkForwardingMintingPolicy :: ValidatorHash -> MintingPolicy
166-
-- mkForwardingMintingPolicy = undefined
166+
-- mkForwardingMintingPolicy = undefined

src/Types/Value.purs

+2-2
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@ instance Split Value where
387387
bimap (flip Value mempty) (flip Value mempty) (split coin)
388388
<> bimap (Value mempty) (Value mempty) (split nonAdaAsset)
389389

390-
-- FIX ME: https://github.com/Plutonomicon/cardano-browser-tx/issues/193
390+
-- FIX ME: https://github.com/Plutonomicon/cardano-transaction-lib/issues/193
391391
-- Because our `Value` is different to Plutus, I wonder if this will become an
392392
-- issue.
393393
instance FromData Value where
@@ -477,7 +477,7 @@ unionNonAda (NonAdaAsset l) (NonAdaAsset r) =
477477
in
478478
unBoth <$> combined
479479

480-
-- Don't export to `Contract` due to https://github.com/Plutonomicon/cardano-browser-tx/issues/193
480+
-- Don't export to `Contract` due to https://github.com/Plutonomicon/cardano-transaction-lib/issues/193
481481
-- | Same as `unionWith` but specifically for `NonAdaAsset`
482482
unionWithNonAda
483483
:: (BigInt -> BigInt -> BigInt)

webpack.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ module.exports = {
106106
debug: true,
107107
}),
108108
new HtmlWebpackPlugin({
109-
title: "cardano-browser-tx-examples",
109+
title: "cardano-transaction-lib-examples",
110110
template: "./examples/index.html",
111111
inject: false, // See stackoverflow.com/a/38292765/3067181
112112
}),

0 commit comments

Comments
 (0)