authclient: fix tests

This commit is contained in:
Federico Kunze 2020-03-19 22:46:35 -03:00
parent 38f4b084c1
commit 51d9045152
No known key found for this signature in database
GPG Key ID: 655F93A970080A30
1 changed files with 5 additions and 3 deletions

View File

@ -46,7 +46,7 @@ func TestCalculateGas(t *testing.T) {
} }
simRes := sdk.SimulationResponse{ simRes := sdk.SimulationResponse{
GasInfo: sdk.GasInfo{GasUsed: gasUsed, GasWanted: gasUsed}, GasInfo: sdk.GasInfo{GasUsed: gasUsed, GasWanted: gasUsed},
Result: nil, Result: &sdk.Result{Data: []byte("tx data"), Log: "log"},
} }
return cdc.MustMarshalBinaryBare(simRes), 0, nil return cdc.MustMarshalBinaryBare(simRes), 0, nil
@ -77,10 +77,12 @@ func TestCalculateGas(t *testing.T) {
simRes, gotAdjusted, err := CalculateGas(queryFunc, cdc, []byte(""), tt.args.adjustment) simRes, gotAdjusted, err := CalculateGas(queryFunc, cdc, []byte(""), tt.args.adjustment)
if tt.expPass { if tt.expPass {
require.NoError(t, err) require.NoError(t, err)
} else {
require.Error(t, err)
require.Equal(t, simRes.GasInfo.GasUsed, tt.wantEstimate) require.Equal(t, simRes.GasInfo.GasUsed, tt.wantEstimate)
require.Equal(t, gotAdjusted, tt.wantAdjusted) require.Equal(t, gotAdjusted, tt.wantAdjusted)
require.NotNil(t, simRes.Result)
} else {
require.Error(t, err)
require.Nil(t, simRes.Result)
} }
}) })
} }