Skip to content

Commit

Permalink
Deprecate /transaction-confirmation endpoint (#1973)
Browse files Browse the repository at this point in the history
Adds swap and staking test coverage to the `/preview` endpoint to ensure usage of it can replace the `/transaction-confirmation` one (migrated from the latter's suite), fixing any found issues:

- Decode staking transaction data instead of using `dataDecoded` (because of batches).
- Correct types for `/preview` endpoint.
- Add swap/staking test coverage to `/preview` endpoint.
- Update other tests according.
  • Loading branch information
iamacook authored Oct 8, 2024
1 parent ac17d22 commit 8321909
Show file tree
Hide file tree
Showing 17 changed files with 3,709 additions and 770 deletions.
2 changes: 1 addition & 1 deletion src/config/entities/__tests__/configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ export default (): ReturnType<typeof configuration> => ({
42161: faker.internet.url({ appendSlash: false }),
11155111: faker.internet.url({ appendSlash: false }),
},
explorerBaseUri: faker.internet.url(),
explorerBaseUri: faker.internet.url({ appendSlash: true }),
restrictApps: false,
allowedApps: [],
maxNumberOfParts: faker.number.int(),
Expand Down
6 changes: 6 additions & 0 deletions src/domain/staking/contracts/decoders/kiln-decoder.helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ export class KilnDecoder extends AbiDecoder<typeof KilnAbi> {
super(KilnAbi);
}

// TODO: When confirmation view endpoint is removed, remove this
// and use this.helpers.isDeposit instead
decodeDeposit(
data: `0x${string}`,
): { method: string; parameters: [] } | null {
Expand All @@ -50,6 +52,8 @@ export class KilnDecoder extends AbiDecoder<typeof KilnAbi> {
}
}

// TODO: When confirmation view endpoint is removed, return only
// publicKeys and don't format it like DataDecoded
decodeValidatorsExit(data: `0x${string}`): {
method: string;
parameters: KilnRequestValidatorsExitParameters[];
Expand Down Expand Up @@ -79,6 +83,8 @@ export class KilnDecoder extends AbiDecoder<typeof KilnAbi> {
}
}

// TODO: When confirmation view endpoint is removed, return only
// publicKeys and don't format it like DataDecoded
decodeBatchWithdrawCLFee(data: `0x${string}`): {
method: string;
parameters: KilnBatchWithdrawCLFeeParameters[];
Expand Down
Loading

0 comments on commit 8321909

Please sign in to comment.