Skip to content

Fix compilation in GHC >= 8.8 #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions bitcoin-script.cabal
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion bitcoin-script.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 ];
Expand Down
4 changes: 2 additions & 2 deletions default.nix
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
{ nixpkgs ? import <nixpkgs> {}, compiler ? "ghc7101" }:
nixpkgs.haskellPackages.callPackage ./bitcoin-script.nix { }
{ pkgs ? import (import ./nixpkgs.nix) { }, compiler ? "ghc865" }:
pkgs.haskell.packages.${compiler}.callPackage ./bitcoin-script.nix { }
4 changes: 4 additions & 0 deletions nixpkgs.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
builtins.fetchTarball {
url = "https://github.com/NixOS/nixpkgs-channels/archive/b0e3df2f8437767667bd041bb336e9d62a97ee81.tar.gz";
sha256 = "0d34k96l0gzsdpv14vnxdfslgk66gb0nsjz7qcqz1ykb0i7n3n07";
}
4 changes: 2 additions & 2 deletions shell.nix
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
{ nixpkgs ? import <nixpkgs> {}, compiler ? "ghc7101" }:
(import ./default.nix { inherit nixpkgs compiler; }).env
{ pkgs ? import (import ./nixpkgs.nix) { }, compiler ? "ghc865" }:
(import ./default.nix { inherit pkgs compiler; }).env
8 changes: 4 additions & 4 deletions src/Data/Bitcoin/Script/Types.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down