本文整理汇总了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))
示例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()
示例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)