forked from input-output-hk/cardano-sl
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move BIP39 module to separate package
From [input-ouput-hk/cardano-wallet#55](cardano-foundation/cardano-wallet#55): > We've moved the wallet into its own repository as a first step towards decoupling. Now, the cardano-wallet uses cardano-sl as a peer dependency and rely on it for quite a few things. However, a few modules in cardano-sl also relies on code inside the wallet. This creates some circular dependencies between both repo. > One of those dependencies is actually the BIP39-ish implementation from the cardano-wallet used in a few scripts and executable currently located on cardano-sl. 1. Creates new package `mnemonic` 2. Moves `BIP39` module & spec from `wallet-new` to `mnemonic` 3. Point BIP39 imports from faucet and wallet-new to the new location 4. Make scripts/generate-mnemonic.hs an executable instead.
- Loading branch information
Showing
19 changed files
with
275 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
Copyright (c) 2018 IOHK | ||
|
||
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: | ||
|
||
The above copyright notice and this permission notice shall be included in | ||
all copies or substantial portions of the Software. | ||
|
||
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. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Cardano-SL-Mnemonic | ||
Custom Mnemonic module, previously located in cardano-sl-wallet-new (now cardano-wallet). | ||
|
||
It includes an executable too: | ||
```shell | ||
$ stack exec cardano-sl-generate-mnemonic | ||
["squirrel","material","silly","twice","direct","slush","pistol","razor","become","junk","kingdom","flee"] | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
name: cardano-sl-mnemonic | ||
version: 2.0.0 | ||
synopsis: TODO | ||
description: See README | ||
homepage: https://github.com/input-output-hk/cardano-sl/mnemonic/README.md | ||
author: IOHK Engineering Team | ||
maintainer: operations@iohk.io | ||
copyright: 2018 IOHK | ||
license: MIT | ||
license-file: LICENSE | ||
category: Data | ||
build-type: Simple | ||
extra-source-files: README.md | ||
cabal-version: >=1.10 | ||
|
||
library | ||
default-language: Haskell2010 | ||
default-extensions: DeriveGeneric | ||
LambdaCase | ||
NoImplicitPrelude | ||
OverloadedStrings | ||
TupleSections | ||
TypeApplications | ||
ScopedTypeVariables | ||
|
||
hs-source-dirs: src | ||
|
||
build-depends: base >=4.7 && <5 | ||
, QuickCheck | ||
, aeson | ||
, basement | ||
, bytestring | ||
, cardano-crypto | ||
, cardano-sl | ||
, cardano-sl-core | ||
, cardano-sl-crypto | ||
, cardano-sl-infra | ||
, cryptonite | ||
, data-default | ||
, formatting | ||
, lens | ||
, memory | ||
, swagger2 | ||
, text | ||
, time | ||
, universum | ||
|
||
exposed-modules: Cardano.Mnemonic | ||
|
||
|
||
test-suite cardano-sl-mnemonic-test | ||
default-language: Haskell2010 | ||
|
||
type: exitcode-stdio-1.0 | ||
default-extensions: DeriveGeneric | ||
LambdaCase | ||
NoImplicitPrelude | ||
OverloadedStrings | ||
TupleSections | ||
TypeApplications | ||
ScopedTypeVariables | ||
|
||
hs-source-dirs: test | ||
main-is: Main.hs | ||
other-modules: Cardano.MnemonicSpec | ||
|
||
build-depends: base | ||
, hspec | ||
, universum | ||
, cardano-sl-mnemonic | ||
, bytestring | ||
, QuickCheck | ||
, cardano-sl-crypto | ||
, data-default | ||
, aeson | ||
, cardano-crypto | ||
|
||
|
||
executable cardano-generate-mnemonic | ||
main-is: Main.hs | ||
hs-source-dirs: generate-mnemonic | ||
ghc-options: -threaded -rtsopts -with-rtsopts=-N -Wall | ||
build-depends: | ||
base | ||
, aeson | ||
, cardano-sl-mnemonic | ||
, bytestring | ||
, text | ||
, universum | ||
default-language: Haskell2010 | ||
default-extensions: NoImplicitPrelude |
9 changes: 5 additions & 4 deletions
9
scripts/generate-mnemonic.hs → mnemonic/generate-mnemonic/Main.hs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 11 additions & 4 deletions
15
...w/test/Cardano/Wallet/Kernel/BIP39Spec.hs → mnemonic/test/Cardano/MnemonicSpec.hs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
module Main where | ||
|
||
import Universum | ||
|
||
import Test.Hspec | ||
|
||
import qualified Cardano.MnemonicSpec | ||
|
||
|
||
main :: IO () | ||
main = hspec $ do | ||
Cardano.MnemonicSpec.spec |
Oops, something went wrong.