示例#1
0
 def state_address_used(self,
                        addr):  # if excepts then address does not exist..
     try:
         return self.db.get(addr)
     except Exception as e:
         logger.warn("state_address_used: %s %s", type(e), e.message)
         return False
示例#2
0
 def state_balance(self, addr):
     try:
         return self.db.get(addr)[1]
     except Exception as e:
         logger.warn("state_balance: %s %s", type(e), e.message)
         return 0
示例#3
0
 def state_get_address(self, addr):
     try:
         return self.db.get(addr)
     except Exception as e:
         logger.warn("state_get_address: %s %s", type(e), e.message)
         return [0, 0, []]
示例#4
0
 def get_epoch_seed(self):
     try:
         return self.db.get('epoch_seed')
     except Exception as e:
         logger.warn("get_epoch_seed: %s %s", type(e), e.message)
         return False
示例#5
0
 def state_get_txn_count(self, addr):
     try:
         return self.db.get('txn_count_' + addr)
     except Exception as e:
         logger.warn("state_get_txn_count: %s %s", type(e), e.message)
         return 0
示例#6
0
 def put_epoch_seed(self, epoch_seed):
     try:
         self.db.put('epoch_seed', epoch_seed)
     except Exception as e:
         logger.warn("put_epoch_seed: %s %s", type(e), e.message)
         return False
示例#7
0
 def next_stake_list_put(self, next_sl):
     try:
         self.db.put('next_stake_list', next_sl)
     except Exception as e:
         logger.warn("next_stake_list_put: %s %s", type(e), e.message)
         return False
示例#8
0
 def next_stake_list_get(self):
     try:
         return self.db.get('next_stake_list')
     except Exception as e:
         logger.warn("next_stake_list_get: %s %s", type(e), e.message)
         return []
示例#9
0
 def state_hrs(self, hrs):
     try:
         return self.db.get('hrs' + hrs)
     except Exception as e:
         logger.warn("state_hrs: %s %s", type(e), e.message)
         return False
示例#10
0
 def state_pubhash(self, addr):
     try:
         return self.db.get(addr)[2]
     except Exception as e:
         logger.warn("state_pubhash: %s %s", type(e), e.message)
         return []