Skip to content

Commit

Permalink
feat(2756): rename tigerbeetle to tigerBeetle.
Browse files Browse the repository at this point in the history
  • Loading branch information
koekiebox committed Jun 19, 2024
1 parent 88330e7 commit 35149c1
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion packages/backend/jest.tigerbeetle-environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export default class TigerbeetleEnvironment extends CustomTestEnvironment {
const tbContainer = await startTigerbeetleContainer()

this.tbContainer = tbContainer.container
this.global.tigerbeetlePort = tbContainer.port
this.global.tigerBeetlePort = tbContainer.port
}

public async teardown(): Promise<void> {
Expand Down
4 changes: 2 additions & 2 deletions packages/backend/src/accounting/tigerbeetle/accounts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export async function createAccounts(
deps: ServiceDependencies,
accounts: CreateAccountOptions[]
): Promise<void> {
const errors = await deps.tigerbeetle.createAccounts(
const errors = await deps.tigerBeetle.createAccounts(
accounts.map((account) => ({
id: toTigerbeetleId(account.id),
user_data_32: 0,
Expand Down Expand Up @@ -64,7 +64,7 @@ export async function getAccounts(
deps: ServiceDependencies,
accountIds: AccountId[]
): Promise<Account[]> {
return await deps.tigerbeetle.lookupAccounts(
return await deps.tigerBeetle.lookupAccounts(
accountIds.map((id) => toTigerbeetleId(id))
)
}
Expand Down
4 changes: 2 additions & 2 deletions packages/backend/src/accounting/tigerbeetle/service.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ describe('TigerBeetle Accounting Service', (): void => {
})

test('Create throws on error', async (): Promise<void> => {
const tigerbeetle = await deps.use('tigerbeetle')!
jest.spyOn(tigerbeetle, 'createAccounts').mockResolvedValueOnce([
const tigerBeetle = await deps.use('tigerBeetle')!
jest.spyOn(tigerBeetle, 'createAccounts').mockResolvedValueOnce([
{
index: 0,
result: CreateTbAccountError.exists_with_different_ledger
Expand Down
2 changes: 1 addition & 1 deletion packages/backend/src/accounting/tigerbeetle/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export const convertToTigerBeetleAccountCode: {
}

export interface ServiceDependencies extends BaseService {
tigerbeetle: Client
tigerBeetle: Client
withdrawalThrottleDelay?: number
}

Expand Down
2 changes: 1 addition & 1 deletion packages/backend/src/accounting/tigerbeetle/transfers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export async function createTransfers(
}
tbTransfers.push(tbTransfer)
}
const res = await deps.tigerbeetle.createTransfers(tbTransfers)
const res = await deps.tigerBeetle.createTransfers(tbTransfers)
for (const { index, result } of res) {
switch (result) {
case CreateTransferErrorCode.linked_event_failed:
Expand Down
2 changes: 1 addition & 1 deletion packages/backend/src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ export interface AppServices {
autoPeeringService: Promise<AutoPeeringService>
autoPeeringRoutes: Promise<AutoPeeringRoutes>
connectorApp: Promise<ConnectorApp>
tigerbeetle?: Promise<TigerbeetleClient>
tigerBeetle?: Promise<TigerbeetleClient>
paymentMethodHandlerService: Promise<PaymentMethodHandlerService>
ilpPaymentService: Promise<IlpPaymentService>
}
Expand Down
10 changes: 5 additions & 5 deletions packages/backend/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ export function initIocContainer(
const config = await deps.use('config')

if (config.useTigerBeetle) {
container.singleton('tigerbeetle', async (deps) => {
container.singleton('tigerBeetle', async (deps) => {
const config = await deps.use('config')
return createClient({
cluster_id: BigInt(config.tigerBeetleClusterId),
Expand All @@ -220,11 +220,11 @@ export function initIocContainer(
)
})
})
const tigerbeetle = await deps.use('tigerbeetle')!
const tigerBeetle = await deps.use('tigerBeetle')!
return createTigerbeetleAccountingService({
logger,
knex,
tigerbeetle,
tigerBeetle,
withdrawalThrottleDelay: config.withdrawalThrottleDelay
})
}
Expand Down Expand Up @@ -536,8 +536,8 @@ export const gracefulShutdown = async (

const config = await container.use('config')
if (config.useTigerBeetle) {
const tigerbeetle = await container.use('tigerbeetle')
tigerbeetle?.destroy()
const tigerBeetle = await container.use('tigerBeetle')
tigerBeetle?.destroy()
}

const redis = await container.use('redis')
Expand Down

0 comments on commit 35149c1

Please sign in to comment.