CosmWasm / CosmWasm/book

Error when running unit tests: `Generic error: Error decoding bech32`

Open
#66 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
No language data
Stars
35
Forks
21
PR merge metrics
No merged PRs in 30d

Description

Hi everyone,

First, thanks a lot for writing/maintaining this book. This is an awesome learning resource!

While following the book, I found an error when running unit tests. The following block of code
```rust
// TODO: something goes wrong when instantiating the contract with admins
// Maybe related to this: 
let addr = app
.instantiate_contract(
code_id,
Addr::unchecked("owner"),
&InstantiateMsg {
admins: vec!["admin1".to_owned()],
donation_denom: "eth".to_owned(),
},
&[],
"Contract",
None,
)
.unwrap();
```
leads to the next error:
```
--- contract::tests::instantiation stdout ----
thread 'contract::tests::instantiation' panicked at src/contract.rs:178:14:
called `Result::unwrap()` on an `Err` value: Error executing WasmMsg:
sender: owner
Instantiate { admin: None, code_id: 1, msg: {"admins":["admin1"],"donation_denom":"eth"}, funds: [], label: "Contract" }

Caused by:
Generic error: Error decoding bech32
```

From what I understand, it seems to come from cw_multi_test. They currently have an issue opened that seems to relate to the problem: https://github.com/CosmWasm/cw-multi-test/issues/165

Here is a repository containing the bug: https://github.com/maxmousse/cosmwasm-test/tree/cosmwasm-tuto. Just run `cargo test` and the error should show.

I'd be happy to submit a pull request when there is a consensus about how to fix this =)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.