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


Python TheBDM.getTopBlockHeight方法代码示例

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


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

示例1: verifyBlockHeight

# 需要导入模块: from armoryengine.BDM import TheBDM [as 别名]
# 或者: from armoryengine.BDM.TheBDM import getTopBlockHeight [as 别名]
 def verifyBlockHeight(self):
    blockHeight = TheBDM.getTopBlockHeight()
    self.assertEqual(blockHeight, TOP_TIAB_BLOCK, NEED_TIAB_MSG + str(blockHeight))
开发者ID:Bitcoinsulting,项目名称:BitcoinArmorydev,代码行数:5,代码来源:Tiab.py

示例2: RightNow

# 需要导入模块: from armoryengine.BDM import TheBDM [as 别名]
# 或者: from armoryengine.BDM.TheBDM import getTopBlockHeight [as 别名]
   returned.  If you are in asynchronous mode, and don't want to ever wait 
   for anything, always check TheBDM.getState()==BDM_BLOCKCHAIN_READY before
   requesting data that will force blocking.
   """
   start = RightNow()
   TheBDM.setBlocking(False)
   TheBDM.setOnlineMode(True)
   sleep(2)
   print 'Waiting for blockchain loading to finish',
   while not TheBDM.getState()==BDM_BLOCKCHAIN_READY:
      print '.',
      sys.stdout.flush()
      sleep(2)
   print 'Loading blockchain took %0.1f sec' % (RightNow() - start)

   topBlock = TheBDM.getTopBlockHeight()
   print '\n\nCurrent Top Block is:', topBlock
   TheBDM.blockchain().top().pprint()

################################################################################
if run_LoadBlockchain_Block:
   start = RightNow()
   TheBDM.setBlocking(True)
   TheBDM.setOnlineMode(True)
   # The setOnlineMode should block until blockchain loading is complete
   print 'Loading blockchain took %0.1f sec' % (RightNow() - start)

   topBlock = TheBDM.getTopBlockHeight()
   print '\n\nCurrent Top Block is:', topBlock
   TheBDM.blockchain().top().pprint()
开发者ID:waldoalvarez00,项目名称:BitcoinArmory,代码行数:32,代码来源:sample_armory_code.py

示例3: __init__

# 需要导入模块: from armoryengine.BDM import TheBDM [as 别名]
# 或者: from armoryengine.BDM.TheBDM import getTopBlockHeight [as 别名]
   def __init__(self, parent, main, layoutDir=VERTICAL, spendFromLBID=None):
      super(LockboxSelectFrame, self).__init__(parent, main)

      self.lbox = self.main.getLockboxByID(spendFromLBID)
      self.cppWlt = self.main.cppLockboxWltMap[spendFromLBID]

      if not self.lbox:
         QMessageBox.warning(self, tr("Invalid Lockbox"), tr(""" There was 
         an error loading the specified lockbox (%s).""") % spendFromLBID, 
         QMessageBox.Ok)
         self.reject()
         return

      lblSpendFromLB = QRichLabel(tr(""" <font color="%s" size=4><b><u>Lockbox   
         %s (%d-of-%d)</u></b></font>""") % (htmlColor('TextBlue'), \
         self.lbox.uniqueIDB58, self.lbox.M, self.lbox.N))
      lblSpendFromLB.setAlignment(Qt.AlignHCenter | Qt.AlignVCenter)

      lbls = []
      lbls.append(QRichLabel("Lockbox ID:", doWrap=False))
      lbls.append(QRichLabel("Name:", doWrap=False))
      lbls.append(QRichLabel("Description:", doWrap=False))
      lbls.append(QRichLabel("Spendable GRS:", doWrap=False))

      layoutDetails = QGridLayout()
      for i,lbl in enumerate(lbls):
         lbl.setAlignment(Qt.AlignLeft | Qt.AlignTop)
         lbl.setText('<b>' + str(lbls[i].text()) + '</b>')
         layoutDetails.addWidget(lbl, i+1, 0)
         
      # LockboxID
      self.dispID = QRichLabel(spendFromLBID)

      # Lockbox Short Description/Name
      self.dispName = QRichLabel(self.lbox.shortName)
      self.dispName.setWordWrap(True)
      self.dispName.setSizePolicy(QSizePolicy.Preferred, QSizePolicy.Preferred)

      # Lockbox long descr
      dispDescr = self.lbox.longDescr[:253]
      if len(self.lbox.longDescr)>253:
         dispDescr += '...'
      self.dispDescr = QRichLabel(dispDescr)
      self.dispDescr.setWordWrap(True)
      self.dispDescr.setSizePolicy(QSizePolicy.Preferred, QSizePolicy.Preferred)
      bal = self.cppWlt.getSpendableBalance(TheBDM.getTopBlockHeight(), IGNOREZC)
      self.dispBal = QMoneyLabel(bal, wBold=True)
      self.dispBal.setTextFormat(Qt.RichText)

      layoutDetails.addWidget(self.dispID, 1, 1)
      layoutDetails.addWidget(self.dispName, 2, 1)
      layoutDetails.addWidget(self.dispDescr, 3, 1)
      layoutDetails.addWidget(self.dispBal, 4, 1)
      layoutDetails.setColumnStretch(0,0)
      layoutDetails.setColumnStretch(1,1)
      frmDetails = QFrame()
      frmDetails.setLayout(layoutDetails)
      frmDetails.setFrameStyle(STYLE_SUNKEN)

      layout = QVBoxLayout()
      layout.addWidget(lblSpendFromLB)
      layout.addWidget(frmDetails)

      self.setLayout(layout)
开发者ID:Groestlcoin,项目名称:GroestlcoinArmory,代码行数:66,代码来源:WalletFrames.py


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