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

getTxBalance returns undefined key balance when accounting creation token transaction proposal #557

Open
alexruzenhack opened this issue Jul 14, 2023 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@alexruzenhack
Copy link
Contributor

alexruzenhack commented Jul 14, 2023

During the tests for the multisig extension of wallet-headless project, I found that the balance key for a token creation of a transaction proposal is undefined as you can see bellow:

// decode response for a token creation transaction proposal
{
  success: true,
  balance: {
    '00': {
      tokens: { available: -1, locked: 0 },
      authorities: {
        melt: { available: 0, locked: 0 },
        mint: { available: 0, locked: 0 },
      },
    },
    undefined: { // token here is undefined because it is not already created
      tokens: { available: 100, locked: 0 },
      authorities: {
        melt: { available: 1, locked: 0 },
        mint: { available: 1, locked: 0 },
      },
    },
  },
  tx: {...},
}

See:
https://github.com/HathorNetwork/hathor-wallet-headless/blob/fd88de218d00d2f5f86d1873fc3b5d18840e4d76/__tests__/integration/multisig.test.js#L506C12-L506C12

Despite it be correct, undefined conveys the lack of intension, therefore it could be something like this:

'new-token:<token-name>': {
  tokens: { available: 100, locked: 0 },
  authorities: {
    melt: { available: 1, locked: 0 },
    mint: { available: 1, locked: 0 },
  },
},

Related to: HathorNetwork/hathor-wallet-headless#317

@alexruzenhack alexruzenhack self-assigned this Jul 14, 2023
@alexruzenhack alexruzenhack added the enhancement New feature or request label Jul 14, 2023
@alexruzenhack
Copy link
Contributor Author

Notify: @r4mmer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant