changes after update web3.py to 4.0.0

This commit is contained in:
Alexander Kolotov 2018-01-18 03:53:13 +03:00
parent 9973a49819
commit 705d1e6196
4 changed files with 8 additions and 8 deletions

View File

@ -11,7 +11,7 @@ _binFile=_contractName+".bin"
_IPC_file = '/home/koal/parity/PoA_foreign/jsonrpc.ipc' _IPC_file = '/home/koal/parity/PoA_foreign/jsonrpc.ipc'
web3 = Web3(Web3.IPCProvider(_IPC_file)) web3 = Web3(Web3.IPCProvider(_IPC_file))
_actor = "0xf3ee321df87781864f46f6464e764c2827fca73b" _actor = "0xf3Ee321Df87781864f46F6464e764c2827FCa73B"
_gasPrice = web3.toWei(18, 'gwei') _gasPrice = web3.toWei(18, 'gwei')
_txTempl={'from': _actor, 'gasPrice': _gasPrice} _txTempl={'from': _actor, 'gasPrice': _gasPrice}

View File

@ -11,14 +11,14 @@ _abiFile=_contractName+".abi"
_IPC_file = '/home/koal/parity/PoA_foreign/jsonrpc.ipc' _IPC_file = '/home/koal/parity/PoA_foreign/jsonrpc.ipc'
web3 = Web3(Web3.IPCProvider(_IPC_file)) web3 = Web3(Web3.IPCProvider(_IPC_file))
_actor = "0xf3ee321df87781864f46f6464e764c2827fca73b" _actor = "0xf3Ee321Df87781864f46F6464e764c2827FCa73B"
_gasPrice = web3.toWei(18, 'gwei') _gasPrice = web3.toWei(18, 'gwei')
_txTempl={'from': _actor, 'gasPrice': _gasPrice} _txTempl={'from': _actor, 'gasPrice': _gasPrice}
if (len(sys.argv) == 2): if (len(sys.argv) == 2):
contractAddress = sys.argv[1] contractAddress = sys.argv[1]
tokensRecipient = "0x554e8f65d58621cbaa1806c96898ea1b1d9c4ec1" tokensRecipient = "0x554E8f65d58621cBAa1806C96898Ea1b1D9C4EC1"
else: else:
sys.exit(1) sys.exit(1)
@ -40,12 +40,12 @@ ContractFactory = web3.eth.contract(
BridgeContract = ContractFactory(contractAddress) BridgeContract = ContractFactory(contractAddress)
tokenAmount = web3.toWei(randint(100, 2000), 'finney') tokenAmount = web3.toWei(randint(100, 900), 'finney')
fakeTxHash = web3.sha3('0x'+tokenAmount.to_bytes(32, byteorder='big').hex()) fakeTxHash = web3.sha3(tokenAmount.to_bytes(32, byteorder='big'))
print("Deposit " + str(tokenAmount) + ' tokens') print("Deposit " + str(tokenAmount) + ' tokens')
txHash = BridgeContract.transact(transaction=_txTempl).deposit(tokensRecipient, tokenAmount, bytes.fromhex(fakeTxHash[2:])) txHash = BridgeContract.transact(transaction=_txTempl).deposit(tokensRecipient, tokenAmount, fakeTxHash)
wait_for_transaction_receipt(web3, txHash) wait_for_transaction_receipt(web3, txHash)
sys.exit(0) sys.exit(0)

View File

@ -10,7 +10,7 @@ _abiFile=_contractName+".abi"
_IPC_file = '/home/koal/parity/PoA_foreign/jsonrpc.ipc' _IPC_file = '/home/koal/parity/PoA_foreign/jsonrpc.ipc'
web3 = Web3(Web3.IPCProvider(_IPC_file)) web3 = Web3(Web3.IPCProvider(_IPC_file))
_actor = "0xf3ee321df87781864f46f6464e764c2827fca73b" _actor = "0xf3Ee321Df87781864f46F6464e764c2827FCa73B"
_gasPrice = web3.toWei(18, 'gwei') _gasPrice = web3.toWei(18, 'gwei')
_txTempl={'from': _actor, 'gasPrice': _gasPrice} _txTempl={'from': _actor, 'gasPrice': _gasPrice}

View File

@ -12,7 +12,7 @@ _binFile=_tokenName+".bin"
_IPC_file = '/home/koal/parity/PoA_foreign/jsonrpc.ipc' _IPC_file = '/home/koal/parity/PoA_foreign/jsonrpc.ipc'
web3 = Web3(Web3.IPCProvider(_IPC_file)) web3 = Web3(Web3.IPCProvider(_IPC_file))
_actor = "0xf3ee321df87781864f46f6464e764c2827fca73b" _actor = "0xf3Ee321Df87781864f46F6464e764c2827FCa73B"
_gasPrice = web3.toWei(18, 'gwei') _gasPrice = web3.toWei(18, 'gwei')
_tokenAmount = 100000 _tokenAmount = 100000