Skip to content
Cosmopediaby Unity Nodes
DiscussionsCosmos-SDKUnmarshalBinaryBare expected to read prefix bytes 75FBFAB8 (since it is registered concrete) but got 0A141DFAForum ↗

UnmarshalBinaryBare expected to read prefix bytes 75FBFAB8 (since it is registered concrete) but got 0A141DFA

Cosmos-SDK9 posts3,916 views5 likesLast activity Aug 2018
GB
gblue1223OP
Aug 2018

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 ↗

JA
jack
Aug 2018

What version of the SDK are you using? Also I’m assuming this is basecoin?

GB
gblue1223
Aug 2018

The version is 0.23.1-d27c5ee and yes, it is basecoin example.

JA
jack
Aug 2018 1

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.

GB
gblue1223
Aug 2018

I see, it seems like I need to do my homework.

GB
gblue1223
Aug 2018 2

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.

VA
valardragon
Aug 2018 1

If this makes basecoin work for you, want to submit a PR to the SDK?

JA
jack
Aug 2018

Yes please! We would love a PR for this!

GB
gblue1223
Aug 2018 1

I just submitted PR. :smiley:

← Back to Discussions