From 8f65f1f91a40e4a572af9e3fb8eeac588623f5de Mon Sep 17 00:00:00 2001 From: Thibaut Bremand Date: Tue, 5 Dec 2023 10:13:41 +0100 Subject: [PATCH] Rename into 'Submit Raw Transaction' --- ...{build_json_tx.cy.ts => submit_raw_json_tx.cy.ts} | 12 +++--------- .../src/components/pages/BuildTransaction/index.ts | 1 - .../extension/src/components/pages/Login/Login.tsx | 4 ++-- .../src/components/pages/Settings/Settings.tsx | 6 +++--- .../SubmitRawTransaction.tsx} | 4 ++-- .../components/pages/SubmitRawTransaction/index.ts | 1 + .../src/components/pages/routes/private.routes.ts | 6 +++--- packages/extension/src/constants/paths.ts | 8 ++++---- 8 files changed, 18 insertions(+), 24 deletions(-) rename packages/extension/cypress/e2e/{build_json_tx.cy.ts => submit_raw_json_tx.cy.ts} (89%) delete mode 100644 packages/extension/src/components/pages/BuildTransaction/index.ts rename packages/extension/src/components/pages/{BuildTransaction/BuildTransaction.tsx => SubmitRawTransaction/SubmitRawTransaction.tsx} (97%) create mode 100644 packages/extension/src/components/pages/SubmitRawTransaction/index.ts diff --git a/packages/extension/cypress/e2e/build_json_tx.cy.ts b/packages/extension/cypress/e2e/submit_raw_json_tx.cy.ts similarity index 89% rename from packages/extension/cypress/e2e/build_json_tx.cy.ts rename to packages/extension/cypress/e2e/submit_raw_json_tx.cy.ts index 8a3f9533f..8a2773603 100644 --- a/packages/extension/cypress/e2e/build_json_tx.cy.ts +++ b/packages/extension/cypress/e2e/submit_raw_json_tx.cy.ts @@ -3,7 +3,7 @@ import { Chain, XRPLNetwork } from '@gemwallet/constants'; import { navigate } from '../utils/navigation'; // deepcode ignore NoHardcodedPasswords: password used for testing purposes -const BUILD_TX_URL = 'http://localhost:3000/build-transaction?transaction=buildRaw'; +const SUBMIT_RAW_TRANSACTION_PATH = 'http://localhost:3000/build-transaction?transaction=buildRaw'; const PASSWORD = 'SECRET_PASSWORD'; beforeEach(() => { @@ -25,7 +25,7 @@ beforeEach(() => { describe('JSON Transaction', () => { it('Sign JSON Transaction', () => { - navigate(BUILD_TX_URL, PASSWORD); + navigate(SUBMIT_RAW_TRANSACTION_PATH, PASSWORD); const rawTx = `{ "TransactionType": "Payment", @@ -65,19 +65,13 @@ describe('JSON Transaction', () => { // Click on 'Sign' button cy.get('button').contains('Sign').click(); - cy.get('h1[data-testid="transaction-title"]').should('have.text', 'Transaction in progress'); - cy.get('p[data-testid="transaction-subtitle"]').should( - 'have.text', - 'We are processing your transactionPlease wait' - ); - cy.get('h1[data-testid="transaction-title"]').contains('Transaction accepted', { timeout: 10000 }); }); it('Submit JSON Transaction', () => { - navigate(BUILD_TX_URL, PASSWORD); + navigate(SUBMIT_RAW_TRANSACTION_PATH, PASSWORD); const rawTx = `{ "TransactionType": "Payment", diff --git a/packages/extension/src/components/pages/BuildTransaction/index.ts b/packages/extension/src/components/pages/BuildTransaction/index.ts deleted file mode 100644 index a28940764..000000000 --- a/packages/extension/src/components/pages/BuildTransaction/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './BuildTransaction'; diff --git a/packages/extension/src/components/pages/Login/Login.tsx b/packages/extension/src/components/pages/Login/Login.tsx index 5c9865209..335d1c2fa 100644 --- a/packages/extension/src/components/pages/Login/Login.tsx +++ b/packages/extension/src/components/pages/Login/Login.tsx @@ -20,7 +20,6 @@ import { EventLoginBackgroundMessage, GEM_WALLET } from '@gemwallet/constants'; import { ACCEPT_NFT_OFFER_PATH, ADD_NEW_TRUSTLINE_PATH, - BUILD_TRANSACTION_PATH, BURN_NFT_PATH, CANCEL_NFT_OFFER_PATH, CANCEL_OFFER_PATH, @@ -51,6 +50,7 @@ import { SHARE_NFT_PATH, SHARE_PUBLIC_ADDRESS_PATH, SHARE_PUBLIC_KEY_PATH, + SUBMIT_RAW_TRANSACTION_PATH, SIGN_MESSAGE_PATH, SIGN_TRANSACTION_PATH, STORAGE_WALLETS, @@ -119,7 +119,7 @@ export const Login: FC = () => { } else if (search.includes(PARAMETER_TRANSACTION_CANCEL_OFFER)) { navigate(`${CANCEL_OFFER_PATH}${search}`); } else if (search.includes(PARAMETER_TRANSACTION_BUILD_RAW)) { - navigate(`${BUILD_TRANSACTION_PATH}${search}`); + navigate(`${SUBMIT_RAW_TRANSACTION_PATH}${search}`); } else { navigate(`${HOME_PATH}${search}`); } diff --git a/packages/extension/src/components/pages/Settings/Settings.tsx b/packages/extension/src/components/pages/Settings/Settings.tsx index c61e9542d..69afcb4a8 100644 --- a/packages/extension/src/components/pages/Settings/Settings.tsx +++ b/packages/extension/src/components/pages/Settings/Settings.tsx @@ -6,7 +6,6 @@ import { useNavigate } from 'react-router-dom'; import { ABOUT_PATH, - BUILD_TRANSACTION_PATH, DELETE_ACCOUNT_PATH, FAQ_LINK, FEEDBACK_LINK, @@ -14,6 +13,7 @@ import { PERMISSIONS_PATH, RESET_PASSWORD_PATH, STORAGE_PERMISSION_ADVANCED_MODE, + SUBMIT_RAW_TRANSACTION_PATH, TRUSTED_APPS_PATH } from '../../../constants'; import { useWallet } from '../../../contexts'; @@ -82,9 +82,9 @@ export const Settings: FC = () => { const advancedItems = useMemo( () => [ { - name: 'Build Transaction', + name: 'Submit Raw Transaction', type: 'button', - onClick: () => navigate(BUILD_TRANSACTION_PATH) + onClick: () => navigate(SUBMIT_RAW_TRANSACTION_PATH) } ], [navigate] diff --git a/packages/extension/src/components/pages/BuildTransaction/BuildTransaction.tsx b/packages/extension/src/components/pages/SubmitRawTransaction/SubmitRawTransaction.tsx similarity index 97% rename from packages/extension/src/components/pages/BuildTransaction/BuildTransaction.tsx rename to packages/extension/src/components/pages/SubmitRawTransaction/SubmitRawTransaction.tsx index 85f71229b..6b6755895 100644 --- a/packages/extension/src/components/pages/BuildTransaction/BuildTransaction.tsx +++ b/packages/extension/src/components/pages/SubmitRawTransaction/SubmitRawTransaction.tsx @@ -18,7 +18,7 @@ import { useNetwork, useWallet } from '../../../contexts'; import { generateKey, saveInChromeSessionStorage } from '../../../utils'; import { PageWithReturn } from '../../templates'; -export const BuildTransaction: FC = () => { +export const SubmitRawTransaction: FC = () => { const { getCurrentWallet } = useWallet(); const { hasOfflineBanner } = useNetwork(); const editorHeight = useMemo(() => { @@ -108,7 +108,7 @@ export const BuildTransaction: FC = () => { }`; return ( - +
diff --git a/packages/extension/src/components/pages/SubmitRawTransaction/index.ts b/packages/extension/src/components/pages/SubmitRawTransaction/index.ts new file mode 100644 index 000000000..5ad932534 --- /dev/null +++ b/packages/extension/src/components/pages/SubmitRawTransaction/index.ts @@ -0,0 +1 @@ +export * from './SubmitRawTransaction'; diff --git a/packages/extension/src/components/pages/routes/private.routes.ts b/packages/extension/src/components/pages/routes/private.routes.ts index 14b87b94e..039b54f3f 100644 --- a/packages/extension/src/components/pages/routes/private.routes.ts +++ b/packages/extension/src/components/pages/routes/private.routes.ts @@ -5,7 +5,7 @@ import { ACCEPT_NFT_OFFER_PATH, ADD_NEW_TRUSTLINE_PATH, ADD_NEW_WALLET_PATH, - BUILD_TRANSACTION_PATH, + SUBMIT_RAW_TRANSACTION_PATH, BURN_NFT_PATH, CANCEL_NFT_OFFER_PATH, CANCEL_OFFER_PATH, @@ -37,7 +37,6 @@ import { About } from '../About'; import { AcceptNFTOffer } from '../AcceptNFTOffer'; import { AddNewTrustline } from '../AddNewTrustline'; import { AddNewWallet } from '../AddNewWallet'; -import { BuildTransaction } from '../BuildTransaction'; import { BurnNFT } from '../BurnNFT'; import { CancelNFTOffer } from '../CancelNFTOffer'; import { CancelOffer } from '../CancelOffer'; @@ -61,6 +60,7 @@ import { SharePublicKey } from '../SharePublicKey'; import { SignMessage } from '../SignMessage'; import { SignTransaction } from '../SignTransaction'; import { SubmitBulkTransactions } from '../SubmitBulkTransactions'; +import { SubmitRawTransaction } from '../SubmitRawTransaction'; import { SubmitTransaction } from '../SubmitTransaction'; import { Transaction } from '../Transaction'; import { TrustedApps } from '../TrustedApps'; @@ -74,7 +74,6 @@ export const privateRoutes: PrivateRouteConfig[] = [ { path: ACCEPT_NFT_OFFER_PATH, element: AcceptNFTOffer }, { path: ADD_NEW_TRUSTLINE_PATH, element: AddNewTrustline }, { path: ADD_NEW_WALLET_PATH, element: AddNewWallet }, - { path: BUILD_TRANSACTION_PATH, element: BuildTransaction }, { path: BURN_NFT_PATH, element: BurnNFT }, { path: CANCEL_NFT_OFFER_PATH, element: CancelNFTOffer }, { path: CANCEL_OFFER_PATH, element: CancelOffer }, @@ -98,6 +97,7 @@ export const privateRoutes: PrivateRouteConfig[] = [ { path: SHARE_NFT_PATH, element: ShareNFT }, { path: SIGN_MESSAGE_PATH, element: SignMessage }, { path: SIGN_TRANSACTION_PATH, element: SignTransaction }, + { path: SUBMIT_RAW_TRANSACTION_PATH, element: SubmitRawTransaction }, { path: SUBMIT_TRANSACTION_PATH, element: SubmitTransaction }, { path: SUBMIT_TRANSACTIONS_BULK_PATH, element: SubmitBulkTransactions }, { path: TRANSACTION_PATH, element: Transaction }, diff --git a/packages/extension/src/constants/paths.ts b/packages/extension/src/constants/paths.ts index c9a83abb8..31a379d37 100644 --- a/packages/extension/src/constants/paths.ts +++ b/packages/extension/src/constants/paths.ts @@ -1,7 +1,6 @@ export const MAIN_FILE = '/index.html'; export const ABOUT_PATH = '/about'; export const ACCEPT_NFT_OFFER_PATH = '/accept-nft-offer'; -export const BUILD_TRANSACTION_PATH = '/build-transaction'; export const BURN_NFT_PATH = '/burn-nft'; export const ADD_NEW_WALLET_PATH = '/add-new-wallet'; export const ADD_NEW_TRUSTLINE_PATH = '/add-new-trustline'; @@ -26,13 +25,14 @@ export const SEND_PATH = '/send'; export const RECEIVE_PATH = '/receive'; export const SETTINGS_PATH = '/settings'; export const SET_ACCOUNT_PATH = '/set-account'; +export const SHARE_NFT_PATH = '/share-nft'; +export const SHARE_PUBLIC_ADDRESS_PATH = '/share-public-address'; +export const SHARE_PUBLIC_KEY_PATH = '/share-public-key'; export const SIGN_MESSAGE_PATH = '/sign-message'; export const SIGN_TRANSACTION_PATH = '/sign-transaction'; export const SUBMIT_TRANSACTION_PATH = '/submit-transaction'; export const SUBMIT_TRANSACTIONS_BULK_PATH = '/submit-transactions-bulk'; -export const SHARE_NFT_PATH = '/share-nft'; -export const SHARE_PUBLIC_ADDRESS_PATH = '/share-public-address'; -export const SHARE_PUBLIC_KEY_PATH = '/share-public-key'; +export const SUBMIT_RAW_TRANSACTION_PATH = '/submit-raw-transaction'; export const TRANSACTION_PATH = '/transaction'; export const TRUSTED_APPS_PATH = '/trusted-apps'; export const WELCOME_PATH = '/welcome';