mirror of
https://github.com/planetmint/planetmint.git
synced 2025-11-24 14:35:45 +00:00
pre_commit_state -> PASSED
This commit is contained in:
parent
134d608f46
commit
6fdcceefbf
@ -391,10 +391,10 @@ def delete_transactions(connection, txn_ids: list):
|
||||
|
||||
def store_pre_commit_state(state: dict, connection):
|
||||
space = connection.space("pre_commits")
|
||||
# precommit = space.select(state["height"], index="height_search", limit=1)
|
||||
# unique_id = token_hex(8) if (len(_precommit.data) == 0) else _precommit.data[0][0]
|
||||
space.upsert((state["commit_id"], state["height"], state["transactions"]),
|
||||
op_list=[('=', 0, state["id"]),
|
||||
_precommit = space.select(state["height"], index="height_search", limit=1)
|
||||
unique_id = token_hex(8) if (len(_precommit.data) == 0) else _precommit.data[0][0]
|
||||
space.upsert((unique_id, state["height"], state["transactions"]),
|
||||
op_list=[('=', 0, unique_id),
|
||||
('=', 1, state["height"]),
|
||||
('=', 2, state["transactions"])],
|
||||
limit=1)
|
||||
|
||||
@ -434,7 +434,7 @@ def test_store_pre_commit_state(db_context):
|
||||
|
||||
query.store_pre_commit_state(connection=conn, state=state)
|
||||
commit = query.get_pre_commit_state(connection=conn)
|
||||
assert len(list(commit)) == 1
|
||||
assert len([commit]) == 1
|
||||
|
||||
# cursor = db_context.conn.db.pre_commit.find({'commit_id': 'test'},
|
||||
# projection={'_id': False})
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user