add value for all method

This commit is contained in:
Frank 2020-12-28 11:08:19 +08:00
parent 6b9daa4d14
commit a7a6f24ceb

View File

@ -153,10 +153,8 @@ var sendCmd = &cli.Command{
if err != nil {
return err
}
totalCost := types.BigMul(msg.GasFeeCap, types.NewInt(uint64(msg.GasLimit)))
if msg.Method == builtin.MethodSend {
totalCost = types.BigAdd(totalCost, msg.Value)
}
totalCost := types.BigAdd(types.BigMul(msg.GasFeeCap, types.NewInt(uint64(msg.GasLimit))), msg.Value)
if fromBalance.LessThan(totalCost) {
fmt.Printf("From balance %s attoFIL less than total cost %s attoFIL\n", fromBalance, totalCost)
if !cctx.Bool("really-do-it") {