本文整理汇总了Python中transaction.Transaction.multisig_script方法的典型用法代码示例。如果您正苦于以下问题:Python Transaction.multisig_script方法的具体用法?Python Transaction.multisig_script怎么用?Python Transaction.multisig_script使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类transaction.Transaction
的用法示例。
在下文中一共展示了Transaction.multisig_script方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: redeem_script
# 需要导入模块: from transaction import Transaction [as 别名]
# 或者: from transaction.Transaction import multisig_script [as 别名]
def redeem_script(self, sequence):
chain, i = sequence
pubkey1 = self.get_pubkey(chain, i)
pubkey2 = self.get_pubkey2(chain, i)
pubkey3 = self.get_pubkey3(chain, i)
keys = [pubkey1, pubkey2, pubkey3]
keys.sort()
return Transaction.multisig_script(keys, 2)
示例2: createmultisig
# 需要导入模块: from transaction import Transaction [as 别名]
# 或者: from transaction.Transaction import multisig_script [as 别名]
def createmultisig(self, num, pubkeys):
assert isinstance(pubkeys, list)
redeem_script = Transaction.multisig_script(pubkeys, num)
address = hash_160_to_bc_address(hash_160(redeem_script.decode('hex')), 5)
return {'address':address, 'redeemScript':redeem_script}
示例3: pubkeys_to_address
# 需要导入模块: from transaction import Transaction [as 别名]
# 或者: from transaction.Transaction import multisig_script [as 别名]
def pubkeys_to_address(self, pubkeys):
redeem_script = Transaction.multisig_script(sorted(pubkeys), self.m)
address = hash_160_to_bc_address(hash_160(redeem_script.decode('hex')), 9)
return address
示例4: redeem_script
# 需要导入模块: from transaction import Transaction [as 别名]
# 或者: from transaction.Transaction import multisig_script [as 别名]
def redeem_script(self, for_change, n):
pubkeys = self.get_pubkeys(for_change, n)
return Transaction.multisig_script(sorted(pubkeys), self.m)
示例5: get_redeem_script
# 需要导入模块: from transaction import Transaction [as 别名]
# 或者: from transaction.Transaction import multisig_script [as 别名]
def get_redeem_script(self, sequence):
chain, i = sequence
pubkey1 = self.get_pubkey(chain, i)
pubkey2 = self.get_pubkey2(chain, i)
pubkey3 = self.get_pubkey3(chain, i)
return Transaction.multisig_script([pubkey1, pubkey2, pubkey3], 3)
示例6: createmultisig
# 需要导入模块: from transaction import Transaction [as 别名]
# 或者: from transaction.Transaction import multisig_script [as 别名]
def createmultisig(self, num, pubkeys):
"""Create multisig address"""
assert isinstance(pubkeys, list), (type(num), type(pubkeys))
redeem_script = Transaction.multisig_script(pubkeys, num)
address = hash_160_to_bc_address(hash_160(redeem_script.decode("hex")), 5)
return {"address": address, "redeemScript": redeem_script}
示例7: redeem_script
# 需要导入模块: from transaction import Transaction [as 别名]
# 或者: from transaction.Transaction import multisig_script [as 别名]
def redeem_script(self, sequence):
pubkeys = self.get_pubkeys(sequence)
return Transaction.multisig_script(pubkeys, 2)
示例8: pubkeys_to_address
# 需要导入模块: from transaction import Transaction [as 别名]
# 或者: from transaction.Transaction import multisig_script [as 别名]
def pubkeys_to_address(self, pubkeys):
redeem_script = Transaction.multisig_script(sorted(pubkeys), 2)
address = hash_160_to_bc_address(hash_160(redeem_script.decode('hex')), self.active_chain.p2sh_version)
return address