taquito icon indicating copy to clipboard operation
taquito copied to clipboard

Wallet not opening, "_proto" is read-only

Open Riyenz opened this issue 3 years ago • 9 comments

Description A clear and concise description of what the bug is.

Steps To Reproduce Steps to reproduce the behavior:

  1. Connect Wallet on Ithacanet
  2. Run the code below.
Tezos.wallet
  .batch([
    {
      kind: 'transaction',
      to: 'KT1CZMHskePxx8xgDwNfvfdAdDCUoE9jMzbA',
      amount: 0,
      mutez: false,
      parameter: {
        entrypoint: 'approve',
        value: {
          prim: 'Pair',
          args: [
            { string: 'KT193W4yQZXLwLfW6wzvgVdUYncnC5imvWUq' },
            { int: '0' },
          ],
        },
      },
    },
    {
      kind: 'transaction',
      to: 'KT1CZMHskePxx8xgDwNfvfdAdDCUoE9jMzbA',
      amount: 0,
      mutez: false,
      parameter: {
        entrypoint: 'approve',
        value: {
          prim: 'Pair',
          args: [
            { string: 'KT193W4yQZXLwLfW6wzvgVdUYncnC5imvWUq' },
            { int: '110' },
          ],
        },
      },
    },
    {
      kind: 'transaction',
      to: 'KT193W4yQZXLwLfW6wzvgVdUYncnC5imvWUq',
      amount: 0,
      mutez: false,
      parameter: {
        entrypoint: 'deploy_FA1_vesting',
        value: {
          prim: 'Pair',
          args: [
            {
              prim: 'Pair',
              args: [
                { string: 'tz1fxojJcp9viALhishZ34pkmnHgEwiies3p' },
                {
                  prim: 'Pair',
                  args: [
                    [
                      {
                        prim: 'Elt',
                        args: [
                          { string: 'tz1fxojJcp9viALhishZ34pkmnHgEwiies3p' },
                          { int: '100' },
                        ],
                      },
                    ],
                    { int: '3589' },
                  ],
                },
              ],
            },
            {
              prim: 'Pair',
              args: [
                { int: '31536000' },
                {
                  prim: 'Pair',
                  args: [
                    { prim: 'True' },
                    { string: 'KT1CZMHskePxx8xgDwNfvfdAdDCUoE9jMzbA' },
                  ],
                },
              ],
            },
          ],
        },
      },
    },
  ])
  .send();

Expected behavior Expected Behavior is to open a wallet to confirm the transaction.

Screenshots image

Desktop (please complete the following information):

  • Firefox, Chrome

Smartphone (please complete the following information):

  • Macbook Pro 13inch

Additional context N/A

Riyenz avatar Jun 19 '22 07:06 Riyenz

The error in the first screenshot seems to suggest that you are trying to forge the transaction with an account that hasn't been revealed yet. If you give me the address, I can check it for you and reveal it if necessary so you can use it :)

claudebarde avatar Jun 19 '22 09:06 claudebarde

HI @claudebarde,

here's the contract address KT193W4yQZXLwLfW6wzvgVdUYncnC5imvWUq then I'm using this address KT1CZMHskePxx8xgDwNfvfdAdDCUoE9jMzbA as fake token when calling deploy_FA1_vesting in vested_token_address.

Thank you for your assistance, I appreciate it a lot.

Riyenz avatar Jun 20 '22 15:06 Riyenz

I am sorry, I meant the address of the implicit account you are using to sign the transaction. I got it from your screenshot (tzlfV0angAfb9J1hRRMP2bSB6LvASD6KpY8A) and it says it wasn't revealed in the explorer, so it cannot work. https://ithacanet.tzkt.io/tzlfV0angAfb9J1hRRMP2bSB6LvASD6KpY8A/operations/

claudebarde avatar Jun 20 '22 15:06 claudebarde

You will have to reveal the address first before you can use it, for example, by sending a small amount of XTZ. Let me know if you need assistance with that.

claudebarde avatar Jun 20 '22 15:06 claudebarde

I tried again with a revealed address (https://ithacanet.tzkt.io/tz1gncPPFVkzaWVAoe57RRVZ3np3db1qdXoQ/info), but still getting the same error. So we can discard this hypothesis. Any idea on what that error might be due to ? It’s really blocking. I’m using next.js btw

Riyenz avatar Jun 21 '22 09:06 Riyenz

I hardly believe you still get an empty_implicit_account with a revealed and funded account. You must be signing the transaction with another account that is not revealed, for example, the one I mentioned in my previous comment and that is included in the error message itself (and still not revealed).

claudebarde avatar Jun 21 '22 12:06 claudebarde

Hi!

I'm confirming the empty_implicit_account error is now indeed gone! However, that _proto is readonly error remains. It's really weird as it only happens when running against the testnet. Any idea what's going on ? What in your code could make this attribute readonly ? That sounds very weird as it's cleary being mutated here: https://github.com/ecadlabs/taquito/blob/080483a8189ba0c2c8a7cebf018e2b68e7edb56a/packages/taquito/src/forger/taquito-local-forger.ts#L17.

Do you think it could somehow be due to next.js?

What's even weirder, is that when running a next.js production build against the testnet, it does work with the same code, using the same implicit address and querying the same smart contract addresses as when running against the dev server. Except the dev server throws that _proto error and not the production server. It's honestly some of the darkest voodoo I've ever seen.

Thanks for your help.

tbinetruy avatar Jun 24 '22 22:06 tbinetruy

I don't think it is mutated but instantiated instead. As you can see in this file, the _proto property is private, which means that TypeScript will prevent you from overwriting it. Are you trying to modify it?

claudebarde avatar Jun 25 '22 06:06 claudebarde

Hi, sorry for the late reply.

I'm not at all trying to modify it. Somewhere in your library code is the variable trying to get mutated. But not by us. Again, it works fine against the mainnet somehow. We're just switching networks. And again, the same code works when build in prod mode using next.js, but not in dev mode.

So I assume you've never encountered or heard of anything similar behavior ?

tbinetruy avatar Jul 04 '22 19:07 tbinetruy

Hey team! Please add your planning poker estimate with Zenhub @hui-an-yang @roxaneletourneau @zainen

dsawali avatar Dec 07 '22 18:12 dsawali

Hi @Riyenz & @tbinetruy

Thanks for reaching out. We are looking into the issue you encountered, tried recreating the bug doesn't seem possible from my end at the moment. Would be helpful to know what's next.js & taquito version you use. Also the ticket is opened in June would like to know if it's still the case now? Hope to help to sort this out soon :)

hui-an-yang avatar Dec 14 '22 17:12 hui-an-yang

Can't reproduce

Innkst avatar Jan 04 '23 17:01 Innkst