Page MenuHomePhabricator

[Cashtab] Remove swap screen
ClosedPublic

Authored by bytesofman on Wed, Dec 4, 22:38.

Details

Reviewers
emack
Group Reviewers
Restricted Project
Commits
rABCd71229b11eca: [Cashtab] Remove swap screen
Summary

Network analysis shows (some, not all) speed issues are sideshift-related. We are not really getting benefits from this integration. Need to do an API integration when we have a more compelling use case, like selling etokens to ETH users.

Anyway, the widget is not working now. It is easy enough to bring it back.

Test Plan

npm test

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Failed tests logs:

====== CashTab Unit Tests: <App /> Navigation menu routes to expected components ======
TestingLibraryElementError: Unable to find an accessible element with the role "button" and name `/Swap/i`

Here are the accessible roles:

  combobox:

  Name "":
  <select
    class="sc-ivVeuv jCkHZb"
    data-testid="wallet-select"
    id="wallets"
    name="wallets"
  />

  --------------------------------------------------
  option:

  Name "Transaction Fixtures":
  <option
    class="sc-cCbXAZ KYGLm"
    value="Transaction Fixtures"
  />

  --------------------------------------------------
  button:

  Name "Copy ecash:qqa9lv3kjd8vq7952p7rq0f6lkpqvlu0cydvxtd70g":
  <button
    aria-label="Copy ecash:qqa9lv3kjd8vq7952p7rq0f6lkpqvlu0cydvxtd70g"
    class="sc-frDJqD iDiUEE"
  />

  Name "Calculate Airdrop":
  <button
    class="sc-cHGsZl sc-kgAjT kvklbU"
    disabled=""
  />

  Name "Transactions":
  <button
    class="sc-hARARD jHsBRq"
  />

  Name "Send Screen":
  <button
    aria-label="Send Screen"
    class="sc-hARARD jHsBRq"
  />

  Name "Tokens":
  <button
    aria-label="Tokens"
    class="sc-hARARD jHsBRq"
  />

  Name "Receive":
  <button
    aria-label="Receive"
    class="sc-hARARD jHsBRq"
  />

  Name "Wallet Backup":
  <button
    class="sc-ccLTTT hhVhTb"
  />

  Name "Wallets":
  <button
    class="sc-ccLTTT hhVhTb"
  />

  Name "Listed NFTs":
  <button
    class="sc-ccLTTT hhVhTb"
  />

  Name "Agora":
  <button
    class="sc-ccLTTT hhVhTb"
  />

  Name "Contacts":
  <button
    class="sc-ccLTTT hhVhTb"
  />

  Name "Airdrop":
  <button
    class="sc-ccLTTT gdfLpY"
  />

  Name "Rewards":
  <button
    class="sc-ccLTTT hhVhTb"
  />

  Name "Sign & Verify":
  <button
    class="sc-ccLTTT hhVhTb"
  />

  Name "Settings":
  <button
    class="sc-ccLTTT hhVhTb"
  />

  --------------------------------------------------
  paragraph:

  Name "Price in Local Currency":
  <p
    class="sc-cmIlrE dzxFoT"
    title="Price in Local Currency"
  />

  Name "":
  <p />

  Name "":
  <p />

  Name "":
  <p />

  Name "":
  <p />

  Name "":
  <p />

  Name "":
  <p />

  Name "":
  <p />

  Name "":
  <p />

  Name "":
  <p />

  --------------------------------------------------
  heading:

  Name "Airdrop":
  <h2
    class="sc-feJyhm LeHXM"
  />

  --------------------------------------------------
  textbox:

  Name "":
  <input
    class="sc-kPVwWT fIufca"
    name="tokenId"
    placeholder="Enter the eToken ID"
    type="text"
    value=""
  />

  --------------------------------------------------
  spinbutton:

  Name "":
  <input
    class="sc-kPVwWT fIufca"
    name="totalAirdrop"
    placeholder="Enter the total XEC airdrop"
    type="number"
    value=""
  />

  --------------------------------------------------
  img:

  Name "cashtab":
  <img
    alt="cashtab"
    class="sc-bJHhxl gnzKcU"
    src="test-file-stub"
  />

  --------------------------------------------------

Ignored nodes: comments, script, style
<body>
  <div>
    <div
      class="sc-doWzTn eSEUfO"
    >
      <div
        class="Toastify"
      />
      <div
        class="sc-dBaXSw eiXTJJ"
      >
        <div
          class="sc-bNQFlB jgyiez"
        >
          <div
            class="sc-jQMNup fsyHbx"
          >
            <img
              alt="cashtab"
              class="sc-bJHhxl gnzKcU"
              src="test-file-stub"
            />
          </div>
          <div
            class="sc-epGmkI kXXYzD"
          >
            <div
              class="sc-dTLGrV enQcdd"
            >
              <select
                class="sc-ivVeuv jCkHZb"
                data-testid="wallet-select"
                id="wallets"
                name="wallets"
              >
                <option
                  class="sc-cCbXAZ KYGLm"
                  value="Transaction Fixtures"
                >
                  Transaction Fixtures
                </option>
              </select>
              <div
                class="sc-chAAoq kcTONx"
              >
                <button
                  aria-label="Copy ecash:qqa9lv3kjd8vq7952p7rq0f6lkpqvlu0cydvxtd70g"
                  class="sc-frDJqD iDiUEE"
                >
                  <svg
                    title="copy-paste"
                  />
                </button>
                <div
                  class="sc-fhYwyz fpwrfn"
                >
                  <div
                    class="sc-jzgbtB cdJgRi"
                  >
                    <input
                      checked=""
                      class="sc-CtfFt eXIHPX"
                      id="show-hide-balance"
                      name="show-hide-balance"
                      title="show-hide-balance"
                      type="checkbox"
                    />
                    <label
                      class="sc-gJWqzi cInajG"
                      for="show-hide-balance"
                    >
                      <span
                        class="sc-rBLzX kkNQQW"
                        data-off=""
                        data-on=""
                      />
                      <span
                        class="sc-bMvGRv kbAFcW"
                      />
                    </label>
                  </div>
                </div>
              </div>
            </div>
            <div
              class="sc-dphlzf CokLp"
              title="Wallet Info"
            >
              <div
                class="sc-fHSTwm bAKoVL"
                title="Balance in XEC"
              >
                9,513.12
                 
                XEC
                 
              </div>
              <div
                class="sc-hdPSEv jRtkzR"
                title="Balance in Local Currency"
              >
                $
                0.29
                 
                USD
              </div>
              <p
                class="sc-cmIlrE dzxFoT"
                title="Price in Local Currency"
              >
                1 
                XEC
                 = 
                0.00003000
                 
                USD
              </p>
            </div>
          </div>
          <div
            class="sc-hlILIN cywhvL"
          >
            <h2
              class="sc-feJyhm LeHXM"
            >
              Airdrop 
              <svg
                title="tx-airdrop"
              />
            </h2>
            <div
              class="sc-iNhVCk isYkuh"
            >
              <div
                class="sc-eAKXzc jmtdkT"
              >
                <div
                  class="sc-hXRMBi hCBXyr"
                >
                  <div
                    class="sc-iyvyFf hYTCIH"
                  >
                    <div
                      class="sc-hwwEjo hDjwVJ"
                    >
                      <input
                        class="sc-kPVwWT fIufca"
                        name="tokenId"
                        placeholder="Enter the eToken ID"
                        type="text"
                        value=""
                      />
                    </div>
                    <div
                      class="sc-gwVKww cJiJRu"
                    />
                  </div>
                </div>
              </div>
              <div
                class="sc-eAKXzc jmtdkT"
              >
                <div
                  class="sc-hXRMBi hCBXyr"
                >
                  <div
                    class="sc-iyvyFf hYTCIH"
                  >
                    <div
                      class="sc-hwwEjo hDjwVJ"
                    >
                      <input
                        class="sc-kPVwWT fIufca"
                        name="totalAirdrop"
                        placeholder="Enter the total XEC airdrop"
                        type="number"
                        value=""
                      />
                    </div>
                    <div
                      class="sc-gwVKww cJiJRu"
                    />
                  </div>
                </div>
              </div>
              <div
                class="sc-eAKXzc jmtdkT"
              >
                <div
                  class="sc-bfYoXt dmDCtr"
                >
                  <div
                    class="sc-fhYwyz fpwrfn"
                  >
                    <div
                      class="sc-jzgbtB fcmjAa"
                    >
                      <input
                        checked=""
                        class="sc-CtfFt eXIHPX"
                        id="Toggle Communism"
                        name="Toggle Communism"
                        title="Toggle Communism"
                        type="checkbox"
                      />
                      <label
                        class="sc-gJWqzi cInajG"
                        for="Toggle Communism"
                      >
                        <span
                          class="sc-rBLzX guCXHM"
                          data-off=""
                          data-on="Pro-Rata"
                        />
                        <span
                          class="sc-bMvGRv kTLmvA"
                        />
                      </label>
                    </div>
                  </div>
                  <div
                    class="sc-jnlKLf dMJtaZ"
                  >
                     Airdrop
                                scaled to token balance
                  </div>
                </div>
              </div>
              <div
                class="sc-eAKXzc jmtdkT"
              >
                <div
                  class="sc-bfYoXt dmDCtr"
                >
                  <div
                    class="sc-fhYwyz fpwrfn"
                  >
                    <div
                      class="sc-jzgbtB eYtruI"
                    >
                      <input
                        class="sc-CtfFt eXIHPX"
                        id="ignoreOwnAddress"
                        name="ignoreOwnAddress"
                        title="ignoreOwnAddress"
                        type="checkbox"
                      />
                      <label
                        class="sc-gJWqzi cInajG"
                        for="ignoreOwnAddress"
                      >
                        <span
                          class="sc-rBLzX bCvGgI"
                          data-off=""
                          data-on=""
                        />
                        <span
                          class="sc-bMvGRv iYoHpT"
                        />
                      </label>
                    </div>
                  </div>
                  <div
                    class="sc-jnlKLf dMJtaZ"
                  >
                    Ignore my own address
                  </div>
                </div>
              </div>
              <div
                class="sc-eAKXzc jmtdkT"
              >
                <div
                  class="sc-bfYoXt dmDCtr"
                >
                  <div
                    class="sc-fhYwyz fpwrfn"
                  >
                    <div
                      class="sc-jzgbtB eYtruI"
                    >
                      <input
                        class="sc-CtfFt eXIHPX"
                        disabled=""
                        id="Toggle Ignore Mint Address"
                        name="Toggle Ignore Mint Address"
                        title="Toggle Ignore Mint Address"
                        type="checkbox"
                      />
                      <label
                        class="sc-gJWqzi QbWG"
                        disabled=""
                        for="Toggle Ignore Mint Address"
                      >
                        <span
                          class="sc-rBLzX bCvGgI"
                          data-off=""
                          data-on=""
                        />
                        <span
                          class="sc-bMvGRv iYoHpT"
                        />
                      </label>
                    </div>
                  </div>
                  <div
                    class="sc-jnlKLf dMJtaZ"
                  >
                    Ignore eToken minter address
                  </div>
                </div>
              </div>
              <div
                class="sc-eAKXzc jmtdkT"
              >
                <div
                  class="sc-bfYoXt dmDCtr"
                >
                  <div
                    class="sc-fhYwyz fpwrfn"
                  >
                    <div
                      class="sc-jzgbtB eYtruI"
                    >
                      <input
                        class="sc-CtfFt eXIHPX"
                        disabled=""
                        id="Toggle Minimum Token Balance"
                        name="Toggle Minimum Token Balance"
                        title="Toggle Minimum Token Balance"
                        type="checkbox"
                      />
                      <label
                        class="sc-gJWqzi QbWG"
                        disabled=""
                        for="Toggle Minimum Token Balance"
                      >
                        <span
                          class="sc-rBLzX bCvGgI"
                          data-off=""
                          data-on=""
                        />
                        <span
                          class="sc-bMvGRv iYoHpT"
                        />
                      </label>
                    </div>
                  </div>
                  <div
                    class="sc-jnlKLf dMJtaZ"
                  >
                    Minimum eToken holder balance
                  </div>
                </div>
              </div>
              <div
                class="sc-eAKXzc jmtdkT"
              >
                <div
                  class="sc-bfYoXt dmDCtr"
                >
                  <div
                    class="sc-fhYwyz fpwrfn"
                  >
                    <div
                      class="sc-jzgbtB eYtruI"
                    >
                      <input
                        class="sc-CtfFt eXIHPX"
                        id="Toggle Ignore Custom Addresses"
                        name="Toggle Ignore Custom Addresses"
                        title="Toggle Ignore Custom Addresses"
                        type="checkbox"
                      />
                      <label
                        class="sc-gJWqzi cInajG"
                        for="Toggle Ignore Custom Addresses"
                      >
                        <span
                          class="sc-rBLzX bCvGgI"
                          data-off=""
                          data-on=""
                        />
                        <span
                          class="sc-bMvGRv iYoHpT"
                        />
                      </label>
                    </div>
                  </div>
                  <div
                    class="sc-jnlKLf dMJtaZ"
                  >
                    Ignore custom addresses
                  </div>
                </div>
              </div>
              <div
                class="sc-eAKXzc jmtdkT"
              >
                <button
                  class="sc-cHGsZl sc-kgAjT kvklbU"
                  disabled=""
                >
                  Calculate Airdrop
                </button>
              </div>
            </div>
          </div>
        </div>
        <div
          class="sc-dRCTWM gPgAfo"
        >
          <div
            class="sc-fQkuQJ hARqRG"
          >
            <img
              alt="cashtab"
              class="sc-bJHhxl gnzKcU"
              src="test-file-stub"
            />
          </div>
          <button
            class="sc-hARARD jHsBRq"
          >
            <span>
              Transactions
            </span>
            <svg />
          </button>
          <button
            aria-label="Send Screen"
            class="sc-hARARD jHsBRq"
          >
            <span>
              Send
            </span>
            <svg
              title="tx-sent"
            />
          </button>
          <button
            aria-label="Tokens"
            class="sc-hARARD jHsBRq"
          >
            <span>
              Tokens
            </span>
            <svg
              title="Tokens"
            />
          </button>
          <button
            aria-label="Receive"
            class="sc-hARARD jHsBRq"
          >
            <span>
              Receive
            </span>
            <svg
              title="tx-received"
            />
          </button>
          <div
            class="sc-cgHJcJ eLVFbL"
            title="Show Other Screens"
          >
            <span
              class="sc-hizQCF geXzoD"
            />
            <div
              class="sc-eNPDpu dupdTi"
              open=""
              title="Other Screens"
            >
              <button
                class="sc-ccLTTT hhVhTb"
              >
                 
                <p>
                  Wallet Backup
                </p>
                <svg
                  title="wallet"
                />
              </button>
              <button
                class="sc-ccLTTT hhVhTb"
              >
                 
                <p>
                  Wallets
                </p>
                <svg
                  title="wallets"
                />
              </button>
              <button
                class="sc-ccLTTT hhVhTb"
              >
                 
                <p>
                  Listed NFTs
                </p>
                <svg
                  title="NFT"
                />
              </button>
              <button
                class="sc-ccLTTT hhVhTb"
              >
                 
                <p>
                  Agora
                </p>
                <svg
                  title="Meme Agora"
                />
              </button>
              <button
                class="sc-ccLTTT hhVhTb"
              >
                 
                <p>
                  Contacts
                </p>
                <svg
                  title="Contact List"
                />
              </button>
              <button
                class="sc-ccLTTT gdfLpY"
              >
                 
                <p>
                  Airdrop
                </p>
                <svg
                  title="tx-airdrop"
                />
              </button>
              <button
                class="sc-ccLTTT hhVhTb"
              >
                 
                <p>
                  Rewards
                </p>
                <svg
                  title="Cashtab Rewards"
                />
              </button>
              <button
                class="sc-ccLTTT hhVhTb"
              >
                <p>
                  Sign & Verify
                </p>
                <svg
                  class="sc-htpNat bPFBeM"
                />
              </button>
              <button
                class="sc-ccLTTT hhVhTb"
              >
                <p>
                  Settings
                </p>
                <svg
                  title="settings"
                />
              </button>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</body>
    at Object.getElementError (/work/cashtab/node_modules/@testing-library/dom/dist/config.js:37:19)
    at /work/cashtab/node_modules/@testing-library/dom/dist/query-helpers.js:76:38
    at /work/cashtab/node_modules/@testing-library/dom/dist/query-helpers.js:52:17
    at /work/cashtab/node_modules/@testing-library/dom/dist/query-helpers.js:95:19
    at Object.getByRole (/work/cashtab/src/components/App/__tests__/App.test.js:274:20)

Each failure log is accessible here:
CashTab Unit Tests: <App /> Navigation menu routes to expected components

remove other sideshift refs

remove unused function and tests

bytesofman published this revision for review.Wed, Dec 4, 23:33
bytesofman edited the summary of this revision. (Show Details)
emack added a subscriber: emack.

FWIW - The widget is working in prod for me

image.png (1×871 px, 66 KB)

but performance enhancement is reason enough to remove.

This revision is now accepted and ready to land.Thu, Dec 5, 00:19
This revision was automatically updated to reflect the committed changes.