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

Transaction decoding differs from stbx-core-js #369

Open
marcosh opened this issue Mar 4, 2020 · 0 comments
Open

Transaction decoding differs from stbx-core-js #369

marcosh opened this issue Mar 4, 2020 · 0 comments

Comments

@marcosh
Copy link
Contributor

marcosh commented Mar 4, 2020

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)

@wires wires removed their assignment Nov 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants