Page MenuHomePhabricator

[Cashtab] Support slpv1 genesis txs for mint batons
ClosedPublic

Authored by bytesofman on Mar 30 2024, 05:14.

Details

Reviewers
emack
Group Reviewers
Restricted Project
Commits
rABC13248eaf1c9a: [Cashtab] Support slpv1 genesis txs for mint batons
Summary

T3495

Enable creation of slpv1 tokens with a mint baton.

Support for minting txs will be added later.

Test Plan

npm test

Diff Detail

Repository
rABC Bitcoin ABC
Branch
support-mintbatons-genesis
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 28183
Build 55911: Build Diffcashtab-tests
Build 55910: arc lint + arc unit

Event Timeline

Failed tests logs:

====== CashTab Unit Tests: <CreateTokenForm /> User can input valid token parameters, generate a token, and view a success notification ======
Error: Unable to find an element with the placeholder text of: Enter the fixed supply of your token

Ignored nodes: comments, script, style
<body>
  <div>
    <div
      class="ant-spin-nested-loading css-dev-only-do-not-override-1rqnfsa"
    >
      <div
        class="ant-spin-container"
      >
        <div
          class="sc-kcDeIU kgKfDI"
        >
          <div
            class="Toastify"
          />
          <div
            class="sc-cmjSyW jwpsva"
          >
            <div
              class="sc-sdtwF ijCnPZ"
            >
              <div
                class="sc-bFADNz cZpbyk"
              >
                <div
                  class="sc-iYUSvU MWsTz"
                >
                  <img
                    alt="cashtab"
                    class="sc-cHSUfg jyjdjN"
                    src="test-file-stub"
                  />
                </div>
                <div
                  class="sc-bbmXgH fLVOGg"
                  data-testid="wallet-info-ctn"
                >
                  <div
                    class="sc-iomxrj dYTJKM"
                  >
                    <select
                      class="sc-dvCyap dfxYvF"
                      id="wallets"
                      name="wallets"
                    >
                      <option
                        class="sc-iFMziU fiPrpy"
                        value="Transaction Fixtures"
                      >
                        Transaction Fixtures
                      </option>
                    </select>
                    <div
                      class="sc-hMqMXs cAbGIb"
                    >
                      <svg
                        class="sc-htoDjs dHRdfz"
                        style="margin-top: 8px;"
                      />
                    </div>
                    <div
                      class="sc-eLExRp icFLqc"
                    >
                      <input
                        checked=""
                        class="sc-fOKMvo cmysrp"
                        data-testid="show-hide-balance"
                        id="show-hide-balance"
                        name="show-hide-balance"
                        type="checkbox"
                      />
                      <label
                        class="sc-cbkKFq kCEdvn"
                        for="show-hide-balance"
                      >
                        <span
                          class="sc-krvtoX cOEecR"
                          data-off=""
                          data-on=""
                        />
                        <span
                          class="sc-fYiAbW ehbNtR"
                        />
                      </label>
                    </div>
                  </div>
                  <div
                    class="sc-keVrkP bVZapW"
                    data-testid="balance-xec"
                  >
                    9,513.12
                     
                    XEC
                     
                  </div>
                  <div
                    class="sc-gVLVqr cpEyGe"
                    data-testid="balance-fiat"
                  >
                    $
                    0.29
                     
                    USD
                  </div>
                  <p
                    class="sc-cBdUnI fWqlMo"
                    data-testid="ecash-price"
                  >
                    1 
                    XEC
                     = 
                    0.00003000
                     
                    USD
                  </p>
                </div>
              </div>
              <div
                class="sc-jqCOkK dpFugr"
              >
                <h3
                  class="sc-jzgbtB hpqzFC"
                >
                  Create a Token
                </h3>
                <div
                  class="sc-dUjcNx hZyEgr"
                >
                  <div
                    class="sc-iQNlJl gSDyLy"
                  >
                    <div
                      class="sc-bsbRJL gVlzfi"
                    >
                      <input
                        class="sc-hZSUBg iKddpB"
                        name="name"
                        placeholder="Enter a name for your token"
                        value="test token"
                      />
                    </div>
                    <div
                      class="sc-hORach fnZTRV"
                    />
                  </div>
                  <div
                    class="sc-iQNlJl gSDyLy"
                  >
                    <div
                      class="sc-bsbRJL gVlzfi"
                    >
                      <input
                        class="sc-hZSUBg iKddpB"
                        name="ticker"
                        placeholder="Enter a ticker for your token"
                        value="TKE"
                      />
                    </div>
                    <div
                      class="sc-hORach fnZTRV"
                    />
                  </div>
                  <div
                    class="sc-iQNlJl gSDyLy"
                  >
                    <div
                      class="sc-bsbRJL gVlzfi"
                    >
                      <input
                        class="sc-hZSUBg iKddpB"
                        name="decimals"
                        placeholder="Enter number of decimal places"
                        value="2"
                      />
                    </div>
                    <div
                      class="sc-hORach fnZTRV"
                    />
                  </div>
                  <div
                    class="sc-iQNlJl gSDyLy"
                  >
                    <div
                      class="sc-bsbRJL gVlzfi"
                    >
                      <input
                        class="sc-hZSUBg iKddpB"
                        name="initialQty"
                        placeholder="Enter the supply of your token"
                        value=""
                      />
                    </div>
                    <div
                      class="sc-hORach fnZTRV"
                    />
                  </div>
                  <div
                    class="sc-iQNlJl gSDyLy"
                  >
                    <div
                      class="sc-bsbRJL gVlzfi"
                    >
                      <input
                        class="sc-hZSUBg iKddpB"
                        name="url"
                        placeholder="Enter a website for your token"
                        value=""
                      />
                    </div>
                    <div
                      class="sc-hORach fnZTRV"
                    />
                  </div>
                  <div
                    class="sc-gHboQg cchJah"
                  >
                    <div
                      class="sc-eLExRp eFHkqF"
                    >
                      <input
                        class="sc-fOKMvo cmysrp"
                        data-testid="mint-baton-switch"
                        id="mint-baton-switch"
                        name="mint-baton-switch"
                        type="checkbox"
                      />
                      <label
                        class="sc-cbkKFq kCEdvn"
                        for="mint-baton-switch"
                      >
                        <span
                          class="sc-krvtoX ckpgVk"
                          data-off="Fixed"
                          data-on="Variable"
                        />
                        <span
                          class="sc-fYiAbW gQSswW"
                        />
                      </label>
                    </div>
                    <div
                      class="sc-eilVRo fAYCnl"
                    >
                      Token supply
                    </div>
                  </div>
                  <form
                    class="sc-GMQeP lfmfIr"
                    id="form-file-upload"
                  >
                    <input
                      class="sc-iujRgT dItviQ"
                      id="input-file-upload"
                      name="Cashtab Dragger"
                      type="file"
                    />
                    <label
                      class="sc-exAgwC fzGwex"
                      for="input-file-upload"
                      id="label-file-upload"
                    >
                      <div
                        class="sc-daURTG cmTGTe"
                      >
                        <p
                          class="sc-gojNiO jknDzv"
                        >
                          Drag and drop a png or jpg for your token icon
                        </p>
                        <div
                          class="sc-cQFLBn dQTCUz"
                        >
                          or click to upload
                        </div>
                      </div>
                    </label>
                  </form>
                  <button
                    class="sc-ibxdXY sc-iQKALj krPYXi"
                    style="margin-top: 30px;"
                  >
                    <span
                      aria-label="plus-square"
                      class="anticon anticon-plus-square"
                      role="img"
                    >
                      <svg
                        aria-hidden="true"
                        data-icon="plus-square"
                        fill="currentColor"
                        focusable="false"
                        height="1em"
                        viewBox="64 64 896 896"
                        width="1em"
                      >
                        <path
                          d="M328 544h152v152c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V544h152c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H544V328c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v152H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8z"
                        />
                        <path
                          d="M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z"
                        />
                      </svg>
                    </span>
                     Create eToken
                  </button>
                </div>
              </div>
            </div>
            <div
              class="sc-BngTV dCDCyP"
            >
              <button
                class="sc-gRnDUn bgTXzO"
              >
                <svg />
              </button>
              <button
                class="sc-gRnDUn bgTXzO"
                data-testid="nav-btn-send"
              >
                <svg
                  class="sc-jKJlTe fTQyTm"
                  style="margin-top: -9px;"
                />
              </button>
              <button
                class="sc-gRnDUn bgTXzO"
                data-testid="nav-btn-etokens"
              >
                <span
                  aria-label="appstore-add"
                  class="anticon anticon-appstore-add"
                  role="img"
                  style="font-size: 24px;"
                >
                  <svg
                    aria-hidden="true"
                    data-icon="appstore-add"
                    fill="currentColor"
                    focusable="false"
                    height="1em"
                    viewBox="64 64 896 896"
                    width="1em"
                  >
                    <defs />
                    <path
                      d="M464 144H160c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V160c0-8.8-7.2-16-16-16zm-52 268H212V212h200v200zm452-268H560c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V160c0-8.8-7.2-16-16-16zm-52 268H612V212h200v200zm52 132H560c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V560c0-8.8-7.2-16-16-16zm-52 268H612V612h200v200zM424 712H296V584c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v128H104c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h128v128c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V776h128c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8z"
                    />
                  </svg>
                </span>
              </button>
              <button
                class="sc-gRnDUn bgTXzO"
                data-testid="nav-btn-receive"
              >
                <svg />
              </button>
              <div
                class="sc-cqpYsc dcCFkQ"
                data-testid="hamburger"
              >
                <span
                  class="sc-hBbWxd gyoWfB"
                />
                <div
                  class="sc-dyGzUR iWnlwd"
                  data-testid="hamburger-menu"
                >
                  <button
                    class="sc-drKuOJ cFmRbo"
                    data-testid="nav-btn-airdrop"
                  >
                     
                    <p>
                      Airdrop
                    </p>
                    <svg
                      height="33px"
                      width="30px"
                    />
                  </button>
                  <button
                    class="sc-drKuOJ cFmRbo"
                    data-testid="nav-btn-swap"
                  >
                     
                    <p>
                      Swap
                    </p>
                    <span
                      aria-label="swap"
                      class="anticon anticon-swap"
                      role="img"
                      style="font-size: 24px;"
                    >
                      <svg
                        aria-hidden="true"
                        data-icon="swap"
                        fill="currentColor"
                        focusable="false"
                        height="1em"
                        viewBox="64 64 896 896"
                        width="1em"
                      >
                        <path
                          d="M847.9 592H152c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h605.2L612.9 851c-4.1 5.2-.4 13 6.3 13h72.5c4.9 0 9.5-2.2 12.6-6.1l168.8-214.1c16.5-21 1.6-51.8-25.2-51.8zM872 356H266.8l144.3-183c4.1-5.2.4-13-6.3-13h-72.5c-4.9 0-9.5 2.2-12.6 6.1L150.9 380.2c-16.5 21-1.6 51.8 25.1 51.8h696c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8z"
                        />
                      </svg>
                    </span>
                  </button>
                  <button
                    class="sc-drKuOJ cFmRbo"
                    data-testid="nav-btn-signverifymsg"
                  >
                    <p>
                      Sign & Verify
                    </p>
                    <svg
                      class="sc-jzJRlG kclOxT"
                    />
                  </button>
                  <button
                    class="sc-drKuOJ cFmRbo"
                    data-testid="nav-btn-configure"
                  >
                    <p>
                      Settings
                    </p>
                    <svg
                      height="33px"
                      width="30px"
                    />
                  </button>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</body>
    at waitForWrapper (/work/cashtab/node_modules/@testing-library/dom/dist/wait-for.js:163:27)
    at /work/cashtab/node_modules/@testing-library/dom/dist/query-helpers.js:86:33
    at Object.findByPlaceholderText (/work/cashtab/src/components/Etokens/__tests__/CreateTokenForm.test.js:118:26)

Each failure log is accessible here:
CashTab Unit Tests: <CreateTokenForm /> User can input valid token parameters, generate a token, and view a success notification

update test for new form placeholder, add test for minting slpv1 with mint baton

bytesofman added inline comments.
cashtab/src/components/Etokens/__tests__/CreateTokenForm.test.js
149 ↗(On Diff #46618)

image.png (625×789 px, 70 KB)

This revision is now accepted and ready to land.Mar 30 2024, 08:16