Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to encode 0x for empty values #442

Open
monapasan opened this issue May 15, 2024 · 1 comment
Open

Allow to encode 0x for empty values #442

monapasan opened this issue May 15, 2024 · 1 comment
Labels
bug Something isn't working discussion help wanted Extra attention is needed

Comments

@monapasan
Copy link

monapasan commented May 15, 2024

I'm submitting a...

  • [] bug report

Summary

It's not possible to remove a value at a certain index. When I run this:

const encoded = Erc725.encodeData([
    {
      keyName: 'LSP12IssuedAssets[]',
      totalArrayLength: previousIssuedAssets.length - 1,
      startingIndex: removedIndex,
      value: ['0x'],
    },
  ]);

I am receiving the following error:
An error occurred during the verification process Error: Address: "0x" is an invalid address.

On top of this I am unable to set lsp12IssuedAssetsMap to null:

const dataToEncode = {
    keyName: `LSP12IssuedAssetsMap:<address>`,
    dynamicKeyParts: assetAddress, // Dynamic part of the key (token's address)
    value: ["0x"], // Assuming interface ID and index
  };

I am receiving the following error:
An error occurred during the verification process Error: Can not encode tuple key value: 0x. Expecte array of length: 2

ps. also there is a type in the error message.

@CJ42 CJ42 added the bug Something isn't working label Nov 6, 2024
@CJ42
Copy link
Collaborator

CJ42 commented Nov 6, 2024

This is definitely a bug that should be looked at. It might be worth also thinking if this extends to other schemas with various value types or valueContent

@CJ42 CJ42 added help wanted Extra attention is needed discussion labels Nov 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working discussion help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants