Skip to content

Commit

Permalink
project setup
Browse files Browse the repository at this point in the history
  • Loading branch information
SebastienGllmt committed Feb 14, 2020
1 parent 02566a9 commit 11433a4
Show file tree
Hide file tree
Showing 16 changed files with 4,085 additions and 105 deletions.
19 changes: 19 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
module.exports = {
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": "./tsconfig.json"
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking"
],
"plugins": [
"@typescript-eslint"
],
"globals": {
},
"rules": {
}
}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules/
dist/
7 changes: 7 additions & 0 deletions .mocharc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module.exports = {
spec: "src/**/*.spec.ts",
require: ["ts-node/register", "source-map-support/register"],
recursive: true,
"watch-extensions": ['ts'],
exit: true,
};
27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Cardano Serialization Lib

**WARNING** this library is experimental.

This is a library for serialization & deserialization of types related to Cardano's Haskell implementation of Shelley.

## Original specs

Here are the location of the original [CDDL](http://cbor.io/tools.html) specifications:

- Byron: [link](https://github.com/input-output-hk/cardano-ledger-specs/blob/master/byron/cddl-spec/byron.cddl)
- Shelley: [link](https://github.com/input-output-hk/cardano-ledger-specs/blob/master/shelley/chain-and-ledger/cddl-spec/shelley.cddl#L72)

# Testing

First you need to install `cddl`
```
sudo apt install ruby
sudo gem install cddl
sudo gem install cbor-diag
```

You can generate new tests with
1) `cddl specs/shelley.cddl generate 1 > test/name_here.diag`
2) `diag2cbor.rb test/name_here.diag > test/name_here.cbor`

You can combine these together with `cddl specs/shelley.cddl generate 1 | diag2cbor.rb > test/name_here.cbor`
Loading

0 comments on commit 11433a4

Please sign in to comment.