Add change test for chainqueue entry
This commit is contained in:
@@ -115,7 +115,8 @@ class QueueEntry:
|
||||
def fail(self, block, tx):
|
||||
if self.__match_state(self.store.NETWORK_ERROR):
|
||||
return
|
||||
self.store.set(self.k, self.store.NETWORK_ERROR)
|
||||
v = self.store.state(self.k)
|
||||
self.store.change(self.k, v | self.store.NETWORK_ERROR, self.store.QUEUED)
|
||||
if self.store.cache:
|
||||
self.store.cache.set_block(self.tx_hash, block, tx)
|
||||
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
# standard imports
|
||||
import re
|
||||
import datetime
|
||||
import logging
|
||||
|
||||
# local imports
|
||||
from chainqueue.cache import CacheTx
|
||||
from chainqueue.entry import QueueEntry
|
||||
|
||||
logg = logging.getLogger(__name__)
|
||||
|
||||
|
||||
def to_key(t, n, k):
|
||||
return '{}_{}_{}'.format(t, n, k)
|
||||
@@ -125,6 +128,7 @@ class Store:
|
||||
def final(self, k, block, tx, error=False):
|
||||
entry = QueueEntry(self, k)
|
||||
entry.load()
|
||||
logg.debug('entry {} {}'.format(k, entry.k))
|
||||
if error:
|
||||
entry.fail(block, tx)
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user