mirror of
https://github.com/bigchaindb/bigchaindb.git
synced 2024-10-13 13:34:05 +00:00
PR Feedback for docs
This commit is contained in:
parent
b42eec93c7
commit
37cf057b99
@ -248,9 +248,6 @@ class Block(object):
|
|||||||
def from_dict(cls, block_body):
|
def from_dict(cls, block_body):
|
||||||
"""Transforms a Python dictionary to a Block object.
|
"""Transforms a Python dictionary to a Block object.
|
||||||
|
|
||||||
Note:
|
|
||||||
Throws errors if passed signature or id is incorrect.
|
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
block_body (dict): A block dictionary to be transformed.
|
block_body (dict): A block dictionary to be transformed.
|
||||||
|
|
||||||
@ -299,13 +296,13 @@ class Block(object):
|
|||||||
return self.to_dict()['id']
|
return self.to_dict()['id']
|
||||||
|
|
||||||
def to_dict(self):
|
def to_dict(self):
|
||||||
"""Transforms the object to a Python dictionary.
|
"""Transforms the Block to a Python dictionary.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
dict: The Block as an alternative serialization format.
|
dict: The Block as a dict.
|
||||||
|
|
||||||
Raises:
|
Raises:
|
||||||
OperationError: If a Block doesn't contain any transactions.
|
OperationError: If the Block doesn't contain any transactions.
|
||||||
"""
|
"""
|
||||||
if len(self.transactions) == 0:
|
if len(self.transactions) == 0:
|
||||||
raise OperationError('Empty block creation is not allowed')
|
raise OperationError('Empty block creation is not allowed')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user