From 5dd986fb2af673e634f41898500281e6c358ba3a Mon Sep 17 00:00:00 2001 From: Anton Gushcha Date: Thu, 10 Sep 2020 03:24:23 +0300 Subject: [PATCH] Fix MonadFail compilation error for binary PutM --- src/Data/Bitcoin/Script/Types.hs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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