diff --git a/.travis.yml b/.travis.yml index bdd37d199..75f962332 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,6 @@ language: python python: - - "2.7" - "3.6" install: diff --git a/setup.py b/setup.py index 57a7fe88e..c0c2f9d9b 100644 --- a/setup.py +++ b/setup.py @@ -18,7 +18,6 @@ setup( 'Intended Audience :: Developers', 'Intended Audience :: System Administrators', 'License :: OSI Approved :: MIT License', - 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', 'Operating System :: OS Independent', 'Topic :: Internet', diff --git a/tests/unit/test_wallet.py b/tests/unit/test_wallet.py index 5ca3bd904..12d591322 100644 --- a/tests/unit/test_wallet.py +++ b/tests/unit/test_wallet.py @@ -11,7 +11,7 @@ class TestWalletCreation(unittest.TestCase): def setUp(self): self.manager = WalletManager() - config = {'wallet_path': '/tmp/wallet'} + config = {'data_path': '/tmp/wallet'} self.btc_ledger = self.manager.get_or_create_ledger(BTCLedger.get_id(), config) self.bch_ledger = self.manager.get_or_create_ledger(BCHLedger.get_id(), config) @@ -28,6 +28,7 @@ class TestWalletCreation(unittest.TestCase): def test_load_and_save_wallet(self): wallet_dict = { + 'version': 1, 'name': 'Main Wallet', 'accounts': [ { @@ -61,11 +62,11 @@ class TestWalletCreation(unittest.TestCase): def test_read_write(self): manager = WalletManager() - config = {'wallet_path': '/tmp/wallet'} + config = {'data_path': '/tmp/wallet'} ledger = manager.get_or_create_ledger(BTCLedger.get_id(), config) with tempfile.NamedTemporaryFile(suffix='.json') as wallet_file: - wallet_file.write(b'{}') + wallet_file.write(b'{"version": 1}') wallet_file.seek(0) # create and write wallet to a file diff --git a/torba/baseaccount.py b/torba/baseaccount.py index d2a5b0c82..524133495 100644 --- a/torba/baseaccount.py +++ b/torba/baseaccount.py @@ -64,7 +64,7 @@ class KeyChain: defer.returnValue(addresses[0]) -class BaseAccount: +class BaseAccount(object): mnemonic_class = Mnemonic private_key_class = PrivateKey diff --git a/torba/baseledger.py b/torba/baseledger.py index 5e0396bd3..247be00c9 100644 --- a/torba/baseledger.py +++ b/torba/baseledger.py @@ -109,7 +109,7 @@ class BaseLedger(six.with_metaclass(LedgerRegistry)): @property def path(self): - return os.path.join(self.config['wallet_path'], self.get_id()) + return os.path.join(self.config['data_path'], self.get_id()) def get_input_output_fee(self, io): """ Fee based on size of the input / output. """ diff --git a/torba/wallet.py b/torba/wallet.py index 0ff419089..e41208329 100644 --- a/torba/wallet.py +++ b/torba/wallet.py @@ -44,6 +44,7 @@ class Wallet: def to_dict(self): return { + 'version': WalletStorage.LATEST_VERSION, 'name': self.name, 'accounts': [a.to_dict() for a in self.accounts] } diff --git a/tox.ini b/tox.ini index d006596dc..746107260 100644 --- a/tox.ini +++ b/tox.ini @@ -1,16 +1,16 @@ [tox] -#envlist = py{27,36}-unit,py36-integration-{torba.coin.bitcoincash,torba.coin.bitcoinsegwit} -envlist = py{27,36}-unit,py36-integration-torba.coin.bitcoinsegwit +#envlist = unit,integration-{torba.coin.bitcoincash,torba.coin.bitcoinsegwit} +envlist = unit,integration-torba.coin.bitcoinsegwit [testenv] deps = coverage - py36-integration: ../orchstr8 - py36-integration: ../electrumx + integration: ../orchstr8 + integration: ../electrumx extras = test changedir = {toxinidir}/tests -setenv = py36-integration: LEDGER={envname} +setenv = integration: LEDGER={envname} commands = - py{27,36}-unit: coverage run -p --source={envsitepackagesdir}/torba -m twisted.trial unit - py36-integration: orchstr8 download - py36-integration: coverage run -p --source={envsitepackagesdir}/torba -m twisted.trial --reactor=asyncio integration + unit: coverage run -p --source={envsitepackagesdir}/torba -m twisted.trial unit + integration: orchstr8 download + integration: coverage run -p --source={envsitepackagesdir}/torba -m twisted.trial --reactor=asyncio integration