eth-owned

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

commit a441185276ecd3ce32c30bca04345639ed7154aa
parent a215eb348f60de359680342460d51c73a03d6414
Author: nolash <dev@holbrook.no>
Date:   Mon, 28 Jun 2021 09:55:23 +0200

Move to chainlib-eth

Diffstat:
Apython/CHANGELOG | 4++++
Mpython/eth_owned/owned.py | 8+++++---
Mpython/eth_owned/void.py | 3---
Mpython/requirements.txt | 4++--
Apython/run_tests.sh | 12++++++++++++
Mpython/setup.cfg | 2+-
Mpython/tests/test_void.py | 7++-----
7 files changed, 26 insertions(+), 14 deletions(-)

diff --git a/python/CHANGELOG b/python/CHANGELOG @@ -0,0 +1,4 @@ +- 0.0.2 + * Move to chainlib-eth +- 0.0.1 + * Extract code from chainlib diff --git a/python/eth_owned/owned.py b/python/eth_owned/owned.py @@ -10,7 +10,7 @@ from chainlib.eth.contract import ( ABIContractType, abi_decode_single, ) -from chainlib.jsonrpc import jsonrpc_template +from chainlib.jsonrpc import JSONRPCRequest from chainlib.eth.tx import ( TxFactory, TxFormat, @@ -31,8 +31,9 @@ class EIP173(TxFactory): return tx - def owner(self, contract_address, sender_address=ZERO_ADDRESS): - o = jsonrpc_template() + def owner(self, contract_address, sender_address=ZERO_ADDRESS, id_generator=None): + j = JSONRPCRequest(id_generator) + o = j.template() o['method'] = 'eth_call' enc = ABIContractEncoder() enc.method('owner') @@ -41,6 +42,7 @@ class EIP173(TxFactory): tx = self.set_code(tx, data) o['params'].append(self.normalize(tx)) o['params'].append('latest') + o = j.finalize(o) return o diff --git a/python/eth_owned/void.py b/python/eth_owned/void.py @@ -15,9 +15,6 @@ from chainlib.eth.contract import ( abi_decode_single, ) from chainlib.eth.constant import ZERO_ADDRESS -from chainlib.jsonrpc import ( - jsonrpc_template, - ) from chainlib.eth.error import RequestMismatchException from hexathon import ( add_0x, diff --git a/python/requirements.txt b/python/requirements.txt @@ -1,3 +1,3 @@ confini~=0.3.6rc3 -chainlib~=0.0.3a1 -crypto-dev-signer~=0.4.14b3 +chainlib-eth~=0.0.5a1 +crypto-dev-signer~=0.4.14b6 diff --git a/python/run_tests.sh b/python/run_tests.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +set -e +set -x +for f in `ls tests/*.py`; do + python $f + if [ $? -gt 0 ]; then + exit 1 + fi +done +set +x +set +e diff --git a/python/setup.cfg b/python/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = eth-owned -version = 0.0.1a6 +version = 0.0.2a1 description = EIP 173 interface and tools author = Louis Holbrook author_email = dev@holbrook.no diff --git a/python/tests/test_void.py b/python/tests/test_void.py @@ -19,7 +19,6 @@ from chainlib.eth.contract import ( abi_decode_single, ABIContractType, ) -from chainlib.jsonrpc import jsonrpc_template from chainlib.eth.contract import ( ABIContractEncoder, ) @@ -27,10 +26,8 @@ from hexathon import add_0x # local imports from eth_owned.void import VoidOwner -from eth_owned import ( - Owned, - data_dir, - ) +from eth_owned.owned import Owned +from eth_owned import data_dir logging.basicConfig(level=logging.DEBUG) logg = logging.getLogger()