Fix test and update ADR

This commit is contained in:
Aleksandr Bezobchuk 2020-03-24 18:00:22 -04:00
parent 0f4473936d
commit ef29fef514
No known key found for this signature in database
GPG Key ID: 7DAC30FBD99879B0
2 changed files with 9 additions and 6 deletions

View File

@ -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()
}

View File

@ -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