Skip to content

Commit

Permalink
fix: typo
Browse files Browse the repository at this point in the history
  • Loading branch information
ALPAC-4 committed Jan 6, 2025
1 parent 434d732 commit 8f164cc
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
11 changes: 8 additions & 3 deletions src/db/controller/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,14 @@ export class ClientController {
const client = await this.getClient(rest, chainId, clientId)

// update client
const revisionHeight = parseInt(
event.consensusHeights.split(',')[0].split('-')[1]
)
const splitted = event.consensusHeights.split(',')[0].split('-')[1]
if (splitted.length < 2) {
throw new Error(
'Invalid consensusHeights format. Expected "revision-height"'
)
}

const revisionHeight = parseInt(splitted[1])

if (revisionHeight > client.revision_height) {
client.revision_height = revisionHeight
Expand Down
2 changes: 1 addition & 1 deletion src/lib/eventParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ export function parseUpdateClientEvent(event: Event): UpdateClientEvent {
// recover_client or upgrade_client
export function parseReplaceClientEvent(event: Event): string {
const clientId =
find(event, 'subject_client_id') ?? (find(event, 'client_id"') as string)
find(event, 'subject_client_id') ?? (find(event, 'client_id') as string)

return clientId
}
Expand Down
4 changes: 2 additions & 2 deletions src/workers/wallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ export class WalletWorker {
]

// check client expiration
const fileterExpiredClient = async (clientId: string) => {
const filterExpiredClient = async (clientId: string) => {
const currentTimestamp = new Date().valueOf() / 1000

const client = await ClientController.getClient(
Expand All @@ -218,7 +218,7 @@ export class WalletWorker {

const filteredClientIds = await asyncFilter(
clientIds,
fileterExpiredClient
filterExpiredClient
)

// generate msgs
Expand Down

0 comments on commit 8f164cc

Please sign in to comment.