Skip to content

Refactor Util.isTokenUtxo() #87

Description

@christroutner

The scope of this Issue is to refactor Util.isTokenUtxos() to match the refactoring done to tokenUtxoDetails() in PR #86. The new behavior of this function will return confident false or true. It will only return null if SLPDB has not processed the UTXO yet and has not yet made a determination of its validity.

The workflow for this refactor is as follows:

  • For each UTXO, retrieve the raw transaction data from the full node.
  • If there is no OP_RETURN in the TX, then the UTXO can be marked as false.
  • If there is an OP_RETURN, attempt to decode it. If it can't be decoded, then the UTXO can be marked as false.
  • If the OP_RETURN can be decoded as an SLP transaction, then the txid is validated with SLPDB.
  • If SLPDB returns null, it means it has not yet processed the utxo. The UTXO should be marked as null to communicate this.
  • Otherwise the UTXO can be marked true

Metadata

Metadata

Assignees

No one assigned

    Labels

    ReadyIssue is actionable

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions