mirror of
https://github.com/bigchaindb/bigchaindb.git
synced 2024-10-13 13:34:05 +00:00
treat genesis block as valid (#433)
This commit is contained in:
@@ -129,7 +129,7 @@ class BaseConsensusRules(AbstractConsensusRules):
|
||||
|
||||
# If the operation is CREATE the transaction should have no inputs and
|
||||
# should be signed by a federation node
|
||||
if transaction['transaction']['operation'] == 'CREATE':
|
||||
if transaction['transaction']['operation'] in ('CREATE', 'GENESIS'):
|
||||
# TODO: for now lets assume a CREATE transaction only has one fulfillment
|
||||
if transaction['transaction']['fulfillments'][0]['input']:
|
||||
raise ValueError('A CREATE operation has no inputs')
|
||||
|
||||
@@ -259,7 +259,9 @@ class TestBigchainApi(object):
|
||||
genesis = list(r.table('bigchain')
|
||||
.filter(r.row['block_number'] == 0)
|
||||
.run(b.conn))[0]
|
||||
assert b.get_last_voted_block() == genesis
|
||||
gb = b.get_last_voted_block()
|
||||
assert gb == genesis
|
||||
assert b.validate_block(gb) == gb
|
||||
|
||||
def test_get_last_voted_block_returns_the_correct_block(self, b):
|
||||
genesis = b.create_genesis_block()
|
||||
|
||||
Reference in New Issue
Block a user