Skip to content

Commit bdce8ae

Browse files
committed
fix test
1 parent 56afde4 commit bdce8ae

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

state/core_access_test.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,12 @@ func TestDelegate(t *testing.T) {
220220
require.NoError(t, err)
221221
require.EqualValues(t, 0, resp.Code)
222222

223+
opts = NewTxConfig(
224+
WithGas(tc.gasLim),
225+
WithGasPrice(tc.gasPrice),
226+
WithKeyName(accounts[2]),
227+
)
228+
223229
resp, err = ca.Undelegate(ctx, ValAddress(valAddr), sdktypes.NewInt(100_000), opts)
224230
require.NoError(t, err)
225231
require.EqualValues(t, 0, resp.Code)

state/estimator.go

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,14 +58,12 @@ func (e *estimator) estimateGas(
5858
return gasPrice, uint64(float64(gas) * gasMultiplier), nil
5959
}
6060

61-
// NOTE: final result of the estimation will be multiplied by the `gasMultiplier`(1.1) to cover
62-
// additional costs.
63-
// set fee as 1utia helps to simulate the tx more reliably.
64-
gas, err = client.EstimateGas(ctx, []sdktypes.Msg{msg}, user.SetFee(1))
61+
// Tx client will multiple estimated gas by 1.1 to cover additional costs
62+
gas, err = client.EstimateGas(ctx, []sdktypes.Msg{msg})
6563
if err != nil {
6664
return 0, 0, fmt.Errorf("state: failed to estimate gas: %w", err)
6765
}
68-
return DefaultGasPrice, uint64(float64(gas) * gasMultiplier), nil
66+
return DefaultGasPrice, gas, nil
6967
}
7068

7169
func (e *estimator) queryGasUsedAndPrice(

0 commit comments

Comments
 (0)