Skip to content

Commit

Permalink
solving linting errors
Browse files Browse the repository at this point in the history
  • Loading branch information
kox committed Dec 8, 2024
1 parent 2b49e83 commit a3288b5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion examples/deserialize-transaction/src/example.ts
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ const decompiledTransactionMessage = await decompileTransactionMessageFetchingLo
// This is the same data structure that was created before we first signed the transaction

// We can see the fee payer:
log.info(`[step 3] The transaction fee payer is ${decompiledTransactionMessage.feePayer}`);
log.info(`[step 3] The transaction fee payer is ${decompiledTransactionMessage.feePayer.address}`);

// And the lifetime constraint:
log.info(decompiledTransactionMessage.lifetimeConstraint, '[step 3] The transaction lifetime constraint');
Expand Down
4 changes: 2 additions & 2 deletions packages/errors/src/message-formatter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const TYPE = 't';

export function getHumanReadableErrorMessage<TErrorCode extends SolanaErrorCode>(
code: TErrorCode,
context: object = {},
context: Record<string, unknown> = {},
): string {
const messageFormatString = SolanaErrorMessages[code];
if (messageFormatString.length === 0) {
Expand All @@ -28,7 +28,7 @@ export function getHumanReadableErrorMessage<TErrorCode extends SolanaErrorCode>
const variableName = messageFormatString.slice(state[START_INDEX] + 1, endIndex);

fragments.push(
variableName in context ? `${context[variableName as keyof typeof context]}` : `$${variableName}`,
variableName in context ? `${context[variableName] as string}` : `$${variableName}`,
);
} else if (state[TYPE] === StateType.Text) {
fragments.push(messageFormatString.slice(state[START_INDEX], endIndex));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ describe('createHttpTransport', () => {
thrownError = e as SolanaError<typeof SOLANA_ERROR__RPC__TRANSPORT_HTTP_ERROR>;
}
expect(thrownError).toBeDefined();

// Note: Stringifying this variable, it will leak header values and the test will fail
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
expect(`${thrownError.context.headers}`).not.toMatch(/doNotLog/);
});
});
Expand Down

0 comments on commit a3288b5

Please sign in to comment.