Skip to content

Commit

Permalink
About to start some testnet/multisig tests
Browse files Browse the repository at this point in the history
  • Loading branch information
etotheipi committed Dec 3, 2011
1 parent b6f5917 commit db7e5dc
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 20 deletions.
23 changes: 13 additions & 10 deletions btcarmoryengine.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@
from struct import pack, unpack
from datetime import datetime


# These are overriden for testnet
USE_TESTNET = False

# Version Numbers -- numDigits [var, 2, 2, 3]
BTCARMORY_VERSION = (0,50,0,0) # (Major, Minor, Minor++, even-more-minor)
PYBTCADDRESS_VERSION = (1,00,0,0) # (Major, Minor, Minor++, even-more-minor)
Expand Down Expand Up @@ -107,23 +111,24 @@ def readVersionInt(verInt):
BTC_HOME_DIR = ''
ARMORY_HOME_DIR = ''
BLK0001_PATH = ''
SUBDIR = 'testnet' if USE_TESTNET else ''
if OS_WINDOWS:
OS_NAME = 'Windows'
USER_HOME_DIR = os.getenv('APPDATA')
BTC_HOME_DIR = os.path.join(USER_HOME_DIR, 'Bitcoin')
ARMORY_HOME_DIR = os.path.join(USER_HOME_DIR, 'BitcoinArmory')
BTC_HOME_DIR = os.path.join(USER_HOME_DIR, 'Bitcoin', SUBDIR)
ARMORY_HOME_DIR = os.path.join(USER_HOME_DIR, 'BitcoinArmory', SUBDIR)
BLK0001_PATH = os.path.join(BTC_HOME_DIR, 'blk0001.dat')
elif OS_LINUX:
OS_NAME = 'Linux'
USER_HOME_DIR = os.getenv('HOME')
BTC_HOME_DIR = os.path.join(USER_HOME_DIR, '.bitcoin')
ARMORY_HOME_DIR = os.path.join(USER_HOME_DIR, '.bitcoinarmory')
BTC_HOME_DIR = os.path.join(USER_HOME_DIR, '.bitcoin', SUBDIR)
ARMORY_HOME_DIR = os.path.join(USER_HOME_DIR, '.bitcoinarmory', SUBDIR)
BLK0001_PATH = os.path.join(BTC_HOME_DIR, 'blk0001.dat')
elif OS_MACOSX:
OS_NAME = 'Mac/OSX'
USER_HOME_DIR = os.path.expanduser('~/Library/Application Support')
BTC_HOME_DIR = os.path.join(USER_HOME_DIR, 'Bitcoin')
ARMORY_HOME_DIR = os.path.join(USER_HOME_DIR, 'BitcoinArmory')
BTC_HOME_DIR = os.path.join(USER_HOME_DIR, 'Bitcoin', SUBDIR)
ARMORY_HOME_DIR = os.path.join(USER_HOME_DIR, 'BitcoinArmory', SUBDIR)
BLK0001_PATH = os.path.join(BTC_HOME_DIR, 'blk0001.dat')
else:
print '***Unknown operating system!'
Expand Down Expand Up @@ -160,8 +165,6 @@ class NetworkIDError(Exception): pass



# These are overriden for testnet
USE_TESTNET = False

##### MAIN NETWORK IS DEFAULT #####
if not USE_TESTNET:
Expand Down Expand Up @@ -658,15 +661,15 @@ def difficulty_to_binaryBits(i):


################################################################################
def BDM_LoadBlockchainFile(blkfile=None, testnet=False):
def BDM_LoadBlockchainFile(blkfile=None):
"""
Looks for the blk0001.dat file in the default location for your operating
system. If it is found, it is loaded into RAM and the longest chain is
computed. Access to any information in the blockchain can be found via
the bdm object.
"""
if blkfile==None:
if not testnet:
if not USE_TESTNET:
if 'win' in opsys.lower():
blkfile = os.path.join(os.getenv('APPDATA'), 'Bitcoin', 'blk0001.dat')
if 'nix' in opsys.lower() or 'nux' in opsys.lower():
Expand Down
33 changes: 23 additions & 10 deletions unittest.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,30 @@
BE = BIGENDIAN


Test_BasicUtils = False
Test_PyBlockUtils = False
Test_CppBlockUtils = False
Test_SimpleAddress = False
Test_MultiSigTx = False
Test_TxSimpleCreate = False
Test_EncryptedAddress = False
Test_EncryptedWallet = False
Test_BasicUtils = True
Test_PyBlockUtils = True
Test_CppBlockUtils = True
Test_SimpleAddress = True
Test_MultiSigTx = True
Test_TxSimpleCreate = True
Test_EncryptedAddress = True
Test_EncryptedWallet = True
Test_TxDistProposals = True
Test_SelectCoins = False
Test_CryptoTiming = False
Test_SelectCoins = True
Test_CryptoTiming = True


'''
import optparse
parser = optparse.OptionParser(usage="%prog [options]\n"+
"Connects to a running bitcoin node and "+
"prints all or part of the best-block-chain.")
parser.add_option("--testnet", dest="testnet", action="store_true", default=False,
help="Speak testnet protocol")
(options, args) = parser.parse_args()
'''



def testFunction( fnName, expectedOutput, *args, **kwargs):
Expand Down

0 comments on commit db7e5dc

Please sign in to comment.