Skip to content

Commit

Permalink
Fix #810 Codebase has many pylint errors (PR #811)
Browse files Browse the repository at this point in the history
  • Loading branch information
trentmc authored Mar 16, 2024
1 parent 2a9baec commit db12159
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pylint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ jobs:
- name: Run Pylint
run: |
pylint --rcfile .pylintrc *
pylint --recursive=true --rcfile .pylintrc *
3 changes: 3 additions & 0 deletions df_py/util/dftool_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -1072,7 +1072,10 @@ def _getSecretSeedOrExit() -> int:
def _getPrivateAccount():
private_key = os.getenv("DFTOOL_KEY")
assert private_key is not None, "Need to set envvar DFTOOL_KEY"

# pylint: disable=no-value-for-parameter
account = Account.from_key(private_key=private_key)

print(f"For private key DFTOOL_KEY, address is: {account.address}")
return account

Expand Down
2 changes: 2 additions & 0 deletions df_py/util/http_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ def make_request(self, method, params):
"Making request HTTP. URI: %s, Method: %s", self.endpoint_uri, method
)
request_data = self.encode_rpc_request(method, params)

# pylint: disable=not-a-mapping
raw_response = make_post_request(
self.endpoint_uri, request_data, **self.get_request_kwargs()
)
Expand Down
13 changes: 8 additions & 5 deletions df_py/util/oceantestutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,11 +248,14 @@ def random_lock_and_allocate(web3, tups: list):


def get_account0():
return Account.from_key(private_key=os.getenv("TEST_PRIVATE_KEY0"))
return _account(0)


def get_all_accounts():
return [
Account.from_key(private_key=os.getenv(f"TEST_PRIVATE_KEY{index}"))
for index in range(0, 9)
]
return [_account(index) for index in range(9)]


# pylint: disable=no-value-for-parameter
def _account(index: int):
private_key = os.getenv(f"TEST_PRIVATE_KEY{index}")
return Account.from_key(private_key=private_key)
2 changes: 1 addition & 1 deletion df_py/util/oceanutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ def get_zero_provider_fee_dict(web3: Web3, provider_account) -> Dict[str, Any]:
provider_fee_token = ZERO_ADDRESS
valid_until = 0

message = Web3.solidity_keccak(
message = Web3.solidity_keccak( # pylint: disable=no-value-for-parameter
["bytes", "address", "address", "uint256", "uint256"],
[
Web3.to_hex(Web3.to_bytes(text=provider_data)),
Expand Down
1 change: 1 addition & 0 deletions df_py/util/request.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ def _remove_session(key, session):
session.close()


# pylint: disable=c-extension-no-member
_session_cache = lru.LRU(8, callback=_remove_session)


Expand Down

0 comments on commit db12159

Please sign in to comment.