mirror of
https://github.com/bigchaindb/bigchaindb.git
synced 2024-10-13 13:34:05 +00:00
fixed flake8 issues to pass CI test
Signed-off-by: Juergen Eckel <juergen@riddleandcode.com>
This commit is contained in:
parent
c269f0115c
commit
5fdea5dc3c
@ -2,8 +2,7 @@ import codecs
|
||||
import base64
|
||||
import binascii
|
||||
|
||||
from abci.types_pb2 import (Validator,
|
||||
ValidatorUpdate,
|
||||
from abci.types_pb2 import (ValidatorUpdate,
|
||||
PubKey)
|
||||
from bigchaindb.common.exceptions import InvalidPublicKey
|
||||
|
||||
@ -14,7 +13,7 @@ def encode_validator(v):
|
||||
pub_key = PubKey(type='ed25519',
|
||||
data=bytes.fromhex(ed25519_public_key))
|
||||
return ValidatorUpdate(pub_key=pub_key,
|
||||
power=v['power'])
|
||||
power=v['power'])
|
||||
|
||||
|
||||
def decode_validator(v):
|
||||
|
||||
@ -15,10 +15,8 @@ def validator_pub_key():
|
||||
|
||||
@pytest.fixture
|
||||
def init_chain_request():
|
||||
addr = codecs.decode(b'9FD479C869C7D7E7605BF99293457AA5D80C3033', 'hex')
|
||||
pk = codecs.decode(b'VAgFZtYw8bNR5TMZHFOBDWk9cAmEu3/c6JgRBmddbbI=',
|
||||
'base64')
|
||||
val_a = types.ValidatorUpdate( power=10,
|
||||
pub_key=types.PubKey(type='ed25519', data=pk))
|
||||
|
||||
val_a = types.ValidatorUpdate(power=10,
|
||||
pub_key=types.PubKey(type='ed25519', data=pk))
|
||||
return types.RequestInitChain(validators=[val_a])
|
||||
|
||||
@ -2,7 +2,6 @@
|
||||
# SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
|
||||
# Code is Apache-2.0 and docs are CC-BY-4.0
|
||||
|
||||
import codecs
|
||||
import json
|
||||
import pytest
|
||||
import random
|
||||
@ -14,7 +13,6 @@ from abci.types_pb2 import (
|
||||
RequestInfo,
|
||||
RequestBeginBlock,
|
||||
RequestEndBlock,
|
||||
Validator,
|
||||
ValidatorUpdate,
|
||||
)
|
||||
|
||||
@ -49,10 +47,9 @@ def generate_address():
|
||||
|
||||
|
||||
def generate_validator():
|
||||
addr = codecs.decode(generate_address(), 'hex')
|
||||
pk, _ = generate_key_pair()
|
||||
pub_key = PubKey(type='ed25519', data=pk.encode())
|
||||
val = ValidatorUpdate( power=10, pub_key=pub_key)
|
||||
val = ValidatorUpdate(power=10, pub_key=pub_key)
|
||||
return val
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user