mirror of
https://github.com/bigchaindb/bigchaindb.git
synced 2024-10-13 13:34:05 +00:00
* Problem: `ValidatorElection` and `MigrationElection` need to inherit from a common `Election` class. Solution: Factored the common logic out of `ValidatorElection` and moved it to `Election` parent class. * Problem: No need to store different types of elections in their own tables Solution: Remove `DB_TABLE` property from `Election` class. Solution: Created the `elections` table with secondary_index `election_id`. * Problem: `UpsertValidatorVote` can be generalized to just be `Vote` Solution: Renamed, refactored and moved the `Vote` class to tie in with the more general `Election` base class. * Problem: `election_id` is not unique if two elections have the same properties. Solution: Added a random `uuid4` seed to enforce uniqueness.
34 lines
792 B
YAML
34 lines
792 B
YAML
# Copyright BigchainDB GmbH and BigchainDB contributors
|
|
# SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
|
|
# Code is Apache-2.0 and docs are CC-BY-4.0
|
|
|
|
---
|
|
"$schema": "http://json-schema.org/draft-04/schema#"
|
|
type: object
|
|
title: Vote Schema - Vote on an election
|
|
required:
|
|
- operation
|
|
- outputs
|
|
properties:
|
|
operation:
|
|
type: string
|
|
value: "VOTE"
|
|
outputs:
|
|
type: array
|
|
items:
|
|
"$ref": "#/definitions/output"
|
|
definitions:
|
|
output:
|
|
type: object
|
|
properties:
|
|
condition:
|
|
type: object
|
|
required:
|
|
- uri
|
|
properties:
|
|
uri:
|
|
type: string
|
|
pattern: "^ni:///sha-256;([a-zA-Z0-9_-]{0,86})[?]\
|
|
(fpt=ed25519-sha-256(&)?|cost=[0-9]+(&)?|\
|
|
subtypes=ed25519-sha-256(&)?){2,3}$"
|