Closed lmorgan824 closed 1 year ago
I believe this is because the top half of an I128Parts
is now Hyper
, not UnsignedHyper
.
This was done as part of stellar/stellar-xdr#78.
In other words, this does not work:
let i128 = StellarBase.xdr.ScVal.scvI128(
new StellarBase.xdr.Int128Parts({
hi: new StellarBase.xdr.Uint64(0, 0),
lo: new StellarBase.xdr.Uint64(0, 1),
})
);
i128.toXDR();
but this does:
let i128 = StellarBase.xdr.ScVal.scvI128(
new StellarBase.xdr.Int128Parts({
hi: new StellarBase.xdr.Int64(0, 0),
lo: new StellarBase.xdr.Uint64(0, 1),
})
);
i128.toXDR();
Right on, I'll change that up. I know Paul was talking about adding the encode/decode for ScVal's to js-stellar-base, I guess that would eliminate these types of errors.
Thanks, Lou
Yeah, this sucks, and nobody downstream should have to care about stuff like this.
I've opened stellar/js-stellar-base#610 to track improving this.
Describe the bug XdrWriterError [TypeError]: XDR Write Error: 0 is not a Hyper
We're getting this when trying to call .prepareTransaction or when calling .toXDR() on a transaction for soroban. This call works with soroban-client 0.5.0.
What version are you on? soroban-client 0.6.1
To Reproduce Steps to reproduce the behavior:
Expected behavior Print .toXDR() for the transaction and call .prepareTransaction
Additional context Dump from pxpump.js which shows the parameter array is valid ScVal I128's Converted quote: