def getCurrentUnits(self, uid): consume_type = self.getConsumeType(uid) # for a TimeContract, the current units are always the seconds, which passed since the beginning timestamp if consume_type == self.CONSUME_TYPE_TIME: return self.getCurrentTimeUnits(uid) elif consume_type == self.CONSUME_TYPE_UNITS: return getFromStorage(self.STORAGE_KEY_CURRENT_UNITS, uid) else: n = 0 return False
def getOpenWithdrawalValue(self, uid): return getFromStorage(self.STORAGE_KEY_WITHDRAWAL_REQUEST_VALUE, uid)
def getWithdrawalRequest(self, uid): return getFromStorage(self.STORAGE_KEY_WITHDRAWAL_REQUEST, uid)
def getReleasedAssets(self, address): return getFromStorage(self.STORAGE_KEY_RELEASED_ASSETS, address)
def getReservedUnits(self, uid): return getFromStorage(self.STORAGE_KEY_RESERVED_UNITS, uid)
def getSpentUnits(self, uid): return getFromStorage(self.STORAGE_KEY_SPENT_UNITS, uid)
def getOverallValue(self, uid): return getFromStorage(self.STORAGE_KEY_OVERALL_VALUE, uid)
def getTotalUnits(self, uid): return getFromStorage(self.STORAGE_KEY_TOTAL_UNITS, uid)
def getToTimestamp(self, uid): return getFromStorage(self.STORAGE_KEY_TO_TIMESTAMP, uid)
def getReceiverAddress(self, uid): return getFromStorage(self.STORAGE_KEY_RECEIVER_ADDRESS, uid)
def getPrincipalAddress(self, uid): return getFromStorage(self.STORAGE_KEY_PRINCIPAL_ADDRESS, uid)
def getConsumeType(self, uid): return getFromStorage(self.STORAGE_KEY_CONSUME_TYPE, uid)
def getType(self, uid): return getFromStorage(self.STORAGE_KEY_PAYMENT_TYPE, uid)