Skip to content

Commit d089f24

Browse files
fix: Rename gasless feature flag (#8801)
## What changed - Renamed the Relay execute feature flag in `transaction-pay-controller` from `gaslessEnabled` to `isGaslessEnabled`. - Updated feature flag tests to use the new key for both enabled and disabled cases. - Added an Unreleased changelog entry referencing this PR. ## Why This separates the new gasless toggle from the prior release flag so rollout can use one flag up to a given release and another flag starting with this release. ## Validation - `yarn workspace @metamask/transaction-pay-controller run jest --no-coverage src/utils/feature-flags.test.ts` - `yarn workspace @metamask/transaction-pay-controller run test` - `yarn workspace @metamask/transaction-pay-controller run changelog:validate` - `yarn build` - `yarn lint` Note: `yarn validate:changelog` is not defined at the repo root in this checkout, so I used the package changelog validation script. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Low risk: this is a straightforward rename of a remote feature-flag key used to gate Relay `/execute` gasless behavior, with tests updated accordingly. Main risk is rollout/config mismatch if any clients or flag payloads still send `gaslessEnabled`. > > **Overview** > Renames the Relay gasless execution remote feature flag key from `gaslessEnabled` to `isGaslessEnabled` and updates `isRelayExecuteEnabled` (and its `PayStrategiesConfigRaw` typing) to read the new key. > > Updates unit tests to assert the new flag name and adds an Unreleased changelog entry documenting the rename. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit f79da17. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY -->
1 parent 5d82bb1 commit d089f24

3 files changed

Lines changed: 10 additions & 6 deletions

File tree

packages/transaction-pay-controller/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1111

1212
- Add Polymarket deposit-wallet support to the Relay strategy for `predictWithdraw` transactions, routed via the `isPolymarketDepositWallet` flag on `TransactionConfig` ([#8754](https://github.com/MetaMask/core/pull/8754))
1313

14+
### Changed
15+
16+
- Rename Relay gasless execution feature flag from `gaslessEnabled` to `isGaslessEnabled` ([#8801](https://github.com/MetaMask/core/pull/8801))
17+
1418
## [22.4.0]
1519

1620
### Added

packages/transaction-pay-controller/src/utils/feature-flags.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -464,14 +464,14 @@ describe('Feature Flags Utils', () => {
464464
expect(isRelayExecuteEnabled(messenger)).toBe(false);
465465
});
466466

467-
it('returns true when gaslessEnabled is true', () => {
467+
it('returns true when isGaslessEnabled is true', () => {
468468
getRemoteFeatureFlagControllerStateMock.mockReturnValue({
469469
...getDefaultRemoteFeatureFlagControllerState(),
470470
remoteFeatureFlags: {
471471
confirmations_pay: {
472472
payStrategies: {
473473
relay: {
474-
gaslessEnabled: true,
474+
isGaslessEnabled: true,
475475
},
476476
},
477477
},
@@ -481,14 +481,14 @@ describe('Feature Flags Utils', () => {
481481
expect(isRelayExecuteEnabled(messenger)).toBe(true);
482482
});
483483

484-
it('returns false when gaslessEnabled is false', () => {
484+
it('returns false when isGaslessEnabled is false', () => {
485485
getRemoteFeatureFlagControllerStateMock.mockReturnValue({
486486
...getDefaultRemoteFeatureFlagControllerState(),
487487
remoteFeatureFlags: {
488488
confirmations_pay: {
489489
payStrategies: {
490490
relay: {
491-
gaslessEnabled: false,
491+
isGaslessEnabled: false,
492492
},
493493
},
494494
},

packages/transaction-pay-controller/src/utils/feature-flags.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ export type PayStrategiesConfigRaw = {
133133
across?: AcrossConfigRaw;
134134
relay?: {
135135
enabled?: boolean;
136-
gaslessEnabled?: boolean;
136+
isGaslessEnabled?: boolean;
137137
originGasOverhead?: string;
138138
pollingInterval?: number;
139139
pollingTimeout?: number;
@@ -496,7 +496,7 @@ export function isRelayExecuteEnabled(
496496
(state.remoteFeatureFlags?.confirmations_pay as
497497
| FeatureFlagsRaw
498498
| undefined) ?? {};
499-
return featureFlags.payStrategies?.relay?.gaslessEnabled ?? false;
499+
return featureFlags.payStrategies?.relay?.isGaslessEnabled ?? false;
500500
}
501501

502502
/**

0 commit comments

Comments
 (0)