Skip to content

Cannot decode DataContractCreateV1 with WASM-DPP #2653

@pshenmic

Description

@pshenmic

Issue

We are trying to decode transaction DataContractCreateV1 and retrieve a DataContract info to show details on Platform Explorer. State transition successfully decodes from the base64 string into a JS instance, but when you try to access a contract, it immediately throws a error "unreachable" when you access data contract through .getDataContract()

https://testnet.platform-explorer.com/transaction/A7830C35416A6D0FDE7644E22F8A2CEA4FD879B472AF55902E25D617805A4CAE

Possible Solution

Something is not right in DPP or WASM-DPP package, because there is no DataContractV1 state transitions that we could decode.

Steps to Reproduce (for bugs)

const base64 = 'AAABvnM/NhHXIUK3wEuco2jnUcySYcpuLyyJ7grhwK0ZMmYBAAAAAAEBAAABAUzmxtXsqGidVkD9CIgxwmoiJC52DUrTqcNLuSaWtw0hAAAAAAAAAAAAAQAAAAECZW4AAQ5UZXN0dG9rZW5lbXB0eQ5UZXN0dG9rZW5lbXB0eQAAAAAAAAD8AAGGoAAAAQEBAQEBAAEAAAAAAAAAAAAAAAAAAAABTObG1eyoaJ1WQP0IiDHCaiIkLnYNStOpw0u5Jpa3DSEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACBWVtcHR5DlRlc3R0b2tlbmVtcHR5AAEAAUEfRU87Uhl0W3Q/D4P7IpwXRtxhBPZU79xrCDaoQ8yHFDVlqPBtGO2Tmk0+eeBYRi0/AoIqjDs7KXhBY6EEeGdlgA=='

const stateTransition = await client.platform.dpp.stateTransition.createFromBuffer(Buffer.from(base64, 'base64'))

const dataContractConfig = stateTransition.getDataContract().getConfig()
RuntimeError: unreachable
    at wasm://wasm/027035e2:wasm-function[5951]:0x461c0c
    at wasm://wasm/027035e2:wasm-function[14415]:0x6c6211
    at wasm://wasm/027035e2:wasm-function[14416]:0x6c623d
    at wasm://wasm/027035e2:wasm-function[8048]:0x4f271a
    at wasm://wasm/027035e2:wasm-function[16098]:0x7725cb
    at wasm://wasm/027035e2:wasm-function[5955]:0x461eec
    at DataContractCreateTransition.getDataContract (/Users/bebra/Documents/Dash/platform-explorer/node_modules/@dashevo/wasm-dpp/dist/wasm/wasm_dpp.js:272:41)
    at Object.decodeStateTransition (/Users/bebra/Documents/Dash/platform-explorer/packages/api/src/utils.js:71:50)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Object.decode (/Users/bebra/Documents/Dash/platform-explorer/packages/api/src/controllers/TransactionsController.js:146:21)

Context

Your Environment

  • Version used:
  • Environment name and version (e.g. Chrome 39, node.js 5.4):
  • Operating System and version (desktop, server, or mobile):
  • Link to your project:

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions