Skip to content

Commit

Permalink
Remove tmp fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ThibaultJRD committed Feb 1, 2024
1 parent 66d0973 commit c058671
Showing 1 changed file with 2 additions and 27 deletions.
29 changes: 2 additions & 27 deletions src/utils/lumClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,23 +115,8 @@ class LumClient {

while (true) {
const resDeposits: QueryDepositsResponse = await this.client.queryClient.millions.accountDeposits(address, pageDeposits);
const fixedDeposits: Deposit[] = [];

//FIXME: remove this when the chain is fixed
for (const deposit of resDeposits.deposits) {
if (deposit.state !== DepositState.DEPOSIT_STATE_SUCCESS) {
const fixedDeposit = await this.client?.queryClient.millions.poolDeposit(Long.fromNumber(2), deposit.depositId);

if (fixedDeposit) {
fixedDeposits.push(fixedDeposit);
continue;
}
}

fixedDeposits.push(deposit);
}

deposits.push(...fixedDeposits);
deposits.push(...resDeposits.deposits);

// If we have pagination key, we just patch it, and it will process in the next loop
if (resDeposits.pagination && resDeposits.pagination.nextKey && resDeposits.pagination.nextKey.length) {
Expand All @@ -148,18 +133,8 @@ class LumClient {

while (true) {
const resWithdrawals: QueryWithdrawalsResponse = await this.client.queryClient.millions.accountWithdrawals(address, pageWithdrawals);
const fixedWithdrawals: Withdrawal[] = [];

//FIXME: remove this when the chain is fixed
for (const withdrawal of resWithdrawals.withdrawals) {
const fixedWithdrawal = await this.client?.queryClient.millions.poolWithdrawal(Long.fromNumber(2), withdrawal.withdrawalId);

if (fixedWithdrawal) {
fixedWithdrawals.push(fixedWithdrawal);
}
}

withdrawals.push(...fixedWithdrawals);
withdrawals.push(...resWithdrawals.withdrawals);

// If we have pagination key, we just patch it, and it will process in the next loop
if (resWithdrawals.pagination && resWithdrawals.pagination.nextKey && resWithdrawals.pagination.nextKey.length) {
Expand Down

0 comments on commit c058671

Please sign in to comment.