Behaviour of SDK is different on localhost and production

Hey guys.

I have the same piece of code running on both localhost and production.

On localhost the software works as expected, while on production given the same inputs I got an error from the SDK:

The error is:
aepp-sdk.browser.js:952 Uncaught (in promise) Error: Invalid checksum and is caused by the usage of decodeBase64Check.

You can find the complete source here:

I checked both version of the SDK - they are the same - 6.1.3.

Redeployed multiple times in case of a “package cache” or something like that. No results.

Thanks @kraykov it would also be good to get an example of the data you are trying to decode when you encounter this issue.

1 Like

examples:
cb_VFJYLDB4OWNjN2E1MzRjZjc0MmNkYjllZTE2ZmJmNmI1ZjQ4YTA5ZTQ4NWM1MiwxMDAwMDAwMDAwMDAwMDAwMDAsNTkzOTY3OTU0MiwxNTc2ODk4NzI2MDAwLEFDMzk3MDU3NjI1RTk0OTczM0EzNDAwMDM0MDdCNTQyMzc3QUY4QjcyQzY4NjE4QjQ3MEQxQjNFNjM3RTRCQjKg

cb_VFJYLDB4OWNjN2E1MzRjZjc0MmNkYjllZTE2ZmJmNmI1ZjQ4YTA5ZTQ4NWM1MiwxMDAwMDAwLDU5Mzk2Nzk1NDgsMTc3MzY1MzAxODExMSxDNTA2QTk3QkRDODE5NjU1RUMyMTNGNjk4RjJCNkY4NkQ1M0VERTU2N0Y2NjFBQjRBMDc3QjFDOTVBMTc4MTI1fVyoPA

Can you please also provide lines where you get this cb_... string

https://testnet.aeternal.io/middleware/contracts/calls/address/ct_2M9XPMwz1GggFRPatEd2aAPZbig32ZqRJBnhTT2yRVM4k6CQnb

from the above endpoint I get the callinfo and then the log

Then the log is processed like this:

return Crypto.decodeBase64Check(log[0].data.slice(3)) .toString('utf-8') .split(',');