Skip to content

Commit

Permalink
Rename into 'Submit Raw Transaction'
Browse files Browse the repository at this point in the history
  • Loading branch information
ThibautBremand committed Dec 5, 2023
1 parent 2629597 commit 8f65f1f
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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(() => {
Expand All @@ -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",
Expand Down Expand Up @@ -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",
Expand Down

This file was deleted.

4 changes: 2 additions & 2 deletions packages/extension/src/components/pages/Login/Login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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}`);
}
Expand Down
6 changes: 3 additions & 3 deletions packages/extension/src/components/pages/Settings/Settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ import { useNavigate } from 'react-router-dom';

import {
ABOUT_PATH,
BUILD_TRANSACTION_PATH,
DELETE_ACCOUNT_PATH,
FAQ_LINK,
FEEDBACK_LINK,
NAV_MENU_HEIGHT,
PERMISSIONS_PATH,
RESET_PASSWORD_PATH,
STORAGE_PERMISSION_ADVANCED_MODE,
SUBMIT_RAW_TRANSACTION_PATH,
TRUSTED_APPS_PATH
} from '../../../constants';
import { useWallet } from '../../../contexts';
Expand Down Expand Up @@ -82,9 +82,9 @@ export const Settings: FC = () => {
const advancedItems = useMemo<ItemMenuGroup[]>(
() => [
{
name: 'Build Transaction',
name: 'Submit Raw Transaction',
type: 'button',
onClick: () => navigate(BUILD_TRANSACTION_PATH)
onClick: () => navigate(SUBMIT_RAW_TRANSACTION_PATH)
}
],
[navigate]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(() => {
Expand Down Expand Up @@ -108,7 +108,7 @@ export const BuildTransaction: FC = () => {
}`;

return (
<PageWithReturn title="Build Transaction" onBackClick={handleBack}>
<PageWithReturn title="Submit Raw Transaction" onBackClick={handleBack}>
<style>{jsonEditorStyle}</style>
<div style={{ margin: '1rem' }}>
<Typography variant="body1" style={{ marginBottom: '1rem' }}>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './SubmitRawTransaction';
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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';
Expand All @@ -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';
Expand All @@ -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 },
Expand All @@ -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 },
Expand Down
8 changes: 4 additions & 4 deletions packages/extension/src/constants/paths.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -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';
Expand Down

0 comments on commit 8f65f1f

Please sign in to comment.