eth-interface

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

commit 95b32be2678a5008191d56273f9513e5682f45f0
parent 52d17a28ab2a42f12f146eb2d600ef009897472e
Author: lash <dev@holbrook.no>
Date:   Sun, 13 Nov 2022 17:40:57 +0000

Upgrade dependencies

Diffstat:
Apython/.gitignore | 4++++
Mpython/eth_interface/eip165.py | 9++++-----
Mpython/requirements.txt | 2+-
Apython/run_tests.sh | 14++++++++++++++
Mpython/setup.cfg | 2+-
Mpython/test_requirements.txt | 4++--
Mpython/tests/test_eip165.py | 6++++--
7 files changed, 30 insertions(+), 11 deletions(-)

diff --git a/python/.gitignore b/python/.gitignore @@ -0,0 +1,4 @@ +*.egg-info/ +__pycache__ +build/ +*.pyc diff --git a/python/eth_interface/eip165.py b/python/eth_interface/eip165.py @@ -1,11 +1,9 @@ # external imports from chainlib.eth.constant import ZERO_ADDRESS -from chainlib.jsonrpc import ( - jsonrpc_template, - ) from hexathon import ( add_0x, ) +from chainlib.jsonrpc import JSONRPCRequest from chainlib.eth.contract import ( ABIContractEncoder, ABIContractDecoder, @@ -17,8 +15,9 @@ from chainlib.eth.tx import TxFactory class EIP165(TxFactory): - def supports_interface(self, contract_address, interface_sum, sender_address=ZERO_ADDRESS): - o = jsonrpc_template() + def supports_interface(self, contract_address, interface_sum, sender_address=ZERO_ADDRESS, id_generator=None): + j = JSONRPCRequest(id_generator) + o = j.template() o['method'] = 'eth_call' enc = ABIContractEncoder() enc.method('supportsInterface') diff --git a/python/requirements.txt b/python/requirements.txt @@ -1 +1 @@ -chainlib~=0.0.3a1 +chainlib-eth~=0.4.3 diff --git a/python/run_tests.sh b/python/run_tests.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +set -e +set -x +default_pythonpath=$PYTHONPATH:. +export PYTHONPATH=${default_pythonpath:-.} +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-interface -version = 0.0.1a1 +version = 0.0.1 description = EIP165 interface author = Louis Holbrook author_email = dev@holbrook.no diff --git a/python/test_requirements.txt b/python/test_requirements.txt @@ -1,4 +1,4 @@ eth_tester==0.5.0b3 py-evm==0.3.0a20 -rlp==2.0.1 -pytest==6.0.1 +#rlp==2.0.1 +#ptest==6.0.1 diff --git a/python/tests/test_eip165.py b/python/tests/test_eip165.py @@ -3,7 +3,7 @@ import unittest import os import logging -# local imports +# external imports from chainlib.eth.unittest.ethtester import EthTesterCase from chainlib.eth.nonce import RPCNonceOracle from chainlib.eth.gas import OverrideGasOracle @@ -12,7 +12,9 @@ from chainlib.eth.tx import ( TxFactory, receipt, ) -from chainlib.eth.eip165 import EIP165 + +# local imports +from eth_interface.eip165 import EIP165 logging.basicConfig(level=logging.DEBUG) logg = logging.getLogger()