mirror of
https://github.com/bigchaindb/bigchaindb.git
synced 2024-10-13 13:34:05 +00:00
fixed API adjustments due to Tendermint upgrade
Signed-off-by: Juergen Eckel <juergen@riddleandcode.com>
This commit is contained in:
parent
14c9a05a6a
commit
f63af8b102
@ -3,6 +3,7 @@ import base64
|
||||
import binascii
|
||||
|
||||
from abci.types_pb2 import (Validator,
|
||||
ValidatorUpdate,
|
||||
PubKey)
|
||||
from bigchaindb.common.exceptions import InvalidPublicKey
|
||||
|
||||
@ -12,8 +13,7 @@ def encode_validator(v):
|
||||
# NOTE: tendermint expects public to be encoded in go-amino format
|
||||
pub_key = PubKey(type='ed25519',
|
||||
data=bytes.fromhex(ed25519_public_key))
|
||||
return Validator(pub_key=pub_key,
|
||||
address=b'',
|
||||
return ValidatorUpdate(pub_key=pub_key,
|
||||
power=v['power'])
|
||||
|
||||
|
||||
|
||||
@ -18,7 +18,7 @@ def init_chain_request():
|
||||
addr = codecs.decode(b'9FD479C869C7D7E7605BF99293457AA5D80C3033', 'hex')
|
||||
pk = codecs.decode(b'VAgFZtYw8bNR5TMZHFOBDWk9cAmEu3/c6JgRBmddbbI=',
|
||||
'base64')
|
||||
val_a = types.Validator(address=addr, power=10,
|
||||
val_a = types.ValidatorUpdate( power=10,
|
||||
pub_key=types.PubKey(type='ed25519', data=pk))
|
||||
|
||||
return types.RequestInitChain(validators=[val_a])
|
||||
|
||||
@ -15,6 +15,7 @@ from abci.types_pb2 import (
|
||||
RequestBeginBlock,
|
||||
RequestEndBlock,
|
||||
Validator,
|
||||
ValidatorUpdate,
|
||||
)
|
||||
|
||||
from bigchaindb import App
|
||||
@ -51,7 +52,7 @@ def generate_validator():
|
||||
addr = codecs.decode(generate_address(), 'hex')
|
||||
pk, _ = generate_key_pair()
|
||||
pub_key = PubKey(type='ed25519', data=pk.encode())
|
||||
val = Validator(address=addr, 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