Skip to content
This repository has been archived by the owner on Dec 25, 2023. It is now read-only.

Error: Invalid string. Length must be a multiple of 4 #177

Open
msedzins opened this issue Aug 21, 2023 · 0 comments
Open

Error: Invalid string. Length must be a multiple of 4 #177

msedzins opened this issue Aug 21, 2023 · 0 comments

Comments

@msedzins
Copy link

Summary of the bug

We try to use the newest CosmWasmJS (1.1.1) to connect to newest Wasmd (taken from main branch). Transaction gets committed successfully on chain but as a response we get this error in the client:

/Users/msedzinski/git/client/node_modules/base64-js/index.js:26 
[1]     throw new Error('Invalid string. Length must be a multiple of 4')

I think the error is related to those issues (already closed):
cosmos/cosmos-sdk#11997
ping-pub/faucet#4

Solution, mentioned there, is to update cosmjs client.

Are there any plans to do that anytime soon?

Versions

CosmWasmJS 1.1.1
Wasmd - main branch
CosmJS - 0.28 (which seems to be to old)

Steps to reproduce

  1. Run Wasmd
  2. Generate transaction from CosmWasmJS that emits event
  3. Error happens each time

Full error stack

1] /Users/msedzinski/git/wasp-viaterna-client/node_modules/base64-js/index.js:26
[1]     throw new Error('Invalid string. Length must be a multiple of 4')
[1]           ^
[1] 
[1] Error: Invalid string. Length must be a multiple of 4
[1]     at getLens (/Users/msedzinski/git/wasp-viaterna-client/node_modules/base64-js/index.js:26:11)
[1]     at Object.toByteArray (/Users/msedzinski/git/wasp-viaterna-client/node_modules/base64-js/index.js:55:14)
[1]     at fromBase64 (/Users/msedzinski/git/wasp-viaterna-client/node_modules/@cosmjs/encoding/build/base64.js:32:21)
[1]     at decodeAttribute (/Users/msedzinski/git/wasp-viaterna-client/node_modules/@cosmjs/tendermint-rpc/build/tendermint34/adaptor/responses.js:40:40)
[1]     at Array.map (<anonymous>)
[1]     at decodeAttributes (/Users/msedzinski/git/wasp-viaterna-client/node_modules/@cosmjs/tendermint-rpc/build/tendermint34/adaptor/responses.js:45:53)
[1]     at decodeEvent (/Users/msedzinski/git/wasp-viaterna-client/node_modules/@cosmjs/tendermint-rpc/build/tendermint34/adaptor/responses.js:50:40)
[1]     at Array.map (<anonymous>)
[1]     at decodeEvents (/Users/msedzinski/git/wasp-viaterna-client/node_modules/@cosmjs/tendermint-rpc/build/tendermint34/adaptor/responses.js:55:49)
[1]     at decodeTxData (/Users/msedzinski/git/wasp-viaterna-client/node_modules/@cosmjs/tendermint-rpc/build/tendermint34/adaptor/responses.js:63:31)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant