Skip to content

Commit a9c5c7f

Browse files
committed
fix(frontend): satisfy decoder lint formatting
1 parent fe4e0a4 commit a9c5c7f

File tree

2 files changed

+19
-15
lines changed

2 files changed

+19
-15
lines changed

src/pages/network/components/TxItem/useDecodedContractInput.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,7 @@ export const useDecodedContractInput = (
5353
inputData: params.inputData,
5454
destinationHint: params.destination
5555
})
56-
}, [
57-
shouldDecodeInput,
58-
tickData?.epoch,
59-
params.inputData,
60-
params.inputType,
61-
params.destination
62-
])
56+
}, [shouldDecodeInput, tickData?.epoch, params.inputData, params.inputType, params.destination])
6357

6458
return {
6559
isContractTransaction,

src/utils/contract-input-decoder.ts

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,7 @@ const versionByContractAndFingerprint = new Map<string, ContractVersionDefinitio
5353

5454
coreVersionedContractsRegistry.contracts.forEach((timeline) => {
5555
timeline.versions.forEach((version) => {
56-
versionByContractAndFingerprint.set(
57-
`${timeline.contractIndex}:${version.fingerprint}`,
58-
version
59-
)
56+
versionByContractAndFingerprint.set(`${timeline.contractIndex}:${version.fingerprint}`, version)
6057
})
6158
})
6259

@@ -200,14 +197,20 @@ const collectIdentityPathsForInput = (
200197
contract: ContractDefinition,
201198
entry: ContractEntry,
202199
fingerprint: string
203-
): ReadonlySet<string> => collectPathsByPredicate(contract, entry, fingerprint, isIdentityTypeExpression)
200+
): ReadonlySet<string> =>
201+
collectPathsByPredicate(contract, entry, fingerprint, isIdentityTypeExpression)
204202

205203
const collectUint64PathsForInput = (
206204
contract: ContractDefinition,
207205
entry: ContractEntry,
208206
fingerprint: string
209207
): ReadonlySet<string> =>
210-
collectPathsByPredicate(contract, entry, fingerprint, (normalizedTypeExpression) => normalizedTypeExpression === 'uint64')
208+
collectPathsByPredicate(
209+
contract,
210+
entry,
211+
fingerprint,
212+
(normalizedTypeExpression) => normalizedTypeExpression === 'uint64'
213+
)
211214

212215
const isHumanReadableU64Path = (path: string): boolean => {
213216
const normalized = path.trim().toLowerCase()
@@ -323,7 +326,9 @@ const resolveContractDecodeMetadata = (
323326
entryInputType: number,
324327
entryName: string
325328
): ContractDecodeMetadata | null => {
326-
const version = versionByContractAndFingerprint.get(getVersionLookupKey(contractIndex, fingerprint))
329+
const version = versionByContractAndFingerprint.get(
330+
getVersionLookupKey(contractIndex, fingerprint)
331+
)
327332
if (!version) return null
328333

329334
const entry = version.contract.entries.find(
@@ -413,7 +418,12 @@ export const decodeContractInputData = (params: {
413418

414419
const normalizedValue =
415420
decoded.decoded.mode === 'typed'
416-
? normalizeDecodedValue(decoded.decoded.value, ROOT_PATH, identityPaths, humanReadableUint64Paths)
421+
? normalizeDecodedValue(
422+
decoded.decoded.value,
423+
ROOT_PATH,
424+
identityPaths,
425+
humanReadableUint64Paths
426+
)
417427
: normalizeDecodedValue(
418428
{ rawBytes: decoded.decoded.rawBytes },
419429
ROOT_PATH,

0 commit comments

Comments
 (0)