From ef29fef5142ba72a27947e84600939a774c8579e Mon Sep 17 00:00:00 2001 From: Aleksandr Bezobchuk Date: Tue, 24 Mar 2020 18:00:22 -0400 Subject: [PATCH] Fix test and update ADR --- baseapp/baseapp_test.go | 6 ++++-- .../adr-020-protobuf-transaction-encoding.md | 9 +++++---- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/baseapp/baseapp_test.go b/baseapp/baseapp_test.go index 2da5b95f6f..11d3e346c4 100644 --- a/baseapp/baseapp_test.go +++ b/baseapp/baseapp_test.go @@ -3,6 +3,7 @@ package baseapp import ( "bytes" "encoding/binary" + "encoding/json" "fmt" "os" "sync" @@ -936,12 +937,13 @@ func TestSimulateTx(t *testing.T) { require.True(t, queryResult.IsOK(), queryResult.Log) var simRes sdk.SimulationResponse - err = codec.Cdc.UnmarshalBinaryBare(queryResult.Value, &simRes) - require.NoError(t, err) + require.NoError(t, json.Unmarshal(queryResult.Value, &simRes)) + require.Equal(t, gInfo, simRes.GasInfo) require.Equal(t, result.Log, simRes.Result.Log) require.Equal(t, result.Events, simRes.Result.Events) require.True(t, bytes.Equal(result.Data, simRes.Result.Data)) + app.EndBlock(abci.RequestEndBlock{}) app.Commit() } diff --git a/docs/architecture/adr-020-protobuf-transaction-encoding.md b/docs/architecture/adr-020-protobuf-transaction-encoding.md index 6689f29e23..184ddf6af5 100644 --- a/docs/architecture/adr-020-protobuf-transaction-encoding.md +++ b/docs/architecture/adr-020-protobuf-transaction-encoding.md @@ -123,11 +123,12 @@ type ClientTx interface { } ``` -We then update `CLIContext` to have two new fields: `Generator` and `Marshler`. +We then update `CLIContext` to have a new field: `Marshler`. -Then, each module will at the minimum accept a `Marshaler` instead of a concrete -Amino codec. If the module needs to work with any interface types, it will use -the `Codec` interface defined by the module which also extends `Marshaler`. +Then, each module client handler will at the minimum accept a `Marshaler` instead +of a concrete Amino codec and a `Generator`. If the module needs to work with any +interface types, it will use the `Codec` interface defined by the module which also +extends `Marshaler`. ## Future Improvements