commit 04dfb185ce0bc43364361aa369b9191e61b8064c
parent a6e48d93a8a9912a0b573286bdd1671606143603
Author: lash <dev@holbrook.no>
Date: Sun, 13 Mar 2022 15:45:48 +0000
Implement upcoming query on store
Diffstat:
2 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/chainqueue/store/base.py b/chainqueue/store/base.py
@@ -95,3 +95,8 @@ class Store:
entry.retry()
except StateTransitionInvalid:
entry.readysend()
+
+
+ def fail(self, k):
+ entry = QueueEntry(self, k)
+ entry.reject()
diff --git a/tests/test_integrate.py b/tests/test_integrate.py
@@ -43,7 +43,7 @@ class TestIntegrateBase(TestShepBase):
self.store.put(b'foo'.hex(), b'bar'.hex(), cache_adapter=MockCacheTokenTx)
- def test_state_move(self):
+ def test_state_enqueu(self):
hx = b'foo'.hex()
self.store.put(hx, b'bar'.hex(), cache_adapter=MockCacheTokenTx)
self.store.get(hx)
@@ -53,5 +53,12 @@ class TestIntegrateBase(TestShepBase):
self.assertEqual(v[0], hx)
+ def test_state_defer(self):
+ hx = b'foo'.hex()
+ self.store.put(hx, b'bar'.hex(), cache_adapter=MockCacheTokenTx)
+ self.store.get(hx)
+ self.store.fail(hx)
+
+
if __name__ == '__main__':
unittest.main()