Skip to content
This repository has been archived by the owner on Aug 29, 2023. It is now read-only.

Commit

Permalink
python3.4 fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Eugene Yurtaev committed Apr 4, 2016
1 parent 58dd5cd commit 563fc93
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions connectionToContract.py → wavesPresale.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from API import API
import binascii

base_address = "0x82e1c8c4c38f5c0767f7c426e235f194010b71e9"
contract_address = "0xac64a5168144734f0d688D689c730A519844D0c5"
Expand All @@ -11,8 +12,9 @@ def logSale(bitcoin_tx_id, amount):
definition = "newSale(bytes32,uint256)"
method_id = api.getMethodId(definition)
amount = abs(int(amount * (10 ** 8)))
amount_bytes = amount.to_bytes(32, byteorder='big').hex()
data = "0x" + method_id + bitcoin_tx_id + amount_bytes
amount_bytes = amount.to_bytes(32, byteorder='big')
amount_string = str(binascii.b2a_hex(amount_bytes), 'ascii')
data = "0x" + method_id + bitcoin_tx_id + amount_string

gas_price = hex(api.getGasPrice()["result"])
response = api.send_transaction(base_address, contract_address,
Expand Down

0 comments on commit 563fc93

Please sign in to comment.