diff --git a/bitcoin-script.cabal b/bitcoin-script.cabal index 7eaf854..62f19b1 100644 --- a/bitcoin-script.cabal +++ b/bitcoin-script.cabal @@ -1,6 +1,6 @@ name: bitcoin-script category: Network, Finance -version: 0.11.1 +version: 0.11.2 license: MIT license-file: LICENSE copyright: (c) 2015 Leon Mergen @@ -16,12 +16,13 @@ description: decompiling of the script assembly, and continuously merges changes downstream. The advantage this library has over Haskoin is that it uses very few - dependencies and doesn't rely on external libraries such as LevelDB and snappy. - + dependencies and doesn't rely on external libraries such as LevelDB and snappy. + build-type: Simple data-files: LICENSE, README.md cabal-version: >= 1.10 -tested-with: GHC == 7.6, GHC == 7.8, GHC == 7.10 +tested-with: GHC == 7.6, GHC == 7.8, GHC == 7.10, GHC == 8.6, GHC == 8.8 + GHC == 8.10, GHCJS == 8.6 library hs-source-dirs: src @@ -30,8 +31,8 @@ library exposed-modules: Data.Bitcoin.Script - other-modules: Data.Bitcoin.Script.Types - + other-modules: Data.Bitcoin.Script.Types + build-depends: base >= 4.3 && < 5 , text , bytestring diff --git a/bitcoin-script.nix b/bitcoin-script.nix index 57f645e..75fa605 100644 --- a/bitcoin-script.nix +++ b/bitcoin-script.nix @@ -3,7 +3,7 @@ }: mkDerivation { pname = "bitcoin-script"; - version = "0.11.1"; + version = "0.11.2"; src = ./.; buildDepends = [ base base16-bytestring binary bytestring text ]; testDepends = [ base bytestring hspec ]; diff --git a/default.nix b/default.nix index 02b192e..5b11f35 100644 --- a/default.nix +++ b/default.nix @@ -1,2 +1,2 @@ -{ nixpkgs ? import {}, compiler ? "ghc7101" }: -nixpkgs.haskellPackages.callPackage ./bitcoin-script.nix { } +{ pkgs ? import (import ./nixpkgs.nix) { }, compiler ? "ghc865" }: +pkgs.haskell.packages.${compiler}.callPackage ./bitcoin-script.nix { } diff --git a/nixpkgs.nix b/nixpkgs.nix new file mode 100644 index 0000000..4a87542 --- /dev/null +++ b/nixpkgs.nix @@ -0,0 +1,4 @@ +builtins.fetchTarball { + url = "https://github.com/NixOS/nixpkgs-channels/archive/b0e3df2f8437767667bd041bb336e9d62a97ee81.tar.gz"; + sha256 = "0d34k96l0gzsdpv14vnxdfslgk66gb0nsjz7qcqz1ykb0i7n3n07"; +} diff --git a/shell.nix b/shell.nix index 8f5b30a..455dd2b 100644 --- a/shell.nix +++ b/shell.nix @@ -1,2 +1,2 @@ -{ nixpkgs ? import {}, compiler ? "ghc7101" }: -(import ./default.nix { inherit nixpkgs compiler; }).env +{ pkgs ? import (import ./nixpkgs.nix) { }, compiler ? "ghc865" }: +(import ./default.nix { inherit pkgs compiler; }).env diff --git a/src/Data/Bitcoin/Script/Types.hs b/src/Data/Bitcoin/Script/Types.hs index 7a288a1..81004cd 100644 --- a/src/Data/Bitcoin/Script/Types.hs +++ b/src/Data/Bitcoin/Script/Types.hs @@ -340,21 +340,21 @@ instance Binary ScriptOp where let len = BS.length payload case optype of OPCODE -> do - unless (len <= 0x4b) $ fail + unless (len <= 0x4b) $ error "OP_PUSHDATA OPCODE: Payload size too big" putWord8 $ fromIntegral len OPDATA1 -> do - unless (len <= 0xff) $ fail + unless (len <= 0xff) $ error "OP_PUSHDATA OPDATA1: Payload size too big" putWord8 0x4c putWord8 $ fromIntegral len OPDATA2 -> do - unless (len <= 0xffff) $ fail + unless (len <= 0xffff) $ error "OP_PUSHDATA OPDATA2: Payload size too big" putWord8 0x4d putWord16le $ fromIntegral len OPDATA4 -> do - unless (len <= 0x7fffffff) $ fail + unless (len <= 0x7fffffff) $ error "OP_PUSHDATA OPDATA4: Payload size too big" putWord8 0x4e putWord32le $ fromIntegral len