From fbc6ec63fcc7fad63650ea3e6f1bfe086cdc2b1b Mon Sep 17 00:00:00 2001 From: Erik van den Brink Date: Sat, 20 Oct 2018 15:45:18 +0200 Subject: [PATCH 1/6] stage 1 - wallet fixtures + big integer update (#89) --- .travis.yml | 65 ++++++++++++++++++++++--------------------- neocore/BigInteger.py | 6 ++++ tests/test_numbers.py | 8 ++++++ 3 files changed, 47 insertions(+), 32 deletions(-) diff --git a/.travis.yml b/.travis.yml index a4b9465..795058e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,47 +2,48 @@ language: python python: - - 3.6 +- 3.6 addons: - apt: - packages: - - libleveldb-dev - - libsqlite3-dev + apt: + packages: + - libleveldb-dev + - libsqlite3-dev install: - - pip install -r requirements.txt - - pip install -r requirements_dev.txt - - pip install coveralls +- pip install -r requirements.txt +- pip install -r requirements_dev.txt +- pip install coveralls env: - - SKIP_DEPS_CHECK=1 +- SKIP_DEPS_CHECK=1 script: - # run internal tests - - coverage run --omit neocore/Cryptography/ECCurve.py --source neocore setup.py test - - pycodestyle neocore tests - - # now test the upstream neo-python dev branch with the current neocore code - - git clone https://github.com/CityOfZion/neo-python.git - - cd neo-python - - git checkout origin/development -b development - - pip install -e . - - yes | pip uninstall neocore - - pip install -e ../ - - python -m unittest discover neo - - cd .. +# run internal tests +- coverage run --omit neocore/Cryptography/ECCurve.py --source neocore setup.py test +- pycodestyle neocore tests + +# now test the upstream neo-python dev branch with the current neocore code +- git clone https://github.com/ixje/neo-python.git +- cd neo-python +- git checkout origin/wallet_fixtures -b wallet_fixtures +- pip install -e . +- yes | pip uninstall neocore neo-boa +- pip install git+https://github.com/ixje/neo-boa@wallet_fixtures +- pip install -e ../ +- python -m unittest discover neo +- cd .. after_success: - - coveralls +- coveralls deploy: - true: - tags: true - python: 3.6 - repo: CityOfZion/neo-python-core - distributions: sdist bdist_wheel - password: - secure: hGu/hIRPKLyd0+oKhw0GnJ1lULAcK4gx0gvYjL2Kn8frwlb8AlcRXNJKfb4LYAxMdUp29DoTmIIdnI2K5rkKWjkaTbGaHbq5ZBcRqfMuZjMAhnpAsHKbOUrfzFYkpllo9QCyI0Dn9hFczMkWA2ZplmU8EEkxrJen2FEWkGmt2qbU6dQ7WVde1GSEixgK1wbrDbpw1UtqHLZlDzPAPs18Drp5ftCkKKbz9Yhy5xzdBnsdFiiAp1YxIG8t+86ni4r+imUbP4GFtaqlpBaXzRgTMKVfB1dcNCv2n0wnhtHWs1I9jOqLHP0NCLDClzeIiMUOEBcVnWMqPo9cLj4eYy+16mzuUwAiI2XV1nGtXELASGCRVai4az41AblxgHnVZax1/qb+aroa6yJk4F+LWS8frDuYhv/ihx1dH+0pDybb1ZZPMv7Bh1lYoaqKg1F9oiU+AMTFrkRKtGOrqPe8U1Q1JLLYiXstVWOnLS6iMSoIRy4bk+TeoXShTcwE4pW8CmEFkyLxOn3syzJX6dRoo1+h1GHuI16mWpbNs86HH5dzmqOimUjpWFS881ClxrVJ+SKiY8rGvl+oAuln5Mpbh1z3c+pNDCTzTwSEiZdaRCEGh9O8jRNkfNQ6fEt3uGMtbs8jZkeg8oemD4/SqRMJdNrgMY3lyoUPxco68ZoNorIhTN8= - provider: pypi - user: CityOfZion + true: + tags: true + python: 3.6 + repo: CityOfZion/neo-python-core + distributions: sdist bdist_wheel + password: + secure: hGu/hIRPKLyd0+oKhw0GnJ1lULAcK4gx0gvYjL2Kn8frwlb8AlcRXNJKfb4LYAxMdUp29DoTmIIdnI2K5rkKWjkaTbGaHbq5ZBcRqfMuZjMAhnpAsHKbOUrfzFYkpllo9QCyI0Dn9hFczMkWA2ZplmU8EEkxrJen2FEWkGmt2qbU6dQ7WVde1GSEixgK1wbrDbpw1UtqHLZlDzPAPs18Drp5ftCkKKbz9Yhy5xzdBnsdFiiAp1YxIG8t+86ni4r+imUbP4GFtaqlpBaXzRgTMKVfB1dcNCv2n0wnhtHWs1I9jOqLHP0NCLDClzeIiMUOEBcVnWMqPo9cLj4eYy+16mzuUwAiI2XV1nGtXELASGCRVai4az41AblxgHnVZax1/qb+aroa6yJk4F+LWS8frDuYhv/ihx1dH+0pDybb1ZZPMv7Bh1lYoaqKg1F9oiU+AMTFrkRKtGOrqPe8U1Q1JLLYiXstVWOnLS6iMSoIRy4bk+TeoXShTcwE4pW8CmEFkyLxOn3syzJX6dRoo1+h1GHuI16mWpbNs86HH5dzmqOimUjpWFS881ClxrVJ+SKiY8rGvl+oAuln5Mpbh1z3c+pNDCTzTwSEiZdaRCEGh9O8jRNkfNQ6fEt3uGMtbs8jZkeg8oemD4/SqRMJdNrgMY3lyoUPxco68ZoNorIhTN8= + provider: pypi + user: CityOfZion diff --git a/neocore/BigInteger.py b/neocore/BigInteger.py index 236887e..5620a11 100644 --- a/neocore/BigInteger.py +++ b/neocore/BigInteger.py @@ -53,6 +53,12 @@ def __floordiv__(self, *args, **kwargs): def __truediv__(self, *args, **kwargs): # real signature unknown return BigInteger(super(BigInteger, self).__floordiv__(*args, **kwargs)) + def __rshift__(self, *args, **kwargs): + return BigInteger(super(BigInteger, self).__rshift__(*args, **kwargs)) + + def __lshift__(self, *args, **kwargs): + return BigInteger(super(BigInteger, self).__lshift__(*args, **kwargs)) + ZERO = BigInteger(0) ONE = BigInteger(1) diff --git a/tests/test_numbers.py b/tests/test_numbers.py index d25ecab..ad0704c 100644 --- a/tests/test_numbers.py +++ b/tests/test_numbers.py @@ -307,6 +307,14 @@ def test_dunder_methods(self): self.assertEqual(str(b1), "1") self.assertEqual(b3 // b2, 1) + right_shift = b3 >> b1 + self.assertEqual(right_shift, 1) + self.assertIsInstance(right_shift, BigInteger) + + left_shift = b1 << b3 + self.assertEqual(left_shift, 8) + self.assertIsInstance(left_shift, BigInteger) + class UIntBaseTestCase(TestCase): def test_initialization(self): From 6ecdc9dfd2e5e82537c930c48508a94dfac112e1 Mon Sep 17 00:00:00 2001 From: Erik van den Brink Date: Sat, 20 Oct 2018 16:12:38 +0200 Subject: [PATCH 2/6] stage 2 - wallet fixtures (#90) point travis back to coz sources --- .travis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 795058e..faf7ac2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,12 +24,12 @@ script: - pycodestyle neocore tests # now test the upstream neo-python dev branch with the current neocore code -- git clone https://github.com/ixje/neo-python.git +- git clone https://github.com/CityOfZion/neo-python.git - cd neo-python -- git checkout origin/wallet_fixtures -b wallet_fixtures +- git checkout origin/development -b development - pip install -e . - yes | pip uninstall neocore neo-boa -- pip install git+https://github.com/ixje/neo-boa@wallet_fixtures +- pip install git+https://github.com/CityOfZion/neo-boa@development - pip install -e ../ - python -m unittest discover neo - cd .. From c4fb4251c93e983a7a1e51cef39fe82bd91bcb67 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Sat, 20 Oct 2018 07:19:47 -0700 Subject: [PATCH 3/6] Update py from 1.6.0 to 1.7.0 (#80) --- requirements_dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements_dev.txt b/requirements_dev.txt index 2a88bae..8b10c9b 100644 --- a/requirements_dev.txt +++ b/requirements_dev.txt @@ -19,7 +19,7 @@ mock==2.0.0 pathtools==0.1.2 pbr==4.3.0 pluggy==0.7.1 -py==1.6.0 +py==1.7.0 pycodestyle==2.4.0 pycparser==2.19 pyflakes==2.0.0 From a806f6c3cf9e58e20ca3d1fd78f77c4ec51c0a92 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Sat, 20 Oct 2018 07:27:49 -0700 Subject: [PATCH 4/6] Update pbr from 4.3.0 to 5.0.0 (#85) --- requirements_dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements_dev.txt b/requirements_dev.txt index 8b10c9b..1a2220c 100644 --- a/requirements_dev.txt +++ b/requirements_dev.txt @@ -17,7 +17,7 @@ MarkupSafe==1.0 mccabe==0.6.1 mock==2.0.0 pathtools==0.1.2 -pbr==4.3.0 +pbr==5.0.0 pluggy==0.7.1 py==1.7.0 pycodestyle==2.4.0 From ab723a2eb0811de5f4383eddc35e74b4d64c1336 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Sat, 20 Oct 2018 07:31:59 -0700 Subject: [PATCH 5/6] Update requests from 2.19.1 to 2.20.0 (#87) --- requirements_dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements_dev.txt b/requirements_dev.txt index 1a2220c..b5a6a93 100644 --- a/requirements_dev.txt +++ b/requirements_dev.txt @@ -26,7 +26,7 @@ pyflakes==2.0.0 Pygments==2.2.0 pytz==2018.5 PyYAML==3.13 -requests==2.19.1 +requests==2.20.0 six==1.11.0 snowballstemmer==1.2.1 Sphinx==1.8.1 From 6c4ea1d4cdbef8fed48d7fb100d9ab94431713bf Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Sat, 20 Oct 2018 07:37:16 -0700 Subject: [PATCH 6/6] Update urllib3 from 1.22 to 1.24 (#84) --- requirements_dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements_dev.txt b/requirements_dev.txt index b5a6a93..965009d 100644 --- a/requirements_dev.txt +++ b/requirements_dev.txt @@ -32,6 +32,6 @@ snowballstemmer==1.2.1 Sphinx==1.8.1 sphinxcontrib-websupport==1.1.0 tox==3.5.2 -urllib3==1.22 +urllib3==1.24 virtualenv==16.0.0 watchdog==0.9.0