mirror of
https://github.com/bigchaindb/bigchaindb.git
synced 2024-10-13 13:34:05 +00:00
Rework upsert-validator show status (#2496)
* Problem: We need to store the `election_id` as part of the `validator_update` so we can efficiently check which election was resposible for the change Solution: Added the parameter to `store_validator_set` and aligned the tests * Problem: Logic for `upsert-validator show` is convoluted Solution: Rewrote the function to be much simpler * Problem: Need a uniqueness constraint for election_id wrt validator changes Solution: Added a new key to the db schema
This commit is contained in:
committed by
Vanshdeep Singh
parent
7a0b474d11
commit
cfc2c5900b
@@ -14,7 +14,7 @@ def test_get_validators_endpoint(b, client):
|
||||
'pub_key': {'data': '4E2685D9016126864733225BE00F005515200727FBAB1312FC78C8B76831255A',
|
||||
'type': 'ed25519'},
|
||||
'voting_power': 10}]
|
||||
b.store_validator_set(23, validator_set)
|
||||
b.store_validator_set(23, validator_set, 'election_id')
|
||||
|
||||
res = client.get(VALIDATORS_ENDPOINT)
|
||||
assert is_validator(res.json[0])
|
||||
|
||||
Reference in New Issue
Block a user