Skip to content

Commit

Permalink
Merge branch 'main' into 3053-integrate-nft-api-to-display-names-for-…
Browse files Browse the repository at this point in the history
…nfts-within-simulations-on-mobile
  • Loading branch information
OGPoyraz authored Nov 19, 2024
2 parents df74e3b + 95fbed4 commit e742c68
Show file tree
Hide file tree
Showing 22 changed files with 2,459 additions and 332 deletions.
8 changes: 7 additions & 1 deletion app/reducers/swaps/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,13 @@ export const swapsSmartTxFlagEnabled = createSelector(
export const selectSwapsChainFeatureFlags = createSelector(
swapsStateSelector,
chainIdSelector,
(swapsState, chainId) => swapsState[chainId].featureFlags,
(swapsState, chainId) => ({
...swapsState[chainId].featureFlags,
smartTransactions: {
...(swapsState[chainId].featureFlags?.smartTransactions || {}),
...(swapsState.featureFlags?.smartTransactions || {}),
},
}),
);

/**
Expand Down
12 changes: 6 additions & 6 deletions app/reducers/swaps/swaps.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const DEFAULT_FEATURE_FLAGS = {
smartTransactions: {
expectedDeadline: 45,
maxDeadline: 150,
returnTxHashAsap: false,
mobileReturnTxHashAsap: false,
},
},
bsc: {
Expand Down Expand Up @@ -90,7 +90,7 @@ describe('swaps reducer', () => {
smartTransactions: {
expectedDeadline: 45,
maxDeadline: 150,
returnTxHashAsap: false,
mobileReturnTxHashAsap: false,
},
};

Expand Down Expand Up @@ -122,7 +122,7 @@ describe('swaps reducer', () => {
smartTransactions: {
expectedDeadline: 45,
maxDeadline: 150,
returnTxHashAsap: false,
mobileReturnTxHashAsap: false,
},
};

Expand Down Expand Up @@ -154,7 +154,7 @@ describe('swaps reducer', () => {
smartTransactions: {
expectedDeadline: 45,
maxDeadline: 150,
returnTxHashAsap: false,
mobileReturnTxHashAsap: false,
},
};

Expand Down Expand Up @@ -226,7 +226,7 @@ describe('swaps reducer', () => {
smartTransactions: {
expectedDeadline: 45,
maxDeadline: 150,
returnTxHashAsap: false,
mobileReturnTxHashAsap: false,
},
},
},
Expand Down Expand Up @@ -281,7 +281,7 @@ describe('swaps reducer', () => {
smartTransactions: {
expectedDeadline: 45,
maxDeadline: 150,
returnTxHashAsap: false,
mobileReturnTxHashAsap: false,
},
},
},
Expand Down
2 changes: 1 addition & 1 deletion app/selectors/smartTransactionsController.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const getDefaultState = () => {
smartTransactions: {
expectedDeadline: 45,
maxDeadline: 160,
returnTxHashAsap: false,
mobileReturnTxHashAsap: false,
},
},
},
Expand Down
4 changes: 2 additions & 2 deletions app/util/smart-transactions/smart-publish-hook.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ function withRequest<ReturnValue>(
smartTransactions: {
expectedDeadline: 45,
maxDeadline: 150,
returnTxHashAsap: false,
mobileReturnTxHashAsap: false,
},
mobile_active: true,
extension_active: true,
Expand Down Expand Up @@ -231,7 +231,7 @@ describe('submitSmartTransactionHook', () => {

it('returns a txHash asap if the feature flag requires it', async () => {
withRequest(async ({ request }) => {
request.featureFlags.smartTransactions.returnTxHashAsap = true;
request.featureFlags.smartTransactions.mobileReturnTxHashAsap = true;
const result = await submitSmartTransactionHook(request);
expect(result).toEqual({ transactionHash });
});
Expand Down
10 changes: 5 additions & 5 deletions app/util/smart-transactions/smart-publish-hook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export interface SubmitSmartTransactionRequest {
| {
expectedDeadline: number;
maxDeadline: number;
returnTxHashAsap: boolean;
mobileReturnTxHashAsap: boolean;
}
| Record<string, never>;
};
Expand All @@ -74,7 +74,7 @@ class SmartTransactionHook {
smartTransactions: {
expectedDeadline?: number;
maxDeadline?: number;
returnTxHashAsap?: boolean;
mobileReturnTxHashAsap?: boolean;
};
};
#shouldUseSmartTransaction: boolean;
Expand Down Expand Up @@ -262,10 +262,10 @@ class SmartTransactionHook {
uuid: string,
) => {
let transactionHash: string | undefined | null;
const returnTxHashAsap =
this.#featureFlags?.smartTransactions?.returnTxHashAsap;
const mobileReturnTxHashAsap =
this.#featureFlags?.smartTransactions?.mobileReturnTxHashAsap;

if (returnTxHashAsap && submitTransactionResponse?.txHash) {
if (mobileReturnTxHashAsap && submitTransactionResponse?.txHash) {
transactionHash = submitTransactionResponse.txHash;
} else {
transactionHash = await this.#waitForTransactionHash({
Expand Down
Loading

0 comments on commit e742c68

Please sign in to comment.