Skip to content

Commit

Permalink
Version set from cabal
Browse files Browse the repository at this point in the history
  • Loading branch information
Jean-Pierre Rupp committed Jun 8, 2016
1 parent 3bb8c89 commit 810293c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
17 changes: 15 additions & 2 deletions haskoin-core/Network/Haskoin/Constants.hs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
module Network.Haskoin.Constants
( -- ** Data
Network(..)
, prodnet
, testnet3
-- ** Functions
, switchToTestnet3
, setNetwork
Expand All @@ -31,11 +33,14 @@ module Network.Haskoin.Constants

import Data.Bits (shiftR)
import Data.ByteString (ByteString)
import qualified Data.ByteString.Char8 as C8 (concat, pack)
import Data.IORef (IORef, newIORef, readIORef, writeIORef)
import Data.Version (showVersion)
import Data.Word (Word8, Word32, Word64)
import Data.LargeWord (Word256)
import Network.Haskoin.Block.Types
import System.IO.Unsafe (unsafePerformIO)
import Paths_haskoin_core (version)

data Network = Network
{ getNetworkName :: !String
Expand Down Expand Up @@ -166,7 +171,11 @@ prodnet = Network
}
, getMaxBlockSize = 1000000
, getMaxSatoshi = 2100000000000000
, getHaskoinUserAgent = "/haskoin:0.3.1/"
, getHaskoinUserAgent = C8.concat
[ "/haskoin:"
, C8.pack $ showVersion version
, "/"
]
, getDefaultPort = 8333
, getAllowMinDifficultyBlocks = False
, getPowLimit = fromIntegral (maxBound `shiftR` 32 :: Word256)
Expand Down Expand Up @@ -234,7 +243,11 @@ testnet3 = Network
}
, getMaxBlockSize = 1000000
, getMaxSatoshi = 2100000000000000
, getHaskoinUserAgent = "/haskoin-testnet:0.3.1/"
, getHaskoinUserAgent = C8.concat
[ "/haskoin-testnet:"
, C8.pack $ showVersion version
, "/"
]
, getDefaultPort = 18333
, getAllowMinDifficultyBlocks = True
, getPowLimit = fromIntegral (maxBound `shiftR` 32 :: Word256)
Expand Down
1 change: 1 addition & 0 deletions haskoin-core/haskoin-core.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ library
Network.Haskoin.Test.Script
Network.Haskoin.Test.Transaction
Network.Haskoin.Test.Block
Paths_haskoin_core

extensions: EmptyDataDecls
OverloadedStrings
Expand Down

0 comments on commit 810293c

Please sign in to comment.