Skip to content
This repository was archived by the owner on May 23, 2023. It is now read-only.

Commit 6bfc645

Browse files
vubvub
authored andcommitted
Merge branch 'develop' of github.com:ethereum/pyethereum into develop
2 parents bc59edb + 613b25e commit 6bfc645

File tree

11 files changed

+64
-22
lines changed

11 files changed

+64
-22
lines changed

.travis.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,13 @@ script:
1515

1616
after_success:
1717
- coveralls
18+
19+
deploy:
20+
provider: pypi
21+
user: ethereum_pypi_automated
22+
password:
23+
secure: "FvkEn1xULi9mGxAL9sKlTuxJZvk0Uyd2GaDPAHN5ZAfaJUNwzA6+m7PRAMPd44Uy/LOw0+Ah9X1rxAxZc+7yx+FJjwH1Nl8MjtqYTWp+Ue6TFUNdJXNHjekC5ce4rbULudrqlmwmaWzi5iRC7qhpxuTg1y3iBw3Fsd8E82qbDac="
24+
on:
25+
tags: true
26+
repo: ethereum/pyethereum
27+
branch: develop

dev_requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ tox
22
coveralls
33
pytest
44
pytest-catchlog==1.1
5-
pytest-timeout
5+
pytest-timeout==0.5
66
https://github.com/ethereum/serpent/tarball/develop

ethereum/__init__.py

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,40 @@
1+
# -*- coding: utf-8 -*-
12
# ############# version ##################
23
from pkg_resources import get_distribution, DistributionNotFound
34
import os.path
5+
import subprocess
6+
import re
7+
8+
9+
GIT_DESCRIBE_RE = re.compile('^(?P<version>v\d+\.\d+\.\d+)-(?P<git>\d+-g[a-fA-F0-9]+(?:-dirty)?)$')
10+
11+
12+
__version__ = None
413
try:
5-
_dist = get_distribution('ethereum')
14+
_dist = get_distribution('pyethapp')
615
# Normalize case for Windows systems
716
dist_loc = os.path.normcase(_dist.location)
817
here = os.path.normcase(__file__)
9-
if not here.startswith(os.path.join(dist_loc, 'ethereum')):
18+
if not here.startswith(os.path.join(dist_loc, 'pyethapp')):
1019
# not installed, but there is another version that *is*
1120
raise DistributionNotFound
12-
except DistributionNotFound:
13-
__version__ = 'Please install this project with setup.py'
14-
else:
1521
__version__ = _dist.version
22+
except DistributionNotFound:
23+
pass
24+
25+
if not __version__:
26+
try:
27+
rev = subprocess.check_output(['git', 'describe', '--tags', '--dirty'],
28+
stderr=subprocess.STDOUT)
29+
match = GIT_DESCRIBE_RE.match(rev)
30+
if match:
31+
__version__ = "{}+git-{}".format(match.group("version"), match.group("git"))
32+
except:
33+
pass
34+
35+
if not __version__:
36+
__version__ = 'undefined'
37+
1638
# ########### endversion ##################
1739

1840
'''from ethereum import utils

ethereum/ethash_utils.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
import sha3
1+
from Crypto.Hash import keccak
2+
sha3_256 = lambda x: keccak.new(digest_bits=256, data=x)
3+
sha3_512 = lambda x: keccak.new(digest_bits=512, data=x)
24
from rlp.utils import decode_hex, encode_hex
35
import sys
46

@@ -59,11 +61,11 @@ def to_bytes(x):
5961

6062
# sha3 hash function, outputs 64 bytes
6163
def sha3_512(x):
62-
return hash_words(lambda v: sha3.sha3_512(to_bytes(v)).digest(), 64, x)
64+
return hash_words(sha3_512(to_bytes(v)).digest(), 64, x)
6365

6466

6567
def sha3_256(x):
66-
return hash_words(lambda v: sha3.sha3_256(to_bytes(v)).digest(), 32, x)
68+
return hash_words(sha3_256(to_bytes(v)).digest(), 32, x)
6769

6870

6971
def xor(a, b):

ethereum/ethpow.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import time
33
import sys
44
import sha3
5+
import warnings
56
from collections import OrderedDict
67
from ethereum.slogging import get_logger
78

@@ -15,10 +16,9 @@
1516
try:
1617
import pyethash
1718
ETHASH_LIB = 'pyethash' # the C++ based implementation
18-
log.warn('using C++ implementation')
1919
except ImportError:
2020
ETHASH_LIB = 'ethash'
21-
log.warn('using pure python implementation')
21+
warnings.warn('using pure python implementation', ImportWarning)
2222

2323
if ETHASH_LIB == 'ethash':
2424
mkcache = ethash.mkcache

ethereum/keys.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@
2323
import binascii
2424
import struct
2525
from math import ceil
26-
from sha3 import sha3_256
26+
from Crypto.Hash import keccak
27+
sha3_256 = lambda x: keccak.new(digest_bits=256, data=x)
2728
from Crypto.Cipher import AES
2829
from Crypto.Hash import SHA256
2930
from Crypto.Util import Counter

ethereum/transactions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ def intrinsic_gas_used(self):
144144
@property
145145
def creates(self):
146146
"returns the address of a contract created by this tx"
147-
if self.to == '':
147+
if self.to in (b'', '\0'*20):
148148
return mk_contract_address(self.sender, self.nonce)
149149

150150

ethereum/utils.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
1-
try:
2-
from keccak import sha3_256 # pypy
3-
except ImportError:
4-
from sha3 import sha3_256 as _sha3_256
5-
sha3_256 = lambda x: _sha3_256(x).digest()
1+
from Crypto.Hash import keccak
2+
sha3_256 = lambda x: keccak.new(digest_bits=256, data=x).digest()
63
from bitcoin import privtopub
74
import sys
85
import rlp

requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ pysha3
33
PyYAML
44
repoze.lru
55
pbkdf2
6-
pycrypto
6+
pycryptodome>=3.3.1
77
scrypt
8-
https://github.com/ethereum/pyrlp/tarball/develop
8+
rlp==0.4.4
99
https://github.com/ethereum/ethash/tarball/master

setup.cfg

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[bumpversion]
2+
current_version = 1.0.8
3+
commit = True
4+
tag = True
5+
6+
[bumpversion:file:setup.py]
7+
search = version = "{current_version}"
8+

0 commit comments

Comments
 (0)