Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/rainbow-me/rainbow into …
Browse files Browse the repository at this point in the history
…@benisgold/claimables-wallet-screen
  • Loading branch information
benisgold committed Sep 11, 2024
2 parents 07d1dab + 82dca43 commit 88b55d3
Show file tree
Hide file tree
Showing 38 changed files with 506 additions and 308 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/macstadium-builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ jobs:
# Job to install dependencies
build:
runs-on: ["self-hosted"]
if: github.event.pull_request.draft == false
timeout-minutes: 75
if: github.event.pull_request.draft == false && github.event.pull_request.merged == false
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/macstadium-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ jobs:
# iOS build and e2e tests
e2e-ios:
runs-on: ["self-hosted"]
timeout-minutes: 60
needs: install-deps
steps:
- name: Download Yarn cache
Expand All @@ -105,10 +106,11 @@ jobs:
key: xcode-cache-deriveddata-${{ github.workflow }}-${{ github.sha }}
restore-keys: xcode-cache-deriveddata-${{ github.workflow }}-

# Detox iOS e2e tests
- name: Run iOS e2e tests with retry
- name: Modify env and build app in release mode
run: |
sed -i'' -e "s/IS_TESTING=false/IS_TESTING=true/" .env && rm -f .env-e
yarn detox build --configuration ios.sim.release
./scripts/run-retry-tests.sh 3
- name: Detox iOS e2e tests
run: |
./scripts/run-retry-tests.sh 3
42 changes: 42 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,48 @@ and this project adheres to [Semantic Versioning](http://semver.org/)

### Fixed

## [1.9.37] (https://github.com/rainbow-me/rainbow/releases/tag/v1.9.37)

### Added

- Implement NFTs v2 Arc endpoint (#5973)
- Added mutation and queries needed for spindl integration (#6031)
- Added translations for degen mode and popular in rainbow (#6020)
- Added featured results to the dapp browser trending dapps section on the discover screen (#6046, #6049)
- Implemented perceived finality where a pending transaction is detected and confirmed, we are flagging the affected assets’ addresses and refetching updated user assets balances from BE (#6037)
- Implemented Mobile Wallet Protocol (#6061)
- Added ability to hide collectibles section (#6073)

### Changed

- Use chainId instead of network parts 1 and 2 (#5981, #5997)
- Shortened popular tokens list from 6 to 3 (#6028)
- Removed old logger and cleaned up logging (#6021)
- Added support for navigating to swap settings as a route (#6036)
- Upgraded some packages to the latest version (#6040)
- Cleaned up e2e on Android (#5970)
- Bumped WC and did some refactoring (#6047, #6064)
- Bumped webpack from 5.90.3 to 5.94.0 (#6048)
- Bumped fastlane (#6062)

### Fixed

- Fixed an issue on android where a user couldn’t access dexscreener in the dapp browser (#6003)
- Fixed Dapp Browser webview height on Android devices (#6004)
- Fixed Android button navigation colors (#6005)
- Fixed TokenToBuyList line break in search results when favoriting a token (#6002)
- Fixed a bug where the terminal UI for ETH rewards was missing (#6007)
- Fixed a bug where a user’s favorites wouldn’t migrate after updating app (#6029)
- Fixed an issue where we were not able to build android locally (#6027)
- Fixed a sentry error boundary crash where users would see the oops something went wrong message (#6044)
- Fixed an issue when certain sites won’t load if using the http prefix (#6054)
- Fixed an issue on ERC20 sends that would show contract address instead of recipient address (#6052)
- Fixed some crashes on PFP button, and send flow (#6063)
- Fixed a bug where WC was not confirming transactions (#6074)
- Fixed a bug where attempting to send an ENS caused a crash (#6075)
- Fixed a discrepancy where gas on l2s were showing higher in send flow than in swaps flow (#6076)
- Fixed a wrong ID being used for spindl integration (#6078)

## [1.9.36] (https://github.com/rainbow-me/rainbow/releases/tag/v1.9.36)

### Fixed
Expand Down
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@ android {
applicationId "me.rainbow"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 228
versionName "1.9.37"
versionCode 230
versionName "1.9.38"
missingDimensionStrategy 'react-native-camera', 'general'
renderscriptTargetApi 23
renderscriptSupportModeEnabled true
Expand Down
9 changes: 5 additions & 4 deletions e2e/9_swaps.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,14 @@ describe('Swap Sheet Interaction Flow', () => {
it('Should open swap screen with 50% inputAmount for inputAsset', async () => {
await device.disableSynchronization();
await tap('swap-button');
await delayTime('long');
await delayTime('very-long');

await swipeUntilVisible('token-to-buy-dai-1', 'token-to-buy-list', 'up', 100);
await swipe('token-to-buy-list', 'up', 'slow', 0.1);
// flaky
// await swipeUntilVisible('token-to-buy-dai-1', 'token-to-buy-list', 'up', 100);
await swipe('token-to-buy-list', 'up', 'slow', 0.2);

await tap('token-to-buy-dai-1');
await delayTime('medium');
await delayTime('very-long');

const swapInput = await fetchElementAttributes('swap-asset-input');

Expand Down
8 changes: 4 additions & 4 deletions ios/Rainbow.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1836,7 +1836,7 @@
"$(PROJECT_DIR)",
);
LLVM_LTO = YES;
MARKETING_VERSION = 1.9.37;
MARKETING_VERSION = 1.9.38;
OTHER_CFLAGS = "$(inherited)";
OTHER_LDFLAGS = (
"$(inherited)",
Expand Down Expand Up @@ -1900,7 +1900,7 @@
"$(PROJECT_DIR)",
);
LLVM_LTO = YES;
MARKETING_VERSION = 1.9.37;
MARKETING_VERSION = 1.9.38;
OTHER_CFLAGS = "$(inherited)";
OTHER_LDFLAGS = (
"$(inherited)",
Expand Down Expand Up @@ -2017,7 +2017,7 @@
"$(PROJECT_DIR)",
);
LLVM_LTO = YES;
MARKETING_VERSION = 1.9.37;
MARKETING_VERSION = 1.9.38;
OTHER_CFLAGS = "$(inherited)";
OTHER_LDFLAGS = (
"$(inherited)",
Expand Down Expand Up @@ -2133,7 +2133,7 @@
"$(PROJECT_DIR)",
);
LLVM_LTO = YES;
MARKETING_VERSION = 1.9.37;
MARKETING_VERSION = 1.9.38;
OTHER_CFLAGS = "$(inherited)";
OTHER_LDFLAGS = (
"$(inherited)",
Expand Down
2 changes: 1 addition & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ module.exports = {
],
},
transformIgnorePatterns: [
'node_modules/(?!((jest-)?react-native|react-native-keyboard-area|imgix-core-js|react-native-payments|@react-native-firebase|@react-native(-community)?|react-native-reanimated)/)',
'node_modules/(?!((jest-)?react-native|react-native-keyboard-area|imgix-core-js|react-native-payments|@react-native-firebase|@react-native(-community)?|react-native-reanimated|react-native-linear-gradient)/)',
],
moduleNameMapper: {
...pathsToModuleNameMapper(compilerOptions.paths, {
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Rainbow",
"version": "1.9.37-1",
"version": "1.9.38-1",
"private": true,
"scripts": {
"setup": "yarn graphql-codegen:install && yarn ds:install && yarn allow-scripts && yarn postinstall && yarn graphql-codegen",
Expand All @@ -21,6 +21,7 @@
"clean:packager": "watchman watch-del-all",
"clean:node": "rm -rf node_modules",
"nuke": "./scripts/nuke.sh",
"rc-push": "./scripts/rc-push.sh",
"detox:android:release": "detox build -c android.emu.release && detox test -c android.emu.release",
"detox:android:tests": "detox test -c android.emu.debug --maxWorkers 2 -- --bail 1",
"detox:android": "detox build -c android.emu.debug && yarn detox:android:tests",
Expand Down
63 changes: 63 additions & 0 deletions scripts/rc-push.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
#!/bin/bash
source .env

# Get the current branch name
BRANCH_NAME=$(git rev-parse --abbrev-ref HEAD)

# Define the regular expression for the RC branch
BRANCH_REGEX="^rc-v([0-9]+)\.([0-9]+)\.([0-9]+)$"

# Exit early if the branch name doesn't match the pattern
if [[ ! $BRANCH_NAME =~ $BRANCH_REGEX ]]; then
echo "Error: you are not on the RC branch" >&2
exit 1
fi

# Extract version numbers from the branch name
MAJOR=${BASH_REMATCH[1]}
MINOR=${BASH_REMATCH[2]}
PATCH=${BASH_REMATCH[3]}

# Create a tag from the version numbers (without the rc- prefix)
TAG="v$MAJOR.$MINOR.$PATCH"
echo "Creating tag $TAG"

# Create the git tag
git tag "$TAG"

# Push the tag to the remote repository
git push --tags

# Force push the current branch to master
echo "Force pushing branch $BRANCH_NAME to master"
git push origin "$BRANCH_NAME:master" --force

# Get the latest commit SHA on the master branch
COMMIT_SHA=$(git rev-parse master)

# Get the current UTC time in ISO 8601 format
DEPLOYED_AT=$(date -u +"%Y-%m-%dT%H:%M:%SZ")

# App name, repository, and environment (fill in the correct values)
APP_NAME="rainbow"
REPO_NAME="rainbow-me/rainbow"
ENVIRONMENT="production"

echo "Notifying Swarmia about the new release"

# Make the HTTP request to Swarmia
curl -X POST \
https://hook.swarmia.com/deployments \
-H "Authorization: " \
-H "Content-Type: application/json" \
-d '{
"version": "'"$TAG"'",
"appName": "'"$APP_NAME"'",
"environment": "'"$ENVIRONMENT"'",
"deployedAt": "'"$DEPLOYED_AT"'",
"commitSha": "'"$COMMIT_SHA"'",
"repositoryFullName": "'"$REPO_NAME"'"
}'

echo "";
echo "Release created succesfully"
5 changes: 3 additions & 2 deletions src/__swaps__/screens/Swap/Swap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import { useSwapsStore } from '@/state/swaps/swapsStore';
import { SwapWarning } from './components/SwapWarning';
import { clearCustomGasSettings } from './hooks/useCustomGas';
import { SwapProvider, useSwapContext } from './providers/swap-provider';
import { useAccountSettings } from '@/hooks';
import { NavigateToSwapSettingsTrigger } from './components/NavigateToSwapSettingsTrigger';

/** README
Expand Down Expand Up @@ -133,7 +134,7 @@ const useCleanupOnUnmount = () => {
};

const WalletAddressObserver = () => {
const currentWalletAddress = userAssetsStore(state => state.associatedWalletAddress);
const { accountAddress } = useAccountSettings();
const { setAsset } = useSwapContext();

const setNewInputAsset = useCallback(() => {
Expand All @@ -157,7 +158,7 @@ const WalletAddressObserver = () => {
}, [setAsset]);

useAnimatedReaction(
() => currentWalletAddress,
() => accountAddress,
(current, previous) => {
const didWalletAddressChange = previous && current !== previous;

Expand Down
4 changes: 2 additions & 2 deletions src/__swaps__/screens/Swap/components/CoinRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import * as i18n from '@/languages';
import { RainbowNetworkObjects } from '@/networks';
import { BASE_DEGEN_ADDRESS, DEGEN_CHAIN_DEGEN_ADDRESS, ETH_ADDRESS } from '@/references';
import { toggleFavorite } from '@/resources/favorites';
import { userAssetsStore } from '@/state/assets/userAssets';
import { useUserAssetsStore } from '@/state/assets/userAssets';
import { ethereumUtils, haptics, showActionSheetWithOptions } from '@/utils';
import { startCase } from 'lodash';
import React, { useCallback, useMemo } from 'react';
Expand Down Expand Up @@ -69,7 +69,7 @@ interface OutputCoinRowProps extends PartialAsset {
type CoinRowProps = InputCoinRowProps | OutputCoinRowProps;

export function CoinRow({ isFavorite, onPress, output, uniqueId, testID, ...assetProps }: CoinRowProps) {
const inputAsset = userAssetsStore(state => (output ? undefined : state.getUserAsset(uniqueId)));
const inputAsset = useUserAssetsStore(state => (output ? undefined : state.getUserAsset(uniqueId)));
const outputAsset = output ? (assetProps as PartialAsset) : undefined;

const asset = output ? outputAsset : inputAsset;
Expand Down
4 changes: 2 additions & 2 deletions src/__swaps__/screens/Swap/components/SearchInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { opacity } from '@/__swaps__/utils/swaps';
import { Input } from '@/components/inputs';
import { Bleed, Box, Column, Columns, Text, useColorMode, useForegroundColor } from '@/design-system';
import * as i18n from '@/languages';
import { userAssetsStore } from '@/state/assets/userAssets';
import { userAssetsStore, useUserAssetsStore } from '@/state/assets/userAssets';
import { useSwapsStore } from '@/state/swaps/swapsStore';
import React from 'react';
import Animated, {
Expand Down Expand Up @@ -39,7 +39,7 @@ export const SearchInput = ({
const label = useForegroundColor('label');
const labelQuaternary = useForegroundColor('labelQuaternary');

const onInputSearchQueryChange = userAssetsStore(state => state.setSearchQuery);
const onInputSearchQueryChange = useUserAssetsStore(state => state.setSearchQuery);

const onOutputSearchQueryChange = useDebouncedCallback((text: string) => useSwapsStore.setState({ outputSearchQuery: text }), 100, {
leading: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { ContextMenuButton } from '@/components/context-menu';
import { AnimatedText, Bleed, Box, Inline, Text, TextIcon, globalColors, useColorMode } from '@/design-system';
import { useAccountAccentColor } from '@/hooks';
import { useSharedValueState } from '@/hooks/reanimated/useSharedValueState';
import { userAssetsStore } from '@/state/assets/userAssets';
import { userAssetsStore, useUserAssetsStore } from '@/state/assets/userAssets';
import { swapsStore } from '@/state/swaps/swapsStore';
import { showActionSheetWithOptions } from '@/utils';
import { OnPressMenuItemEventObject } from 'react-native-ios-context-menu';
Expand All @@ -31,8 +31,11 @@ export const ChainSelection = memo(function ChainSelection({ allText, output }:
const { selectedOutputChainId, setSelectedOutputChainId } = useSwapContext();

// chains sorted by balance on output, chains without balance hidden on input
const balanceSortedChainList = userAssetsStore(state => (output ? state.getBalanceSortedChainList() : state.getChainsWithBalance()));
const inputListFilter = useSharedValue(userAssetsStore.getState().filter);
const { balanceSortedChainList, filter } = useUserAssetsStore(state => ({
balanceSortedChainList: output ? state.getBalanceSortedChainList() : state.getChainsWithBalance(),
filter: state.filter,
}));
const inputListFilter = useSharedValue(filter);

const accentColor = useMemo(() => {
if (c.contrast(accountColor, isDarkMode ? '#191A1C' : globalColors.white100) < (isDarkMode ? 2.125 : 1.5)) {
Expand Down Expand Up @@ -189,7 +192,7 @@ export const ChainSelection = memo(function ChainSelection({ allText, output }:
const ChainButtonIcon = ({ output }: { output: boolean | undefined }) => {
const { selectedOutputChainId: animatedSelectedOutputChainId } = useSwapContext();

const userAssetsFilter = userAssetsStore(state => (output ? undefined : state.filter));
const userAssetsFilter = useUserAssetsStore(state => (output ? undefined : state.filter));
const selectedOutputChainId = useSharedValueState(animatedSelectedOutputChainId, { pauseSync: !output });

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { getStandardizedUniqueIdWorklet } from '@/__swaps__/utils/swaps';
import { analyticsV2 } from '@/analytics';
import { useDelayedMount } from '@/hooks/useDelayedMount';
import * as i18n from '@/languages';
import { userAssetsStore } from '@/state/assets/userAssets';
import { userAssetsStore, useUserAssetsStore } from '@/state/assets/userAssets';
import { swapsStore } from '@/state/swaps/swapsStore';
import { DEVICE_WIDTH } from '@/utils/deviceUtils';
import React, { useCallback, useMemo } from 'react';
Expand Down Expand Up @@ -38,7 +38,7 @@ export const TokenToSellList = () => {
const TokenToSellListComponent = () => {
const { inputProgress, internalSelectedInputAsset, internalSelectedOutputAsset, isFetching, isQuoteStale, setAsset } = useSwapContext();

const userAssetIds = userAssetsStore(state => state.getFilteredUserAssetIds());
const userAssetIds = useUserAssetsStore(state => state.getFilteredUserAssetIds());

const handleSelectToken = useCallback(
(token: ParsedSearchAsset | null) => {
Expand Down
15 changes: 6 additions & 9 deletions src/__swaps__/screens/Swap/hooks/useAssetsToSell.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { useMemo } from 'react';
import { Address } from 'viem';

import {
selectUserAssetsList,
Expand All @@ -9,8 +8,7 @@ import {
import { useUserAssets } from '@/__swaps__/screens/Swap/resources/assets';
import { ParsedAssetsDictByChain, ParsedSearchAsset, UserAssetFilter } from '@/__swaps__/types/assets';
import { useAccountSettings, useDebounce } from '@/hooks';
import { userAssetsStore } from '@/state/assets/userAssets';
import { useConnectedToHardhatStore } from '@/state/connectedToHardhat';
import { useUserAssetsStore } from '@/state/assets/userAssets';

const sortBy = (by: UserAssetFilter) => {
switch (by) {
Expand All @@ -24,18 +22,17 @@ const sortBy = (by: UserAssetFilter) => {
export const useAssetsToSell = () => {
const { accountAddress: currentAddress, nativeCurrency: currentCurrency } = useAccountSettings();

const filter = userAssetsStore(state => state.filter);
const searchQuery = userAssetsStore(state => state.inputSearchQuery);
const { filter, searchQuery } = useUserAssetsStore(state => ({
filter: state.filter,
searchQuery: state.inputSearchQuery,
}));

const debouncedAssetToSellFilter = useDebounce(searchQuery, 200);

const { connectedToHardhat } = useConnectedToHardhatStore();

const { data: userAssets = [] } = useUserAssets(
{
address: currentAddress as Address,
address: currentAddress,
currency: currentCurrency,
testnetMode: connectedToHardhat,
},
{
select: data =>
Expand Down
Loading

0 comments on commit 88b55d3

Please sign in to comment.