-
Notifications
You must be signed in to change notification settings - Fork 959
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add pylint
to catch unused args
#2803
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -514,7 +514,7 @@ def get_pow_block(hash: Bytes32) -> Optional[PowBlock]: | |
return PowBlock(block_hash=hash, parent_hash=Bytes32(), total_difficulty=uint256(0)) | ||
|
||
|
||
def get_execution_state(execution_state_root: Bytes32) -> ExecutionState: | ||
def get_execution_state(_execution_state_root: Bytes32) -> ExecutionState: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this satisfy |
||
pass | ||
|
||
|
||
|
@@ -1008,7 +1008,7 @@ def run(self): | |
python_requires=">=3.8, <4", | ||
extras_require={ | ||
"test": ["pytest>=4.4", "pytest-cov", "pytest-xdist"], | ||
"lint": ["flake8==3.7.7", "mypy==0.812"], | ||
"lint": ["flake8==3.7.7", "mypy==0.812", "pylint==2.12.2"], | ||
"generator": ["python-snappy==0.5.4"], | ||
}, | ||
install_requires=[ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -521,7 +521,7 @@ def process_deposit(state: BeaconState, deposit: Deposit) -> None: | |
signing_root = compute_signing_root(deposit_message, domain) | ||
# Initialize validator if the deposit signature is valid | ||
if bls.Verify(pubkey, signing_root, deposit.data.signature): | ||
state.validators.append(get_validator_from_deposit(state, deposit)) | ||
state.validators.append(get_validator_from_deposit(deposit)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. update from phase0 as well |
||
state.balances.append(amount) | ||
state.previous_epoch_participation.append(ParticipationFlags(0b0000_0000)) | ||
state.current_epoch_participation.append(ParticipationFlags(0b0000_0000)) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1832,7 +1832,7 @@ def process_attestation(state: BeaconState, attestation: Attestation) -> None: | |
##### Deposits | ||
|
||
```python | ||
def get_validator_from_deposit(state: BeaconState, deposit: Deposit) -> Validator: | ||
def get_validator_from_deposit(deposit: Deposit) -> Validator: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this does change the phase0 specs BUT no substantive change to functionality, just a code cleanup |
||
amount = deposit.data.amount | ||
effective_balance = min(amount - amount % EFFECTIVE_BALANCE_INCREMENT, MAX_EFFECTIVE_BALANCE) | ||
|
||
|
@@ -1877,7 +1877,7 @@ def process_deposit(state: BeaconState, deposit: Deposit) -> None: | |
return | ||
|
||
# Add validator and balance entries | ||
state.validators.append(get_validator_from_deposit(state, deposit)) | ||
state.validators.append(get_validator_from_deposit(deposit)) | ||
state.balances.append(amount) | ||
else: | ||
# Increase balance by deposit amount | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pylint
adds a bunch of stuff we are not following wrt style, so instead wedisable=all
and then only enable the thing we want, which is theunused-argument
linter