Skip to content

Commit

Permalink
fix: treat staker address input as case insensitive (#279)
Browse files Browse the repository at this point in the history
  • Loading branch information
gowthamsundaresan authored Nov 5, 2024
1 parent 601615c commit e4ef171
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/api/src/routes/stakers/stakerController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ export async function getStakerWithdrawalsQueued(req: Request, res: Response) {

try {
const { address } = req.params
const filterQuery = { stakerAddress: address, completedWithdrawal: null }
const filterQuery = { stakerAddress: address.toLowerCase(), completedWithdrawal: null }

const withdrawalCount = await prisma.withdrawalQueued.count({
where: filterQuery
Expand Down Expand Up @@ -245,7 +245,7 @@ export async function getStakerWithdrawalsWithdrawable(req: Request, res: Respon
(await viemClient.getBlockNumber()) - BigInt((minDelayBlocks?.value as string) || 0)

const filterQuery = {
stakerAddress: address,
stakerAddress: address.toLowerCase(),
completedWithdrawal: null,
createdAtBlock: { lte: minDelayBlock }
}
Expand Down Expand Up @@ -303,7 +303,7 @@ export async function getStakerWithdrawalsCompleted(req: Request, res: Response)
try {
const { address } = req.params
const filterQuery = {
stakerAddress: address,
stakerAddress: address.toLowerCase(),
NOT: {
completedWithdrawal: null
}
Expand Down Expand Up @@ -367,7 +367,7 @@ export async function getStakerDeposits(req: Request, res: Response) {

try {
const { address } = req.params
const filterQuery = { stakerAddress: address }
const filterQuery = { stakerAddress: address.toLowerCase() }

const depositCount = await prisma.deposit.count({
where: filterQuery
Expand Down

0 comments on commit e4ef171

Please sign in to comment.