From 6a414e8404d22c9a5b8b2b55d745645a88a1b711 Mon Sep 17 00:00:00 2001 From: Raphael Jeongho Eom Date: Sat, 4 Aug 2018 07:11:41 +0900 Subject: [PATCH 1/3] Fix Basecoin example to work --- examples/basecoin/app/app.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/examples/basecoin/app/app.go b/examples/basecoin/app/app.go index af8376b2c1ac..55026c3687bd 100644 --- a/examples/basecoin/app/app.go +++ b/examples/basecoin/app/app.go @@ -63,7 +63,9 @@ func NewBasecoinApp(logger log.Logger, db dbm.DB, baseAppOptions ...func(*bam.Ba app.accountMapper = auth.NewAccountMapper( cdc, app.keyAccount, // target store - auth.ProtoBaseAccount, // prototype + func () auth.Account { + return &types.AppAccount{} + }, ) app.coinKeeper = bank.NewKeeper(app.accountMapper) app.ibcMapper = ibc.NewMapper(app.cdc, app.keyIBC, app.RegisterCodespace(ibc.DefaultCodespace)) @@ -104,6 +106,7 @@ func MakeCodec() *wire.Codec { // register custom types cdc.RegisterInterface((*auth.Account)(nil), nil) cdc.RegisterConcrete(&types.AppAccount{}, "basecoin/Account", nil) + cdc.RegisterConcrete(auth.StdTx{}, "auth/StdTx", nil) cdc.Seal() From ad096946b56711b740accdbb79066b4422830647 Mon Sep 17 00:00:00 2001 From: Raphael Jeongho Eom Date: Sat, 4 Aug 2018 07:55:30 +0900 Subject: [PATCH 2/3] Fix Basecoin example to work --- PENDING.md | 1 + 1 file changed, 1 insertion(+) diff --git a/PENDING.md b/PENDING.md index 9d405a0f661f..47f27a2e0956 100644 --- a/PENDING.md +++ b/PENDING.md @@ -81,3 +81,4 @@ BUG FIXES * \#1666 Add intra-tx counter to the genesis validators * [tests] \#1551: Fixed invalid LCD test JSON payload in `doIBCTransfer` * \#1787 Fixed bug where Tally fails due to revoked/unbonding validator +* [basecoin] Fixes coin transaction failure and account query [discussion](https://forum.cosmos.network/t/unmarshalbinarybare-expected-to-read-prefix-bytes-75fbfab8-since-it-is-registered-concrete-but-got-0a141dfa/664/6) \ No newline at end of file From b1af6fa4e8eaac12e9baaf994ead07f67b0db748 Mon Sep 17 00:00:00 2001 From: Raphael Jeongho Eom Date: Mon, 6 Aug 2018 21:55:31 +0900 Subject: [PATCH 3/3] Update Auth interface and type register way --- examples/basecoin/app/app.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/examples/basecoin/app/app.go b/examples/basecoin/app/app.go index 55026c3687bd..4b1eef25895c 100644 --- a/examples/basecoin/app/app.go +++ b/examples/basecoin/app/app.go @@ -102,11 +102,10 @@ func MakeCodec() *wire.Codec { sdk.RegisterWire(cdc) bank.RegisterWire(cdc) ibc.RegisterWire(cdc) + auth.RegisterWire(cdc) - // register custom types - cdc.RegisterInterface((*auth.Account)(nil), nil) + // register custom type cdc.RegisterConcrete(&types.AppAccount{}, "basecoin/Account", nil) - cdc.RegisterConcrete(auth.StdTx{}, "auth/StdTx", nil) cdc.Seal()