packages feed

haskoin-core 0.9.7 → 0.9.8

raw patch · 3 files changed

+24/−2 lines, 3 files

Files

CHANGELOG.md view
@@ -4,6 +4,10 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). +## 0.9.8+### Added+- Ord instance for `DerivPathI`+ ## 0.9.7 ### Added - JSON encoding/decoding for blocks.
haskoin-core.cabal view
@@ -4,10 +4,10 @@ -- -- see: https://github.com/sol/hpack ----- hash: 5c1c1a7a9f8aa636d437253dc44d419ea3af2f88a0b1fb4973b6390fda840216+-- hash: 4574f1ec2da07e0ffe26200ecf9819686ab0e99a15cde4a513b8b45e4b62c06d  name:           haskoin-core-version:        0.9.7+version:        0.9.8 synopsis:       Bitcoin & Bitcoin Cash library for Haskell description:    Haskoin Core is a complete Bitcoin and Bitcoin Cash library of functions and data types for Haskell developers. category:       Bitcoin, Finance, Network
src/Network/Haskoin/Keys/Extended.hs view
@@ -539,6 +539,24 @@     Deriv         == Deriv         = True     _             == _             = False +instance Ord (DerivPathI t) where+    -- Same hardness on each side+    (nextA :| iA) `compare` (nextB :| iB) =+        if nextA == nextB then iA `compare` iB else nextA `compare` nextB+    (nextA :/ iA) `compare` (nextB :/ iB) =+        if nextA == nextB then iA `compare` iB else nextA `compare` nextB++    -- Different hardness: hard paths are LT soft paths+    (nextA :/ iA) `compare` (nextB :| iB) =+        if nextA == nextB then LT else nextA `compare` nextB+    (nextA :| iA) `compare` (nextB :/ iB) =+        if nextA == nextB then GT else nextA `compare` nextB++    Deriv `compare` Deriv  = EQ+    Deriv `compare` _      = LT+    _     `compare` Deriv  = GT++ instance Serialize DerivPath where     get = listToPath <$> S.get     put = put . pathToList