walletProvider.gasEstimateMessageGas call bug?
jbenet opened this issue · comments
According to:
- https://github.com/filecoin-project/lotus/blob/master/documentation/en/api-methods.md#gasestimatemessagegas
- https://github.com/filecoin-project/lotus/blob/90a31fde9fee049b82c2d4e7c007e9afea4ddd01/api/apistruct/struct.go#L111
- https://github.com/filecoin-project/lotus/blob/94763c2aaa30be675c44c9f630802b2a1ee8a4e8/api/types.go#L50-L52
I believe the second parameter in this call
await walletProvider.gasEstimateMessageGas(
message,
localTxFee.toAttoFil()
)
in https://github.com/glifio/wallet/blob/primary/components/Wallet/Send.js/CustomizeFee.jsx#L170 is a number when it should be an object wrapping the number: { "MaxFee": localTxFee.toAttoFil() }
await walletProvider.gasEstimateMessageGas(
message,
{ "MaxFee": localTxFee.toAttoFil() }
)
I believe this means that the "Transaction Fee" field is not sending the right value to Lotus.GasEstimateMessageGas
(probably landing as zero) which means that the "Transaction Fee" field is not taking effect.
Hey @jbenet thank you for pointing this out! We should've more closely follow the lotus json rpc API when writing these wallet provider methods. You can see the MaxFee
gets set in an object inside the function we're calling https://github.com/glifio/modules/blob/primary/packages/filecoin-wallet-provider/src/filecoin.ts#L185
Ah, awesome, thank you. sorry for misreport! couldn't find where this fed in. 👍