当前位置: 首页>>代码示例>>Python>>正文


Python Bigchain.verify_signature方法代码示例

本文整理汇总了Python中bigchaindb.Bigchain.verify_signature方法的典型用法代码示例。如果您正苦于以下问题:Python Bigchain.verify_signature方法的具体用法?Python Bigchain.verify_signature怎么用?Python Bigchain.verify_signature使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在bigchaindb.Bigchain的用法示例。


在下文中一共展示了Bigchain.verify_signature方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: remaining

# 需要导入模块: from bigchaindb import Bigchain [as 别名]
# 或者: from bigchaindb.Bigchain import verify_signature [as 别名]
threshold_fulfillment.subconditions = []

# sign and add the subconditions until threshold of 2 is reached
subfulfillment1.sign(threshold_tx_fulfillment_message, crypto.SigningKey(thresholduser1_priv))
threshold_fulfillment.add_subfulfillment(subfulfillment1)
subfulfillment2.sign(threshold_tx_fulfillment_message, crypto.SigningKey(thresholduser2_priv))
threshold_fulfillment.add_subfulfillment(subfulfillment2)

# Add remaining (unfulfilled) fulfillment as a condition
threshold_fulfillment.add_subcondition(subfulfillment3.condition)

assert threshold_fulfillment.validate(threshold_tx_fulfillment_message) == True

threshold_tx_transfer['transaction']['fulfillments'][0]['fulfillment'] = threshold_fulfillment.serialize_uri()

assert b.verify_signature(threshold_tx_transfer) == True

assert b.validate_transaction(threshold_tx_transfer) == threshold_tx_transfer

b.write_transaction(threshold_tx_transfer)

print(json.dumps(threshold_tx_transfer, sort_keys=True, indent=4, separators=(',', ':')))

"""
Hashlocked Conditions
"""

# Create a hash-locked asset without any new_owners
hashlock_tx = b.create_transaction(b.me, None, None, 'CREATE')

# Define a secret that will be hashed - fulfillments need to guess the secret
开发者ID:dangerousbeans,项目名称:bigchaindb,代码行数:33,代码来源:run_doc_python_server_api_examples.py


注:本文中的bigchaindb.Bigchain.verify_signature方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。