eth-owned

EIP-173 interface and tools for chainlib-eth
git clone git://holbrook.no/eth-owned.git
Log | Files | Refs

commit eb2f0cb633649ed52511bbdfa5e069dd9e807d2f
parent 4eece2e580f2b2c60ed9cfecf5015c5d2eecb432
Author: nolash <dev@holbrook.no>
Date:   Sun, 24 Oct 2021 16:09:28 +0200

Upgrade chainlib, replace signer

Diffstat:
Mpython/eth_owned/runnable/owner.py | 8++++----
Mpython/eth_owned/runnable/void.py | 6+++---
Mpython/eth_owned/runnable/void_deploy.py | 6+++---
Mpython/requirements.txt | 4++--
Mpython/run_tests.sh | 2++
Mpython/setup.cfg | 2+-
Mpython/tests/test_owned.py | 7++++---
Mpython/tests/test_void.py | 9++++++---
8 files changed, 25 insertions(+), 19 deletions(-)

diff --git a/python/eth_owned/runnable/owner.py b/python/eth_owned/runnable/owner.py @@ -12,15 +12,15 @@ import json import argparse import logging -# third-party imports -from crypto_dev_signer.eth.signer import ReferenceSigner as EIP155Signer -from crypto_dev_signer.keystore.dict import DictKeystore +# external imports +from funga.eth.signer import EIP155Signer +from funga.eth.keystore.dict import DictKeystore from chainlib.chain import ChainSpec from chainlib.eth.connection import EthHTTPConnection from chainlib.error import JSONRPCException # local imports -from eth_owned import Owned +from eth_owned.owned import Owned logging.basicConfig(level=logging.WARNING) logg = logging.getLogger() diff --git a/python/eth_owned/runnable/void.py b/python/eth_owned/runnable/void.py @@ -12,9 +12,9 @@ import json import argparse import logging -# third-party imports -from crypto_dev_signer.eth.signer import ReferenceSigner as EIP155Signer -from crypto_dev_signer.keystore.dict import DictKeystore +# external imports +from funga.eth.signer import EIP155Signer +from funga.eth.keystore.dict import DictKeystore from chainlib.chain import ChainSpec from chainlib.eth.nonce import ( RPCNonceOracle, diff --git a/python/eth_owned/runnable/void_deploy.py b/python/eth_owned/runnable/void_deploy.py @@ -12,9 +12,9 @@ import json import argparse import logging -# third-party imports -from crypto_dev_signer.eth.signer import ReferenceSigner as EIP155Signer -from crypto_dev_signer.keystore.dict import DictKeystore +# external imports +from funga.eth.signer import EIP155Signer +from funga.eth.keystore.dict import DictKeystore from chainlib.chain import ChainSpec from chainlib.eth.nonce import ( RPCNonceOracle, diff --git a/python/requirements.txt b/python/requirements.txt @@ -1,3 +1,3 @@ confini>=0.3.6rc3,<0.5.0 -chainlib-eth>=0.0.9a3,<0.1.0 -crypto-dev-signer>=0.4.15a1,<=0.4.15 +chainlib-eth>=0.0.10a6,<0.1.0 +funga-eth==0.5.1a2 diff --git a/python/run_tests.sh b/python/run_tests.sh @@ -2,6 +2,8 @@ set -e set -x +default_pythonpath=$PYTHONPATH:. +export PYTHONPATH=${default_pythonpath:-.} for f in `ls tests/*.py`; do python $f if [ $? -gt 0 ]; then diff --git a/python/setup.cfg b/python/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = eth-owned -version = 0.0.4a1 +version = 0.0.4a2 description = EIP 173 interface and tools author = Louis Holbrook author_email = dev@holbrook.no diff --git a/python/tests/test_owned.py b/python/tests/test_owned.py @@ -12,6 +12,7 @@ from chainlib.eth.tx import ( TxFactory, receipt, ) +from hexathon import strip_0x # local imports from eth_owned.owned import ( @@ -54,7 +55,7 @@ class TestOwned(EthTesterCase): o = c.owner(self.address, sender_address=self.accounts[0]) r = self.conn.do(o) owner = c.parse_owner(r) - self.assertEqual(owner, self.accounts[0]) + self.assertEqual(owner, strip_0x(self.accounts[0])) def test_transfer_ownership(self): @@ -106,7 +107,7 @@ class TestOwned(EthTesterCase): o = c.owner(self.address, sender_address=self.accounts[0]) r = self.conn.do(o) owner = c.parse_owner(r) - self.assertEqual(owner, self.accounts[1]) + self.assertEqual(owner, strip_0x(self.accounts[1])) def test_take_ownership(self): @@ -126,7 +127,7 @@ class TestOwned(EthTesterCase): o = c.owner(self.address, sender_address=self.accounts[0]) r = self.conn.do(o) owner = c.parse_owner(r) - self.assertEqual(owner, self.address) + self.assertEqual(owner, strip_0x(self.address)) if __name__ == '__main__': diff --git a/python/tests/test_void.py b/python/tests/test_void.py @@ -22,7 +22,10 @@ from chainlib.eth.contract import ( from chainlib.eth.contract import ( ABIContractEncoder, ) -from hexathon import add_0x +from hexathon import ( + add_0x, + strip_0x, + ) # local imports from eth_owned.void import VoidOwner @@ -91,7 +94,7 @@ class Test(EthTesterCase): o = c.owner(self.owned_demo_address, sender_address=self.accounts[0]) r = self.conn.do(o) owner_address = abi_decode_single(ABIContractType.ADDRESS, r) - self.assertEqual(owner_address, self.accounts[1]) + self.assertEqual(owner_address, strip_0x(self.accounts[1])) def test_void(self): @@ -117,7 +120,7 @@ class Test(EthTesterCase): r = self.conn.do(o) owner_address = abi_decode_single(ABIContractType.ADDRESS, r) - self.assertEqual(owner_address, self.address) + self.assertEqual(owner_address, strip_0x(self.address)) if __name__ == '__main__':