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


Python TheBDM.isSegWitEnabled方法代码示例

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


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

示例1: __init__

# 需要导入模块: from armoryengine.BDM import TheBDM [as 别名]
# 或者: from armoryengine.BDM.TheBDM import isSegWitEnabled [as 别名]
   def __init__(self, parent, main, addrtype):
      super(AddressTypeSelectDialog, self).__init__(parent, main)   
      
      self.type = "P2PKH"
      if addrtype is not None:
         self.type = addrtype
      
      #p2pkh
      self.radioP2PKH = QRadioButton(self.tr("P2PKH Address"))
      p2pkhDescr = QLabel(self.tr('Legacy Armory address type. Backwards compatible.'))
      
      frmP2PKH = QFrame()
      frmP2PKH.setFrameStyle(STYLE_RAISED)
      p2pkhLayout = QGridLayout()
      p2pkhLayout.addWidget(self.radioP2PKH, 0, 0, 1, 1)
      p2pkhLayout.addWidget(p2pkhDescr, 1, 0, 1, 1)
      frmP2PKH.setLayout(p2pkhLayout)
      
      def setP2PKH():
         self.selectType('P2PKH')
      
      self.connect(self.radioP2PKH, SIGNAL('clicked()'), setP2PKH)
      
      #nested p2wpkh
      self.radioSW = QRadioButton(self.tr("P2SH-P2WPKH address"))
      swDescr = QLabel(self.tr('P2WPKH (SegWit script) nested in P2SH script. Any wallet can pay to '
         'this address. Only wallets supporting SegWit can spend from it.'))
      
      frmSW = QFrame()
      frmSW.setFrameStyle(STYLE_RAISED)
      swLayout = QGridLayout()
      swLayout.addWidget(self.radioSW, 0, 0, 1, 1)
      swLayout.addWidget(swDescr, 1, 0, 1, 1)
      frmSW.setLayout(swLayout)

      if TheBDM.isSegWitEnabled() == False:
         frmSW.setDisabled(True)
      
      def setSW():
         self.selectType('P2SH-P2WPKH')
      
      self.connect(self.radioSW, SIGNAL('clicked()'), setSW)
      
      #nested p2pk
      self.radioNP2PK = QRadioButton(self.tr("P2SH-P2PK address"))
      np2pkDescr = QLabel(self.tr('Compressed P2PK script nested in P2SH output. Any wallet can pay to this '
         'address. Only Armory 0.96+ can spend from it.<br><br>'
         
         'This format allow for more efficient transaction space use, resulting in '
         'smaller inputs and lower fees.'))
      
      frmNP2PK = QFrame()
      frmNP2PK.setFrameStyle(STYLE_RAISED)
      np2pkLayout = QGridLayout()
      np2pkLayout.addWidget(self.radioNP2PK, 0, 0, 1, 1)
      np2pkLayout.addWidget(np2pkDescr, 1, 0, 1, 1)   
      frmNP2PK.setLayout(np2pkLayout)
      
      def setNP2PK():
         self.selectType('P2SH-P2PK')
      
      self.connect(self.radioNP2PK, SIGNAL('clicked()'), setNP2PK) 
      
      #main layout
      layout = QGridLayout()
      layout.addWidget(frmP2PKH, 0, 0, 1, 4)
      layout.addWidget(frmNP2PK, 2, 0, 1, 4)
      layout.addWidget(frmSW, 4, 0, 1, 4)
      
      self.btnOk = QPushButton(self.tr('Apply'))
      self.btnCancel = QPushButton(self.tr('Cancel'))
      
      self.connect(self.btnOk, SIGNAL('clicked()'), self.accept)
      self.connect(self.btnCancel, SIGNAL('clicked()'), self.reject)

      layout.addWidget(self.btnOk, 5, 2, 1, 1)
      layout.addWidget(self.btnCancel, 5, 3, 1, 1)

      self.setLayout(layout)
      self.setWindowTitle(self.tr('Select Address Type'))
      
      self.selectType(self.type)
      self.setFocus()   
开发者ID:Rudd-O,项目名称:BitcoinArmory,代码行数:85,代码来源:AddressTypeSelectDialog.py


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