Example #1
0
 def doPoolUpgrade(self, upgrade: Upgrade):
     """
     Used to send a new code upgrade
     :param upgrade: upgrade data
     :return: number of pending txns
     """
     key = upgrade.key
     self._upgrades[key] = upgrade
     req = upgrade.ledgerRequest()
     if req:
         self.pendRequest(req, key)
     return len(self._pending)
Example #2
0
 def doPoolUpgrade(self, upgrade: Upgrade):
     """
     Used to send a new code upgrade
     :param upgrade: upgrade data
     :return: number of pending txns
     """
     key = upgrade.key
     self._upgrades[key] = upgrade
     req = upgrade.ledgerRequest()
     if req:
         self.pendRequest(req, key)
     return len(self._pending)
Example #3
0
def submitPoolUpgrade(looper, senderClient, senderWallet, name, action,
                      version, schedule, timeout, sha256):
    upgrade = Upgrade(name, action, schedule, version, sha256, timeout,
                      senderWallet.defaultId)
    senderWallet.doPoolUpgrade(upgrade)
    reqs = senderWallet.preparePending()
    senderClient.submitReqs(*reqs)

    def check():
        assert senderWallet._upgrades[upgrade.key].seqNo

    timeout = waits.expectedTransactionExecutionTime(len(senderClient.nodeReg))
    looper.run(eventually(check, timeout=timeout))
Example #4
0
def sendUpgrade(client, wallet, upgradeData):
    upgrade = Upgrade(**upgradeData, trustee=wallet.defaultId)
    wallet.doPoolUpgrade(upgrade)
    reqs = wallet.preparePending()
    req = client.submitReqs(*reqs)[0][0]
    return upgrade, req