Skip to content

Commit cd80e31

Browse files
authored
Merge pull request #1674 from Plutonomicon/dshuiski/remove-nami
Remove discontinued Nami and Flint wallets
2 parents 7f66b8e + a2d154b commit cd80e31

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+389
-406
lines changed

CHANGELOG.md

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
99

1010
- [[Unreleased]](#unreleased)
1111
- [Changed](#changed)
12+
- [Removed](#removed)
1213
- [Fixed](#fixed)
1314
- [[v9.3.1]](#v931)
1415
- [Fixed](#fixed-1)
@@ -18,38 +19,38 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
1819
- [[v9.2.0]](#v920)
1920
- [Added](#added)
2021
- [Changed](#changed-2)
21-
- [Removed](#removed)
22+
- [Removed](#removed-1)
2223
- [Fixed](#fixed-3)
2324
- [[v9.1.0]](#v910)
2425
- [Added](#added-1)
2526
- [Changed](#changed-3)
26-
- [Removed](#removed-1)
27+
- [Removed](#removed-2)
2728
- [Fixed](#fixed-4)
2829
- [[v9.0.0]](#v900)
2930
- [Deprecated](#deprecated)
3031
- [Added](#added-2)
31-
- [Removed](#removed-2)
32+
- [Removed](#removed-3)
3233
- [Changed](#changed-4)
3334
- [Fixed](#fixed-5)
3435
- [[v8.0.0]](#v800)
3536
- [Added](#added-3)
3637
- [Changed](#changed-5)
3738
- [Fixed](#fixed-6)
38-
- [Removed](#removed-3)
39+
- [Removed](#removed-4)
3940
- [[v7.0.0]](#v700)
4041
- [Added](#added-4)
4142
- [Changed](#changed-6)
4243
- [Fixed](#fixed-7)
43-
- [Removed](#removed-4)
44+
- [Removed](#removed-5)
4445
- [[v6.0.0]](#v600)
4546
- [Added](#added-5)
4647
- [Changed](#changed-7)
4748
- [Fixed](#fixed-8)
48-
- [Removed](#removed-5)
49+
- [Removed](#removed-6)
4950
- [[v5.0.0]](#v500)
5051
- [Added](#added-6)
5152
- [Changed](#changed-8)
52-
- [Removed](#removed-6)
53+
- [Removed](#removed-7)
5354
- [Fixed](#fixed-9)
5455
- [Runtime Dependencies](#runtime-dependencies)
5556
- [[v4.0.2] - 2023-01-17](#v402---2023-01-17)
@@ -59,23 +60,23 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
5960
- [[v4.0.0] - 2022-12-15](#v400---2022-12-15)
6061
- [Added](#added-8)
6162
- [Changed](#changed-9)
62-
- [Removed](#removed-7)
63+
- [Removed](#removed-8)
6364
- [Fixed](#fixed-11)
6465
- [Runtime Dependencies](#runtime-dependencies-1)
6566
- [[3.0.0] - 2022-11-21](#300---2022-11-21)
6667
- [Added](#added-9)
6768
- [Changed](#changed-10)
68-
- [Removed](#removed-8)
69+
- [Removed](#removed-9)
6970
- [Fixed](#fixed-12)
7071
- [Runtime Dependencies](#runtime-dependencies-2)
7172
- [[2.0.0] - 2022-09-12](#200---2022-09-12)
7273
- [Added](#added-10)
7374
- [Changed](#changed-11)
74-
- [Removed](#removed-9)
75+
- [Removed](#removed-10)
7576
- [Fixed](#fixed-13)
7677
- [[2.0.0-alpha] - 2022-07-05](#200-alpha---2022-07-05)
7778
- [Added](#added-11)
78-
- [Removed](#removed-10)
79+
- [Removed](#removed-11)
7980
- [Changed](#changed-12)
8081
- [Fixed](#fixed-14)
8182
- [[1.1.0] - 2022-06-30](#110---2022-06-30)
@@ -106,6 +107,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
106107
- `Provider` (previously called `QueryHandle`) is extracted to its own package [purescript-cardano-provider](https://github.com/mlabs-haskell/purescript-cardano-provider) using module names in the format `Cardano.Provider.*` ([#1671](https://github.com/Plutonomicon/cardano-transaction-lib/pull/1671))
107108
- Switched from WebSocket to HTTP when interfacing with Ogmios. Note: Mempool functionality still uses WebSocket, as it requires a persistent connection to track state. ([#1575](https://github.com/Plutonomicon/cardano-transaction-lib/issues/1575))
108109
- Blockfrost Provider has been extracted to a separate package [purescript-cardano-blockfrost-provider](https://github.com/mlabs-haskell/purescript-cardano-blockfrost-provider) using module names in the format `Cardano.Blockfrost.*` ([#1661](https://github.com/Plutonomicon/cardano-transaction-lib/issues/1661))
110+
- Made adjustments to the [E2E testing documentation page](./doc/e2e-testing.md). Updated the [template](./templates/ctl-scaffold) to use the newly introduced `e2eConfigs` helper function that allows to define E2E configurations without unnecessary boilerplate. ([#1674](https://github.com/Plutonomicon/cardano-transaction-lib/pull/1674))
111+
112+
### Removed
113+
114+
- References to the discontinued Nami and Flint wallets ([#1674](https://github.com/Plutonomicon/cardano-transaction-lib/pull/1674))
109115

110116
### Fixed
111117

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,7 @@ You can also access [PureScript documentation for CTL and its dependencies](http
6464
- [`cardano-serialization-lib`](https://github.com/Emurgo/cardano-serialization-lib/)
6565
- [Ogmios](https://ogmios.dev) for chain queries
6666
- [Kupo](https://cardanosolutions.github.io/kupo/) for chain queries
67-
- [CIP-30](https://github.com/cardano-foundation/CIPs/tree/master/CIP-0030) (wallet interface - Nami partially implements this)
68-
- [Nami docs](https://github.com/Berry-Pool/nami-wallet)
67+
- [CIP-30](https://github.com/cardano-foundation/CIPs/tree/master/CIP-0030) (wallet interface)
6968
- [Alonzo CDDL spec](https://github.com/input-output-hk/cardano-ledger/blob/0738804155245062f05e2f355fadd1d16f04cd56/alonzo/impl/cddl-files/alonzo.cddl)
7069

7170
## Available support channels info

doc/e2e-testing.md

Lines changed: 95 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ For purposes of testing, there are two parts to using a wallet: providing the ri
6565
### Where to Find the Installed Extensions
6666

6767
1. Locate your browser profile directory. Commonly used locations include: `~/.config/{google-chrome,chromium}/Default` (where `Default` is the profile name), `~/snap/chromium/common/chromium/Default`.
68-
2. Make sure that inside the profile, your desired extension is unpacked. Nami should be in `Extensions/lpfcbjknijpeeillifnkikgncikgfhdo`, Gero (testnet version) in `Extensions/iifeegfcfhlhhnilhfoeihllenamcfgc`.
68+
2. Make sure that inside the profile, your desired extension is unpacked. Gero (testnet version) should be in `Extensions/iifeegfcfhlhhnilhfoeihllenamcfgc`.
6969
3. Add the version as a subdirectory, too. The final path may look like `/home/user/.config/google-chrome/Default/Extensions/iifeegfcfhlhhnilhfoeihllenamcfgc/1.10.9_0`
7070

7171
### How to Use a Different User Wallet
@@ -125,14 +125,6 @@ The tests can set up using CLI arguments, environment variables, or both. CLI ar
125125
| Lode CRX URL | `--lode-crx-url` | `LODE_CRX_URL` |
126126
| Lode password | `--lode-password` | `LODE_PASSWORD` |
127127
| Lode Extension ID | `--lode-extid` | `LODE_EXTID` |
128-
| Nami CRX URL | `--nami-crx-url` | `NAMI_CRX_URL` |
129-
| Nami CRX file | `--nami-crx` | `NAMI_CRX` |
130-
| Nami password | `--nami-password` | `NAMI_PASSWORD` |
131-
| Nami Extension ID | `--nami-extid` | `NAMI_EXTID` |
132-
| Flint CRX URL | `--flint-crx-url` | `FLINT_CRX_URL` |
133-
| Flint CRX file | `--flint-crx` | `FLINT_CRX` |
134-
| Flint password | `--flint-password` | `FLINT_PASSWORD` |
135-
| Flint Extension ID | `--flint-extid` | `FLINT_EXTID` |
136128
| Gero CRX URL | `--gero-crx-url` | `GERO_CRX_URL` |
137129
| Gero CRX file | `--gero-crx` | `GERO_CRX` |
138130
| Gero password | `--gero-password` | `GERO_PASSWORD` |
@@ -224,22 +216,74 @@ See [this file](../templates/ctl-scaffold/test/E2E.purs) for a quick example:
224216
```purescript
225217
main :: Effect Unit
226218
main = do
219+
configs <- liftEither $ lmap error mkConfigs
227220
-- Adds links to all available tests to the DOM for convenience
228221
addLinks configs tests
229222
-- Serves the appropriate `Contract` with e2eTestHooks
230223
route configs tests
231224
232-
configs :: Map E2EConfigName (ContractParams /\ Maybe WalletMock)
233-
configs = Map.fromFoldable
234-
[ "nami" /\ testnetNamiConfig /\ Nothing
235-
, "gero" /\ testnetGeroConfig /\ Nothing
236-
, "flint" /\ testnetFlintConfig /\ Nothing
237-
, "eternl" /\ testnetEternlConfig /\ Nothing
238-
, "lode" /\ testnetLodeConfig /\ Nothing
239-
, "nami-mock" /\ testnetNamiConfig /\ Just MockNami
240-
, "gero-mock" /\ testnetGeroConfig /\ Just MockGero
241-
, "flint-mock" /\ testnetFlintConfig /\ Just MockFlint
242-
, "lode-mock" /\ testnetLodeConfig /\ Just MockLode
225+
mkConfigs :: Either String (Map E2EConfigName (ContractParams /\ Maybe String))
226+
mkConfigs =
227+
e2eConfigs
228+
[ "eternl"
229+
, "gero"
230+
, "lode"
231+
, "eternl-mock"
232+
, "gero-mock"
233+
, "lode-mock"
234+
, "localnet-eternl-mock"
235+
, "localnet-gero-mock"
236+
, "localnet-lode-mock"
237+
]
238+
239+
tests :: Map E2ETestName (Contract Unit)
240+
tests = Map.fromFoldable
241+
[ "Contract" /\ Scaffold.contract
242+
-- Add more `Contract`s here
243+
]
244+
245+
tests :: Map E2ETestName (Contract Unit)
246+
tests = Map.fromFoldable
247+
[ "Contract" /\ Scaffold.contract
248+
-- Add more `Contract`s here
249+
]
250+
```
251+
252+
It is also possible to specify E2E configurations directly without using
253+
the `e2eConfigs` helper function:
254+
255+
```purescript
256+
main :: Effect Unit
257+
main = do
258+
-- Adds links to all available tests to the DOM for convenience
259+
addLinks configs tests
260+
-- Serves the appropriate `Contract` with e2eTestHooks
261+
route configs tests
262+
263+
configs :: Map E2EConfigName (ContractParams /\ Maybe String)
264+
configs = map (map walletName) <$> Map.fromFoldable
265+
[ "eternl" /\ testnetConfig' Eternl /\ Nothing
266+
, "gero" /\ testnetConfig' Gero /\ Nothing
267+
, "lode" /\ testnetConfig' Lode /\ Nothing
268+
, "eternl-mock" /\ testnetConfig' Eternl /\ Just Eternl
269+
, "gero-mock" /\ testnetConfig' Gero /\ Just Gero
270+
, "lode-mock" /\ testnetConfig' Lode /\ Just Lode
271+
, "localnet-eternl-mock" /\ testnetConfig' Eternl /\ Just Eternl
272+
, "localnet-gero-mock" /\ testnetConfig' Gero /\ Just Gero
273+
, "localnet-lode-mock" /\ testnetConfig' Lode /\ Just Lode
274+
]
275+
where
276+
testnetConfig' :: KnownWallet -> ContractParams
277+
testnetConfig' wallet =
278+
testnetConfig
279+
{ walletSpec =
280+
Just $ ConnectToGenericCip30 (walletName wallet) { cip95: false }
281+
}
282+
283+
tests :: Map E2ETestName (Contract Unit)
284+
tests = Map.fromFoldable
285+
[ "Contract" /\ Scaffold.contract
286+
-- Add more `Contract`s here
243287
]
244288
245289
tests :: Map E2ETestName (Contract Unit)
@@ -253,11 +297,11 @@ Now, the `Scaffold.contract` can be used as a test:
253297

254298
```bash
255299
E2E_TESTS="
256-
nami:http://localhost:4008/?nami:Contract
300+
eternl:http://localhost:4008/?eternl:Contract
257301
"
258302
```
259303

260-
The `nami:` prefix specifies which browser extension to load for the test, and the query parameter is for the router to be able to find the appropriate config.
304+
The `eternl:` prefix specifies which browser extension to load for the test, and the query parameter is for the router to be able to find the appropriate config.
261305

262306
Refer to the docs for `Contract.Test.E2E.route` function for an overview of the URL structure.
263307

@@ -286,39 +330,55 @@ As a result, you will get json files that look like this:
286330
Simply copy the `cborHex` from payment and stake signing keys (the order is important), and add them to the URL, separating by `:`:
287331

288332
```
289-
http://localhost:4008/?nami-mock:Contract:58200b07c066ba037344acee5431e6df41f6034bf1c5ffd6f803751e356807c6a209:5820f0db841df6c7fbc4506c58fad6676db0354a02dfd26efca445715a8adeabc338
333+
http://localhost:4008/?eternl-mock:Contract:58200b07c066ba037344acee5431e6df41f6034bf1c5ffd6f803751e356807c6a209:5820f0db841df6c7fbc4506c58fad6676db0354a02dfd26efca445715a8adeabc338
290334
```
291335

292-
The `nami:` prefix should not be specified, otherwise CTL will refuse to overwrite the existing wallet with a mock.
336+
The `eternl:` prefix should not be specified, otherwise CTL will refuse to overwrite the existing wallet with a mock.
293337

294338
In order to use the keys, their corresponding address must be pre-funded using the [faucet](https://docs.cardano.org/cardano-testnet/tools/faucet) (beware of IP-based rate-limiting) or from another wallet. Most contracts require at least two UTxOs to run (one will be used as collateral), so it's best to make two transactions.
295339

296340
### Using CIP-30 mock with Cardano Testnet
297341

298342
It's possible to run headless browser tests on top of a Cardano Testnet cluster.
299343

300-
To do that, it's enough to define a config name that:
301-
302-
- uses a `ContractParams` value with `networkId` set to `MainnetId`.
303-
- Specifies a wallet mock (e.g. `MockNami`)
344+
To do that, it's enough to define a config that specifies a wallet mock.
345+
For `e2eConfigs`, the name config must include the `-mock` suffix.
304346

305347
E.g.:
306348

307349
```purescript
308-
wallets :: Map E2EConfigName (ContractParams /\ Maybe WalletMock)
309-
wallets = Map.fromFoldable
310-
[ "testnet-nami-mock" /\ mainnetNamiConfig /\ Just MockNami
311-
, "testnet-gero-mock" /\ mainnetGeroConfig /\ Just MockGero
312-
, "testnet-flint-mock" /\ mainnetFlintConfig /\ Just MockFlint
313-
, "testnet-lode-mock" /\ mainnetLodeConfig /\ Just MockLode
350+
mkConfigs :: Either String (Map E2EConfigName (ContractParams /\ Maybe String))
351+
mkConfigs =
352+
e2eConfigs
353+
[ "localnet-eternl-mock"
354+
, "localnet-gero-mock"
355+
, "localnet-lode-mock"
356+
]
357+
```
358+
359+
or, if finer control over the configurations is needed:
360+
361+
```purescript
362+
configs :: Map E2EConfigName (ContractParams /\ Maybe String)
363+
configs = map (map walletName) <$> Map.fromFoldable
364+
[ "localnet-eternl-mock" /\ testnetConfig' Eternl /\ Just Eternl
365+
, "localnet-gero-mock" /\ testnetConfig' Gero /\ Just Gero
366+
, "localnet-lode-mock" /\ testnetConfig' Lode /\ Just Lode
314367
]
368+
where
369+
testnetConfig' :: KnownWallet -> ContractParams
370+
testnetConfig' wallet =
371+
testnetConfig
372+
{ walletSpec =
373+
Just $ ConnectToGenericCip30 (walletName wallet) { cip95: false }
374+
}
315375
```
316376

317377
Then a test entry *without* specifying any private key can be used:
318378

319379
```bash
320380
export E2E_TESTS="
321-
plutip:http://localhost:4008/?plutip-nami-mock:SomeContract
381+
localnet:http://localhost:4008/?localnet-gero-mock:SomeContract
322382
"
323383
```
324384

doc/getting-started.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,17 @@ main = Contract.Monad.launchAff_ do -- we re-export this for you
106106
Then use the eliminator `Contract.Monad.runContract` with a config specifying network and wallet:
107107

108108
```purescript
109+
110+
testnetEternlConfig :: Contract.Monad.ContractParams
111+
testnetEternlConfig =
112+
Contract.Config.testnetConfig
113+
{ walletSpec =
114+
Just $ ConnectToGenericCip30 (walletName Eternl) { cip95: false }
115+
}
116+
109117
main :: Effect Unit
110118
main = Contract.Monad.launchAff_ do
111-
runContract Contract.Config.testnetNamiConfig do
119+
runContract testnetEternlConfig do
112120
...
113121
```
114122

@@ -135,7 +143,7 @@ main = Contract.Monad.launchAff_ do -- we re-export this for you
135143
, kupoConfig: defaultKupoServerConfig
136144
}
137145
, networkId: TestnetId
138-
, walletSpec: Just ConnectToNami
146+
, walletSpec: Just $ ConnectToGenericCip30 (walletName Eternl) { cip95: false }
139147
, logLevel: Trace
140148
, customLogger: Nothing
141149
, suppressLogs: false

examples/AdditionalUtxos.purs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import Contract.BalanceTxConstraints
3030
)
3131
import Contract.Config
3232
( ContractParams
33-
, KnownWallet(Nami)
33+
, KnownWallet(Eternl)
3434
, WalletSpec(ConnectToGenericCip30)
3535
, testnetConfig
3636
, walletName
@@ -61,7 +61,7 @@ import Test.QuickCheck.Gen (randomSampleOne)
6161
main :: Effect Unit
6262
main = example $ testnetConfig
6363
{ walletSpec =
64-
Just $ ConnectToGenericCip30 (walletName Nami) { cip95: false }
64+
Just $ ConnectToGenericCip30 (walletName Eternl) { cip95: false }
6565
}
6666

6767
example :: ContractParams -> Effect Unit

examples/AlwaysMints.purs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import Cardano.Types.RedeemerDatum as RedeemerDatum
2323
import Cardano.Types.Transaction as Transaction
2424
import Contract.Config
2525
( ContractParams
26-
, KnownWallet(Nami)
26+
, KnownWallet(Eternl)
2727
, WalletSpec(ConnectToGenericCip30)
2828
, testnetConfig
2929
, walletName
@@ -38,7 +38,7 @@ import Data.Map as Map
3838
main :: Effect Unit
3939
main = example $ testnetConfig
4040
{ walletSpec =
41-
Just $ ConnectToGenericCip30 (walletName Nami) { cip95: false }
41+
Just $ ConnectToGenericCip30 (walletName Eternl) { cip95: false }
4242
}
4343

4444
contract :: Contract Unit

examples/AlwaysSucceeds.purs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ import Cardano.Types.TransactionUnspentOutput (toUtxoMap)
3838
import Contract.Address (mkAddress)
3939
import Contract.Config
4040
( ContractParams
41-
, KnownWallet(Nami)
41+
, KnownWallet(Eternl)
4242
, WalletSpec(ConnectToGenericCip30)
4343
, testnetConfig
4444
, walletName
@@ -62,7 +62,7 @@ import Effect.Exception (error)
6262
main :: Effect Unit
6363
main = example $ testnetConfig
6464
{ walletSpec =
65-
Just $ ConnectToGenericCip30 (walletName Nami) { cip95: false }
65+
Just $ ConnectToGenericCip30 (walletName Eternl) { cip95: false }
6666
}
6767

6868
contract :: Contract Unit

examples/AwaitTxConfirmedWithTimeout.purs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import Contract.Prelude
1313
import Cardano.AsCbor (decodeCbor)
1414
import Contract.Config
1515
( ContractParams
16-
, KnownWallet(Nami)
16+
, KnownWallet(Eternl)
1717
, WalletSpec(ConnectToGenericCip30)
1818
, testnetConfig
1919
, walletName
@@ -28,7 +28,7 @@ import Partial.Unsafe (unsafePartial)
2828
main :: Effect Unit
2929
main = example $ testnetConfig
3030
{ walletSpec =
31-
Just $ ConnectToGenericCip30 (walletName Nami) { cip95: false }
31+
Just $ ConnectToGenericCip30 (walletName Eternl) { cip95: false }
3232
}
3333

3434
example :: ContractParams -> Effect Unit

0 commit comments

Comments
 (0)