Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
larsyngvelundin committed Oct 30, 2023
1 parent a5699ec commit 42b4ad8
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 160 deletions.
Binary file removed dist/web3_balancer-0.1-py3-none-any.whl
Binary file not shown.
Binary file removed dist/web3_balancer-0.1.tar.gz
Binary file not shown.
147 changes: 0 additions & 147 deletions main.py

This file was deleted.

23 changes: 16 additions & 7 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,26 @@
from setuptools import setup

from distutils.core import setup

setup(
name='web3_balancer',
packages=['web3_balancer'],
version='0.1',
description='A connection balancer for web3',
license='GNU GPL-3.0 license',
description='A balancer for web3 connections',
author='Lars Lundin',
author_email='lars.y.lundin@gmail.com',
url='https://github.com/larsyngvelundin/web3-balancer/',
packages=['src'],
package_dir={'': 'src'},
author_email='your.email@domain.com',
url='https://github.com/larsyngvelundin/web3_balancer',
download_url='https://github.com/larsyngvelundin/web3_balancer/releases/v_01.tar.gz',
keywords=['web3'],
install_requires=[
'web3',
'loguru',
],
classifiers=[
'Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
'Topic :: Software Development :: Build Tools',
'License :: OSI Approved :: GNU GPL-3.0 license',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
],
)
Empty file removed src/__init__.py
Empty file.
1 change: 1 addition & 0 deletions web3_balancer/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from web3_balancer.main import Web3_balancer, get_tor_session
11 changes: 5 additions & 6 deletions src/main.py → web3_balancer/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from loguru import logger


class Balancer():
class Web3_balancer():
def __init__(self, rpc_list, tor=False, is_contract=False, w3=None, set_net=""):
self.error_count = 0
self.curr_func = ""
Expand Down Expand Up @@ -118,17 +118,16 @@ def _call_w3_func(self, func):
self._call_w3_func(func)
if str(type(val)) == "<class 'web3._utils.datatypes.Contract'>":
logger.debug("Returning a contract balancer")
contract = Balancer(self.rpc_list, tor=self.tor,
is_contract=val, set_net=self._active_net)
contract = Web3_balancer(self.rpc_list, tor=self.tor,
is_contract=val, set_net=self._active_net)
return contract
self.error_count = 0
return (val)


url = "http://ip-api.com/json/"


def get_tor_session():
url = "http://ip-api.com/json/"

session = requests.Session()
session.proxies = {
'http': 'socks5h://localhost:9050',
Expand Down

0 comments on commit 42b4ad8

Please sign in to comment.