Skip to content

Commit

Permalink
fix update amount of ATM to 20,000,000
Browse files Browse the repository at this point in the history
  • Loading branch information
xuyz committed Dec 25, 2018
1 parent 2ea0282 commit 6d40025
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion plugins/atm/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"errors"
"fmt"
"os"
"strconv"
"time"

"github.com/QOSGroup/qmoon/db"
Expand All @@ -23,6 +24,18 @@ func getChain() string {
return os.Getenv("ATM_CHAIN_ID")
}

func getAmount() int64 {
d := os.Getenv("ATM_AMOUNT")
if d != "" {
amount, err := strconv.ParseInt(d, 10, 64)
if err == nil {
return amount
}
}

return 2000 * 10000
}

func check(addr, chainid string) error {
now := time.Now()
t := time.Date(now.Year(), now.Month(), now.Day(), 0, 0, 0, 0, time.Local)
Expand Down Expand Up @@ -51,7 +64,7 @@ func Withdraw(addr, chainid string) (*bank.SendResult, error) {
}

coin := "QOS"
amount := 2000
amount := getAmount()
qcli := qstarscli.NewClient(opt)
sr, err := qcli.TransferService.Send(nil, &qstarscli.TransferBody{
Address: addr,
Expand Down

0 comments on commit 6d40025

Please sign in to comment.