2

I am trying to run a forked version of the Stellar-Laboratory, I have forked the js-stellar-base and js-stellar-sdk accordingly, basically what I am trying to do is add a new operation on the Laboratory UI.

The new operation is mimicking every aspect of the BumpSequence operation.

I modified js-stellar-base, then published it to npm as a separate package. Then, in js-stellar-sdk I updated the version of js-stellar-base inside the package.json file.

Then I published the js-stellar-sdk(my version) also to npm.

Now I am using my own version of js-stellar-sdk in the modified version of stellar-laboratory.

And I am not able to generate XDR for any operation, neither for the one I added, nor for the older ones and it is returning this error:

"- XDR Write Error: undefined is not a Hyper "

If anyone can provide any resolution or hint to get rid of this error.

If any other info is required, feel free to ask.

Note: All the changes that are made are mentioned in the above description, they are very minimal changes and it is more like building on top of the existing structure.

1 Answer 1

1

You should debug the XDR serialisation stage. Something that should be a 64-bit integer is null. The one hint you get is that the field type is Hyper. This refers to 64-bit signed or unsigned integers in the XDR scheme. You can see the Hyper fields in the XDR serialisation code.

3
  • I was able to remove the errors related to "XDR write error", only one error is remaining which states "Error: Bad Union Switch -789528406". Any idea how this can be resolved.
    – Deb
    Commented Jan 4, 2019 at 11:58
  • 1
    The union switches are discriminants for the type Discriminated Union tools.ietf.org/html/rfc4506#section-4.15. They're usually a very small neg or pos integer. If you get a large number, then there's been a problem parsing the previous fields. I would debug the serialisation, so you can view the fields as they are serialised to make sure they look correct as per the XDR RFC and the Stellar definition: github.com/stellar/js-stellar-base/tree/master/xdr
    – Synesso
    Commented Jan 5, 2019 at 23:51
  • This is the test that is failing: TransactionEnvelope calculates correct hash with non-utf8 strings: Error: Bad union switch: -789528406
    – Deb
    Commented Jan 7, 2019 at 6:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.