UnmarshalBinaryBare expected to read prefix bytes 75FBFAB8 (since it is registered concrete) but got 0A141DFA
I’m trying to transfer coins from Alice’s account to Bob’s account through Basecoin example. However at the first time, I couldn’t even send a Tx because of the error: `ERROR: Cannot encode unregistered concrete type auth.StdTx.`. So I’ve added this code: `cdc.RegisterConcrete(&auth.StdTx{}, "auth/StdTx", nil)` to `basecoin/app/app.go`. Afterward the Tx was succeded and Alice’s coin balance is shrinked. But I couldn’t find out Bab’s coin balance with below error. ``` $ basecli account cosmosaccaddr1rhavh905ytjwx8vqz5x8s8hxdsqfzcgrkyqdhe panic: UnmarshalBinaryBare expected to read prefix bytes 75FBFAB8 (since it is registered concrete) but got 0A141DFA... goroutine 1 [running]: github.com/cosmos/cosmos-sdk/examples/basecoin/types.GetAccountDecoder.func1(0xc4209bc030, 0x29, 0x2a, 0x0, 0x0, 0x0, 0x1) /home/arpeggio/go/src/github.com/cosmos/cosmos-sdk/examples/basecoin/types/account.go:42 +0x18f github.com/cosmos/cosmos-sdk/x/auth/client/cli.GetAccountCmd.func1(0xc4208be240, 0xc420133ee0, 0x1, 0x1, 0x0, 0x0) /home/arpeggio/go/src/github.com/cosmos/cosmos-sdk/x/auth/client/cli/account.go:63 +0x265…
Excerpt (1114 of 6831 characters). Read the whole post on the forum ↗
What version of the SDK are you using? Also I’m assuming this is basecoin?
The version is 0.23.1-d27c5ee and yes, it is basecoin example.
We have been making a bunch of changes to the SDK in preparation for the hub launch. We have not kept basecoin up to date and won’t be fixing the incompatibilities until after we launch the hub.
I see, it seems like I need to do my homework.
I got it. The account mapper’s parameter was wrong.
I’ve changed the problematic code:
app.accountMapper = auth.NewAccountMapper(
cdc,
app.keyAccount, // target store
auth.ProtoBaseAccount, // prototype
)
to this:
app.accountMapper = auth.NewAccountMapper(
cdc,
app.keyAccount, // target store
func () auth.Account {
return &types.AppAccount{}
},
)
So, now I can see Bob’s balance!
Hope it helps someone.
If this makes basecoin work for you, want to submit a PR to the SDK?
Yes please! We would love a PR for this!
I just submitted PR. 