Skip to content

Commit

Permalink
Linting fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
CarlBeek committed Dec 17, 2019
1 parent 80eb721 commit c239ffb
Show file tree
Hide file tree
Showing 9 changed files with 6 additions and 12 deletions.
3 changes: 1 addition & 2 deletions scripts/build_spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,10 @@
Bytes1, Bytes4, Bytes8, Bytes32, Bytes48, Bytes96, Bitlist, Bitvector,
)
from eth2spec.utils.bls import (
Verify,
Sign,
Verify,
Aggregate,
FastAggregateVerify,
bls_aggregate_pubkeys,
)
from eth2spec.utils.hash_function import hash
Expand Down
2 changes: 1 addition & 1 deletion specs/core/0_beacon-chain.md
Original file line number Diff line number Diff line change
Expand Up @@ -1499,7 +1499,7 @@ def process_proposer_slashing(state: BeaconState, proposer_slashing: ProposerSla
message = compute_domain_wrapper_root(
object=signed_header.message,
domain=get_domain(state, DOMAIN_BEACON_PROPOSER, compute_epoch_at_slot(signed_header.message.slot)),
)
)
assert Verify(proposer.pubkey, message, signed_header.signature)

slash_validator(state, proposer_slashing.proposer_index)
Expand Down
2 changes: 1 addition & 1 deletion test_libs/pyspec/eth2spec/test/helpers/block.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def apply_sig(spec, state, signed_block, proposer_index=None):
proposer_index = get_proposer_index_maybe(spec, state, block.slot, proposer_index)
privkey = privkeys[proposer_index]
domain = spec.get_domain(state, spec.DOMAIN_BEACON_PROPOSER, spec.compute_epoch_at_slot(block.slot))
message = compute_domain_wrapper_root(block, domain)
message = spec.compute_domain_wrapper_root(block, domain)

signed_block.signature = Sign(privkey, message)

Expand Down
1 change: 0 additions & 1 deletion test_libs/pyspec/eth2spec/test/helpers/block_header.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from eth2spec.utils.bls import Sign
from eth2spec.utils.ssz.ssz_impl import hash_tree_root


def sign_block_header(spec, state, header, privkey):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,10 @@ def sign_shard_attestation(spec, beacon_state, shard_state, block, participants)
privkey,
)
)

return Aggregate(signatures)


def get_attestation_signature(spec, beacon_state, shard_state, message_hash, block_epoch, privkey):
domain=spec.get_domain(beacon_state, spec.DOMAIN_SHARD_ATTESTER, block_epoch)
domain = spec.get_domain(beacon_state, spec.DOMAIN_SHARD_ATTESTER, block_epoch)
message = spec.compute_domain_wrapper(message_hash, domain)
return Sign(privkey, message)
3 changes: 1 addition & 2 deletions test_libs/pyspec/eth2spec/test/helpers/phase1/shard_block.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ def sign_shard_block(spec, beacon_state, shard_state, block, proposer_index=None
proposer_index = spec.get_shard_proposer_index(beacon_state, shard_state.shard, block.slot)

privkey = privkeys[proposer_index]

domain=spec.get_domain(beacon_state, spec.DOMAIN_SHARD_PROPOSER, compute_epoch_of_shard_slot(block.slot))
domain = spec.get_domain(beacon_state, spec.DOMAIN_SHARD_PROPOSER, spec.compute_epoch_of_shard_slot(block.slot))
message = spec.compute_domain_wrapper(block, domain)
block.signature = Sign(privkey, message)

Expand Down
1 change: 0 additions & 1 deletion test_libs/pyspec/eth2spec/test/helpers/voluntary_exits.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from eth2spec.utils.bls import Sign
from eth2spec.utils.ssz.ssz_impl import hash_tree_root


def sign_voluntary_exit(spec, state, voluntary_exit, privkey):
Expand Down
1 change: 0 additions & 1 deletion test_libs/pyspec/eth2spec/test/sanity/test_blocks.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from copy import deepcopy

from eth2spec.utils.ssz.ssz_impl import hash_tree_root
from eth2spec.utils.bls import Sign

from eth2spec.test.helpers.state import get_balance, state_transition_and_sign_block, next_slot
Expand Down
2 changes: 1 addition & 1 deletion test_libs/pyspec/eth2spec/utils/bls.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def FastAggregateVerify(PKs, message, signature):

@only_with_bls(alt_return=STUB_PUBKEY)
def bls_aggregate_pubkeys(PKs):
return bls.aggregate_pubkeys(pubkeys)
return bls.aggregate_pubkeys(PKs)


@only_with_bls(alt_return=STUB_SIGNATURE)
Expand Down

0 comments on commit c239ffb

Please sign in to comment.