Skip to content

Commit

Permalink
fix: allow direct access to /receive/stx
Browse files Browse the repository at this point in the history
  • Loading branch information
pete-watters committed Oct 12, 2023
1 parent 65e8930 commit b3042d0
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
4 changes: 4 additions & 0 deletions src/app/routes/app-routes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ function useAppRoutes() {
return createHashRouter(
createRoutesFromElements(
<Route element={<Container />}>
<Route
path={`/${RouteUrls.Receive}/${RouteUrls.ReceiveStx}`}
element={<ReceiveStxModal />}
/>
<Route
path={`${RouteUrls.Home}*`}
element={
Expand Down
2 changes: 1 addition & 1 deletion src/shared/crypto/bitcoin/bitcoin.utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ interface GetTaprootAddressArgs {
network: BitcoinNetworkModes;
}
export function getTaprootAddress({ index, keychain, network }: GetTaprootAddressArgs) {
if (!keychain) throw new Error('Expected dddkeychain to be provided');
if (!keychain) throw new Error('Expected keychain to be provided');

if (keychain.depth !== DerivationPathDepth.Account)
throw new Error('Expects keychain to be on the account index');
Expand Down
7 changes: 2 additions & 5 deletions tests/page-object-models/home.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ export class HomePage {
}

async goToReceiveModal() {
PETE check this
await this.page.getByTestId(HomePageSelectors.ReceiveCryptoAssetBtn).click();
}

Expand Down Expand Up @@ -89,11 +88,9 @@ export class HomePage {
async getReceiveStxAddress() {
await this.goToReceiveModal();
// In Ledger mode, this element isn't visible, so clicking is conditional
const qrCodeBtn = this.page.getByTestId(HomePageSelectors.ReceiveStxQrCodeBtn);
debugger;
// const qrCodeBtn = this.page.getByTestId(HomePageSelectors.ReceiveStxQrCodeBtn);

// THIS seems to run no matter whattttttt! maybe its goToReceiveModal crashing
if (false) await qrCodeBtn.click();
// if (await qrCodeBtn.isVisible()) await qrCodeBtn.click();
const displayerAddress = await this.page
.getByTestId(SharedComponentsSelectors.AddressDisplayer)
.innerText();
Expand Down

0 comments on commit b3042d0

Please sign in to comment.