本文整理匯總了Python中bitcoin.core.CBlock.stream_serialize方法的典型用法代碼示例。如果您正苦於以下問題:Python CBlock.stream_serialize方法的具體用法?Python CBlock.stream_serialize怎麽用?Python CBlock.stream_serialize使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類bitcoin.core.CBlock
的用法示例。
在下文中一共展示了CBlock.stream_serialize方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: msg_block
# 需要導入模塊: from bitcoin.core import CBlock [as 別名]
# 或者: from bitcoin.core.CBlock import stream_serialize [as 別名]
class msg_block(MsgSerializable):
command = b"block"
def __init__(self, protover=PROTO_VERSION):
super(msg_block, self).__init__(protover)
self.block = CBlock()
@classmethod
def msg_deser(cls, f, protover=PROTO_VERSION):
c = cls()
c.block = CBlock.stream_deserialize(f)
return c
def msg_ser(self, f):
self.block.stream_serialize(f)
def __repr__(self):
return "msg_block(block=%s)" % (repr(self.block))