Skip to content

Commit

Permalink
Add simulation request
Browse files Browse the repository at this point in the history
  • Loading branch information
jackzampolin committed Aug 31, 2020
1 parent 3348e34 commit 97f7d76
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion client/tx/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (

"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/client/flags"
sim "github.com/cosmos/cosmos-sdk/client/grpc/simulate"
"github.com/cosmos/cosmos-sdk/client/input"
sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
Expand Down Expand Up @@ -261,7 +262,9 @@ func BuildSimTx(txf Factory, msgs ...sdk.Msg) ([]byte, error) {
return nil, err
}

return txf.txConfig.TxEncoder()(tx.GetTx())
simReq := sim.SimulateRequest{Tx: tx.GetProtoTx()}

return simReq.Marshal()
}

// CalculateGas simulates the execution of a transaction and returns the
Expand Down

0 comments on commit 97f7d76

Please sign in to comment.