Skip to content

Commit

Permalink
Merge pull request #4 from smarx/os
Browse files Browse the repository at this point in the history
Change check for MacOS
  • Loading branch information
timbeiko committed Sep 14, 2018
2 parents 7a60318 + 53c67b9 commit 76a6544
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions evm_transition.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import json
import os
import subprocess
import sys

from blocks import *
from web3 import Web3
Expand All @@ -16,7 +17,7 @@
abi = json.loads('[{"constant":false,"inputs":[{"name":"_shard_ID","type":"uint256"},{"name":"_sendGas","type":"uint256"},{"name":"_sendToAddress","type":"address"},{"name":"_data","type":"bytes"}],"name":"send","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"anonymous":false,"inputs":[{"indexed":true,"name":"shard_ID","type":"uint256"},{"indexed":false,"name":"sendGas","type":"uint256"},{"indexed":false,"name":"sendFromAddress","type":"address"},{"indexed":true,"name":"sendToAddress","type":"address"},{"indexed":false,"name":"value","type":"uint256"},{"indexed":false,"name":"data","type":"bytes"},{"indexed":true,"name":"base","type":"uint256"},{"indexed":false,"name":"TTL","type":"uint256"}],"name":"SentMessage","type":"event"}]')

evm_path = './evm-ubuntu'
if(os.getenv("_system_type")):
if (sys.platform == 'darwin'):
evm_path = './evm-macos'

contract = web3.eth.contract(address='0x000000000000000000000000000000000000002A', abi=abi)
Expand Down Expand Up @@ -102,11 +103,7 @@ def apply_to_state(pre_state, tx, received_log):
evm = subprocess.Popen([evm_path, 'apply', '/dev/stdin'], stdin=subprocess.PIPE, stdout=subprocess.PIPE)

# pipe state into that process
# print(transition_inputs)
# print("hello")
# print(type(evm.communicate(json.dumps(transition_inputs).encode())[0]))
# print((evm.communicate(json.dumps(transition_inputs).encode())[0]))
# print("in1")
print(transition_inputs)

out = evm.communicate(json.dumps(transition_inputs).encode())[0].decode('utf-8')
# print("out2", out)
Expand Down

0 comments on commit 76a6544

Please sign in to comment.