diff --git a/examples/deserialize-transaction/src/example.ts b/examples/deserialize-transaction/src/example.ts index 0ec16e4892c..0a3cd273862 100644 --- a/examples/deserialize-transaction/src/example.ts +++ b/examples/deserialize-transaction/src/example.ts @@ -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'); diff --git a/packages/errors/src/message-formatter.ts b/packages/errors/src/message-formatter.ts index c91672e65e7..85472199c9d 100644 --- a/packages/errors/src/message-formatter.ts +++ b/packages/errors/src/message-formatter.ts @@ -16,7 +16,7 @@ const TYPE = 't'; export function getHumanReadableErrorMessage( code: TErrorCode, - context: object = {}, + context: Record = {}, ): string { const messageFormatString = SolanaErrorMessages[code]; if (messageFormatString.length === 0) { @@ -28,7 +28,7 @@ export function getHumanReadableErrorMessage 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)); diff --git a/packages/rpc-transport-http/src/__tests__/http-transport-test.ts b/packages/rpc-transport-http/src/__tests__/http-transport-test.ts index 382caf78ca8..73d143f45d9 100644 --- a/packages/rpc-transport-http/src/__tests__/http-transport-test.ts +++ b/packages/rpc-transport-http/src/__tests__/http-transport-test.ts @@ -71,6 +71,9 @@ describe('createHttpTransport', () => { thrownError = e as SolanaError; } 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/); }); });