本文整理汇总了Python中bigchaindb.Bigchain.get_unvoted_blocks方法的典型用法代码示例。如果您正苦于以下问题:Python Bigchain.get_unvoted_blocks方法的具体用法?Python Bigchain.get_unvoted_blocks怎么用?Python Bigchain.get_unvoted_blocks使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类bigchaindb.Bigchain
的用法示例。
在下文中一共展示了Bigchain.get_unvoted_blocks方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from bigchaindb import Bigchain [as 别名]
# 或者: from bigchaindb.Bigchain import get_unvoted_blocks [as 别名]
def __init__(self, new_blocks):
"""
Create a new BlockStream instance.
Args:
new_block (queue): a queue of new blocks
"""
b = Bigchain()
self.new_blocks = new_blocks
# TODO: there might be duplicate blocks since we *first* get the changefeed and only *then* we query the
# database to get the old blocks.
# TODO how about a one liner, something like:
# self.unvoted_blocks = b.get_unvoted_blocks() if not b.federation_nodes else []
self.unvoted_blocks = []
if not b.federation_nodes:
self.unvoted_blocks = b.get_unvoted_blocks()
示例2: initial
# 需要导入模块: from bigchaindb import Bigchain [as 别名]
# 或者: from bigchaindb.Bigchain import get_unvoted_blocks [as 别名]
def initial():
"""Return unvoted blocks."""
b = Bigchain()
rs = b.get_unvoted_blocks()
return rs