statebox / purescript-studio

Statebox studio + core + API + REST client
https://studio.statebox.cloud
4 stars 0 forks source link

Transaction decoding differs from `stbx-core-js` #369

Open marcosh opened 4 years ago

marcosh commented 4 years ago

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:

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)