Skip to content

Transaction decoding differs from stbx-core-js #369

Description

@marcosh

if you use https://github.com/statebox/stbx-core-js and run the following test

let txH = `0a0022200a1e47756172616e746565642d456e7472616e63652d546f6b656e2e74657374`

let Stbx = require("..")

let tx = Stbx.decode(txH)

console.log(tx)

you get

{
  root: {
    message: '47756172616e746565642d456e7472616e63652d546f6b656e2e74657374'
  },
  previous: 'z'
}

on the other hand, if you use the studio service as follows:

  • add a console.log(x) to https://github.com/statebox/purescript-studio/blob/7fc06047f7a36d94ba699039199a382b8490de3a/stbx-core/src/Statebox/Core.js#L7
  • recompile stbx-core
  • recompile stbx-service-rest
  • run stbx-service-rest with npm run serve
  • call the service with
curl -X POST \
  http://localhost:8080/tx \
  -H 'Content-Type: application/json' \
  -d '{
	"tx": "0a0022200a1e47756172616e746565642d456e7472616e63652d546f6b656e2e74657374"
}'

you get the following printed in the console

{
  root: {
    message: '47756172616e746565642d456e7472616e63652d546f6b656e2e74657374'
  }
}

which is missing the previous: 'z' field

It looks like I'm using the correct version of stbx-core-js (0.0.31, see here)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions