commit 6d673a0d8b58fe5cffc2b7338aed97a7c67c9461
parent 7afd00cfb8ca56bbd36e2fc7baf028b2519ab66a
Author: nolash <dev@holbrook.no>
Date: Fri, 30 Apr 2021 16:27:08 +0200
Update requirements
Diffstat:
3 files changed, 8 insertions(+), 105 deletions(-)
diff --git a/.gitignore b/.gitignore
@@ -0,0 +1,6 @@
+build/
+dist/
+*.egg-info
+__pycache__
+*.pyc
+gmon.out
diff --git a/python/requirements.txt b/python/requirements.txt
@@ -1,3 +1,3 @@
confini~=0.3.6rc3
-crypto-dev-signer~=0.4.14b2
-chainlib~=0.0.2a12
+crypto-dev-signer~=0.4.14b3
+chainlib~=0.0.2b1
diff --git a/python/tests/test_interface.py b/python/tests/test_interface.py
@@ -1,103 +0,0 @@
-import os
-import unittest
-import json
-import logging
-import hashlib
-
-import web3
-import eth_tester
-import eth_abi
-
-from eth_token_index import TokenUniqueSymbolIndex
-
-logging.basicConfig(level=logging.DEBUG)
-logg = logging.getLogger()
-
-logging.getLogger('web3').setLevel(logging.WARNING)
-logging.getLogger('eth.vm').setLevel(logging.WARNING)
-
-testdir = os.path.dirname(__file__)
-
-
-class Test(unittest.TestCase):
-
- contract = None
-
- def setUp(self):
- eth_params = eth_tester.backends.pyevm.main.get_default_genesis_params({
- 'gas_limit': 9000000,
- })
-
- # create store of used accounts
- #f = open(os.path.join(testdir, '../eth_token_index/data/TokenUniqueSymbolIndex.bin'), 'r')
- f = open(os.path.join(testdir, '../eth_token_index/data/TokenUniqueSymbolIndex.bin'), 'r')
- bytecode = f.read()
- f.close()
-
- #f = open(os.path.join(testdir, '../eth_token_index/data/TokenUniqueSymbolIndex.json'), 'r')
- f = open(os.path.join(testdir, '../eth_token_index/data/TokenUniqueSymbolIndex.json'), 'r')
- self.abi = json.load(f)
- f.close()
-
-
- backend = eth_tester.PyEVMBackend(eth_params)
- self.eth_tester = eth_tester.EthereumTester(backend)
- provider = web3.Web3.EthereumTesterProvider(self.eth_tester)
- self.w3 = web3.Web3(provider)
- c = self.w3.eth.contract(abi=self.abi, bytecode=bytecode)
- tx_hash = c.constructor().transact({'from': self.w3.eth.accounts[0]})
-
- r = self.w3.eth.getTransactionReceipt(tx_hash)
-
- self.address = r.contractAddress
-
-
- # create token
- f = open(os.path.join(testdir, '../eth_token_index/data/GiftableToken.bin'), 'r')
- bytecode = f.read()
- f.close()
-
- f = open(os.path.join(testdir, '../eth_token_index/data/GiftableToken.json'), 'r')
- self.abi_token = json.load(f)
- f.close()
-
- t = self.w3.eth.contract(abi=self.abi_token, bytecode=bytecode)
- tx_hash = t.constructor('Foo Token', 'FOO', 18).transact({'from': self.w3.eth.accounts[0]})
-
- r = self.w3.eth.getTransactionReceipt(tx_hash)
-
- self.address_token_one = r.contractAddress
-
- t = self.w3.eth.contract(abi=self.abi_token, bytecode=bytecode)
- tx_hash = t.constructor('Bar Token', 'BAR', 18).transact({'from': self.w3.eth.accounts[0]})
-
- r = self.w3.eth.getTransactionReceipt(tx_hash)
-
- self.address_token_two = r.contractAddress
-
- t = self.w3.eth.contract(abi=self.abi_token, bytecode=bytecode)
- tx_hash = t.constructor('Bar Token Duplicate', 'BAR', 18).transact({'from': self.w3.eth.accounts[0]})
-
- r = self.w3.eth.getTransactionReceipt(tx_hash)
-
- self.address_token_three = r.contractAddress
-
-
- def tearDown(self):
- pass
-
-
- def test_basic(self):
- ifc = TokenUniqueSymbolIndex(self.w3, self.address)
-
- logg.info('tx {}'.format(ifc.add(self.address_token_one)))
- logg.info('tx {}'.format(ifc.add(self.address_token_two)))
-
- assert ifc.count() == 2
-
- assert ifc.get_index(0) == self.address_token_one
- assert ifc.get_index(1) == self.address_token_two
-
-
-if __name__ == '__main__':
- unittest.main()