Skip to content

Commit

Permalink
chore: update accountingTransfer limit to 20 (#3115)
Browse files Browse the repository at this point in the history
* Update accountingTransfer limit to 20

* Updated default value in PSQL, updated comments and descriptions
  • Loading branch information
oana-lolea authored Nov 28, 2024
1 parent e065312 commit 5de6208
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ describe('Ledger Transfer', (): void => {
const accountTransfers = await getAccountTransfers(
serviceDeps,
account.id,
100_000,
20,
knex
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export type CreateLedgerTransferArgs = Pick<
export async function getAccountTransfers(
deps: ServiceDependencies,
id: string | number,
limit?: number,
limit: number = 20,
trx?: TransactionOrKnex
): Promise<GetLedgerTransfersResult> {
const builder = LedgerTransfer.query(trx || deps.knex)
Expand Down
4 changes: 2 additions & 2 deletions packages/backend/src/accounting/tigerbeetle/transfers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,14 +170,14 @@ export async function createTransfers(
export async function getAccountTransfers(
deps: ServiceDependencies,
id: string | number,
limit: number = 100_000
limit: number = 20
): Promise<GetLedgerTransfersResult> {
const account_id = toTigerBeetleId(id)
const filter: AccountFilter = {
account_id,
timestamp_min: 0n,
timestamp_max: 0n,
limit, //100_000 is the default limit for TB.
limit,
flags: AccountFilterFlags.credits | AccountFilterFlags.debits
}
const tbAccountTransfers: TbTransfer[] =
Expand Down
2 changes: 1 addition & 1 deletion packages/backend/src/graphql/generated/graphql.schema.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ describe('Accounting Transfer', (): void => {
// Top up debit account first:
const transferAmount = 123
const ledger = 1
const queryLimit = 100_000
const queryLimit = 20

const insertedTransfer = await createLedgerTransfer(
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ describe('TigerBeetle: Accounting Transfer', (): void => {

// Top up debit account first:
const transferAmount = 123
const queryLimit = 100_000
const queryLimit = 20
const depositId = uuid()
const insertedTransfer = await accountingService.createDeposit({
id: depositId,
Expand Down
2 changes: 1 addition & 1 deletion packages/backend/src/graphql/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ type Query {
accountingTransfers(
"Unique identifier of the account."
id: String!
"Limit the number of results returned. If no limit is provided, the default limit of 100,000 is set for TigerBeetle."
"Limit the number of results returned. If no limit is provided, the default limit is 20."
limit: Int
): AccountingTransferConnection!

Expand Down

0 comments on commit 5de6208

Please sign in to comment.