Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions raiden/network/rpc/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,7 @@ def deploy_contract(self, contract_name, contract_file, constructor_parameters=N
contracts,
dict(),
constructor_parameters,
contract_path=contract_path,
gasprice=default_gasprice,
timeout=self.poll_timeout,
)
Expand Down
1 change: 1 addition & 0 deletions raiden/tests/fixtures/blockchain.py
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,7 @@ def _jsonrpc_services(
registry_contracts,
dict(),
tuple(),
contract_path=registry_path,
gasprice=default_gasprice,
timeout=poll_timeout,
)
Expand Down
5 changes: 4 additions & 1 deletion raiden/tests/integration/test_blockchainservice.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

from raiden.network.rpc.client import decode_topic, patch_send_transaction
from raiden.utils import privatekey_to_address, get_contract_path
from raiden.blockchain.abi import CHANNEL_MANAGER_ABI

solidity = _solidity.get_solidity() # pylint: disable=invalid-name

Expand Down Expand Up @@ -191,6 +192,7 @@ def test_blockchain(
humantoken_contracts,
dict(),
(total_asset, 'raiden', 2, 'Rd'),
contract_path=humantoken_path,
gasprice=default_gasprice,
timeout=poll_timeout,
)
Expand All @@ -203,6 +205,7 @@ def test_blockchain(
registry_contracts,
dict(),
tuple(),
contract_path=registry_path,
gasprice=default_gasprice,
timeout=poll_timeout,
)
Expand Down Expand Up @@ -258,7 +261,7 @@ def test_blockchain(
assert token_proxy.address == event['asset_address'].decode('hex')

channel_manager_proxy = jsonrpc_client.new_contract_proxy(
registry_contracts['ChannelManagerContract']['abi'],
CHANNEL_MANAGER_ABI,
channel_manager_address,
)

Expand Down
4 changes: 3 additions & 1 deletion raiden/ui/console.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,12 +179,14 @@ def create_token(
Returns:
token_address: the hex encoded address of the new token/asset.
"""
contract_path = get_contract_path('HumanStandardToken.sol')
# Deploy a new ERC20 token
token_proxy = self._chain.client.deploy_solidity_contract(
self._raiden.address, 'HumanStandardToken',
compile_file(get_contract_path('HumanStandardToken.sol')),
compile_file(contract_path),
dict(),
(initial_alloc, name, decimals, symbol),
contract_path=contract_path,
gasprice=gasprice,
timeout=timeout)
token_address = token_proxy.address.encode('hex')
Expand Down
7 changes: 4 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
pysha3
# temporary until https://github.com/ethereum/pyethapp/pull/184 comes upstream (see also setup.py)
-e git+https://github.com/konradkonrad/pyethapp@71f940c6d287b98a35ef524f4c5e3c13d530bfc5#egg=pyethapp
# temporary until new version of pyethereum is released, that supports solc >= v0.4.9
-e git+https://github.com/LefterisJP/pyethapp@use_new_solc_combinedjson_key#egg=pyethapp
ipython<5.0.0
rlp>=0.4.3,<=0.4.6
secp256k1==0.12.1
pycryptodome>=3.4.3
miniupnpc
networkx
ethereum>=1.3.2
# temporary until new version of pyethereum is released, that supports solc >= v0.4.9
-e git+https://github.com/LefterisJP/pyethereum@fix_solidity_key_combinedjson#egg=ethereum
ethereum-serpent
repoze.lru
gevent-websocket==0.9.4
Expand Down
6 changes: 4 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,14 @@ def run_tests(self):


install_requires_replacements = {
"-e git+https://github.com/konradkonrad/pyethapp@71f940c6d287b98a35ef524f4c5e3c13d530bfc5#egg=pyethapp": "pyethapp"
# "-e git+https://github.com/konradkonrad/pyethapp@71f940c6d287b98a35ef524f4c5e3c13d530bfc5#egg=pyethapp": "pyethapp",
"-e git+https://github.com/LefterisJP/pyethapp@use_new_solc_combinedjson_key#egg=pyethapp": "pyethapp",
"-e git+https://github.com/LefterisJP/pyethereum@fix_solidity_key_combinedjson#egg=ethereum": "ethereum"
}

install_requires = list(set(
install_requires_replacements.get(requirement.strip(), requirement.strip())
for requirement in open('requirements.txt')
for requirement in open('requirements.txt') if not requirement.lstrip().startswith('#')
))

test_requirements = []
Expand Down
1 change: 1 addition & 0 deletions tools/deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ def deploy_files(contract_files, client):
compiled_contracts,
libraries,
'',
contract_path=c,
gasprice=default_gasprice
)
libraries[name] = proxy.address
Expand Down
17 changes: 11 additions & 6 deletions tools/init_blockchain.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,26 +22,31 @@ def connect(host='127.0.0.1',
return client


def create_and_distribute_token(client, receivers,
amount_per_receiver=1000,
name=None,
gasprice=default_gasprice,
timeout=120):
def create_and_distribute_token(
client,
receivers,
amount_per_receiver=1000,
name=None,
gasprice=default_gasprice,
timeout=120
):
"""Create a new ERC-20 token and distribute it among `receivers`.
If `name` is None, the name will be derived from hashing all receivers.
"""
name = name or sha3(''.join(receivers)).encode('hex')
contract_path = get_contract_path('HumanStandardToken.sol')
token_proxy = client.deploy_solidity_contract(
client.sender,
'HumanStandardToken',
compile_file(get_contract_path('HumanStandardToken.sol')),
compile_file(contract_path),
dict()
(
len(receivers) * amount_per_receiver,
name,
2, # decimals
name[:4].upper() # symbol
),
contract_path=contract_path,
gasprice=gasprice,
timeout=timeout
)
Expand Down