Skip to content

Commit

Permalink
made the names of db.set and get unique to prevent future collisions
Browse files Browse the repository at this point in the history
  • Loading branch information
SirGankalot committed May 24, 2024
1 parent 26ffb44 commit ed6e730
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions checker/src/checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ async def putflag_test(
raise MumbleException("Could not create note")
for i in range(0, 2):
try:
await db.set("userdata", (email_2, password1_2))
await db.set("user_data_0", (email_2, password1_2))
break
except:
raise MumbleException("Could not set userdata")
Expand All @@ -148,7 +148,7 @@ async def getflag_test(

for i in range(0, 2):
try:
email, password = await db.get("userdata")
email, password = await db.get("user_data_0")
break
except KeyError:
raise MumbleException("Missing database entry from putflag")
Expand Down Expand Up @@ -300,7 +300,7 @@ async def putnoise0(
raise MumbleException("Could not create note")

try:
await db.set("userdata", (email_2, password1_2, randomNote))
await db.set("user_data_0_noise", (email_2, password1_2, randomNote))
except:
raise MumbleException("Could not set userdata")

Expand All @@ -312,7 +312,7 @@ async def getnoise0(
logger: LoggerAdapter,
) -> None:
try:
email, password, Note = await db.get("userdata")
email, password, Note = await db.get("user_data_0_noise")
except KeyError:
raise MumbleException("Missing database entry from putflag")

Expand Down Expand Up @@ -363,7 +363,7 @@ async def putflag_test_1(
except:
raise MumbleException("Could not create group note")
try:
await db.set("group_data", (group_name, group_key, group_id))
await db.set("group_data_1", (group_name, group_key, group_id))
except:
raise MumbleException("Could not set group data")

Expand All @@ -378,7 +378,7 @@ async def getflag_test_1(
logger: LoggerAdapter,
) -> None:
try:
group_name, group_key, group_id = await db.get("group_data")
group_name, group_key, group_id = await db.get("group_data_1")
except KeyError:
raise MumbleException("Missing database entry from putflag")

Expand Down Expand Up @@ -473,7 +473,7 @@ async def putnoise1(
except:
raise MumbleException("Could not create group note")
try:
await db.set("group_data", (group_name, group_key, group_id, randomNote))
await db.set("group_data_1_noise", (group_name, group_key, group_id, randomNote))
except:
raise MumbleException("Could not set group data")

Expand All @@ -487,7 +487,7 @@ async def getnoise1(
logger: LoggerAdapter,
) -> None:
try:
group_name, group_key, group_id, randomNote = await db.get("group_data")
group_name, group_key, group_id, randomNote = await db.get("group_data_1_noise")
except KeyError:
raise MumbleException("Missing database entry from putflag")

Expand Down

0 comments on commit ed6e730

Please sign in to comment.