Skip to content

Commit

Permalink
add estimate gaslimit api (#4401)
Browse files Browse the repository at this point in the history
  • Loading branch information
hunjixin authored Apr 29, 2021
1 parent 5fbc93c commit c1ddbc4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ type FullNode struct {
GasEstimateMessageGas func(context.Context, *types.UnsignedMessage, *types.MessageSendSpec, types.TipSetKey) (*types.UnsignedMessage, error)
GasEstimateFeeCap func(context.Context, *types.UnsignedMessage, int64, types.TipSetKey) (big.Int, error)
GasEstimateGasPremium func(context.Context, uint64, address.Address, int64, types.TipSetKey) (big.Int, error)
GasEstimateGasLimit func(ctx context.Context, msgIn *types.UnsignedMessage, tsk types.TipSetKey) (int64, error)
WalletSign func(context.Context, address.Address, []byte) (*crypto.Signature, error)

NetworkGetBandwidthStats func() metrics.Stats
Expand Down
4 changes: 4 additions & 0 deletions app/submodule/mpool/mpool_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,10 @@ func (a *MessagePoolAPI) GasEstimateFeeCap(ctx context.Context, msg *types.Unsig
return a.mp.MPool.GasEstimateFeeCap(ctx, msg, maxqueueblks, tsk)
}

func (a *MessagePoolAPI) GasEstimateGasLimit(ctx context.Context, msgIn *types.UnsignedMessage, tsk types.TipSetKey) (int64, error) {
return a.mp.MPool.GasEstimateGasLimit(ctx, msgIn, tsk)
}

func (a *MessagePoolAPI) GasEstimateGasPremium(ctx context.Context, nblocksincl uint64, sender address.Address, gaslimit int64, tsk types.TipSetKey) (big.Int, error) {
return a.mp.MPool.GasEstimateGasPremium(ctx, nblocksincl, sender, gaslimit, tsk)
}
Expand Down

0 comments on commit c1ddbc4

Please sign in to comment.