Commit d0872ce6 authored by 贾浩@五瓣科技's avatar 贾浩@五瓣科技

update

parent efd597c5
...@@ -42,8 +42,8 @@ func (d *Dao) LoopGasPrice() { ...@@ -42,8 +42,8 @@ func (d *Dao) LoopGasPrice() {
// EstimateGasRecharge 估算充值金额 // EstimateGasRecharge 估算充值金额
func (d *Dao) EstimateGasRecharge(address common.Address) (val *big.Int, err error) { func (d *Dao) EstimateGasRecharge(address common.Address) (val *big.Int, err error) {
_10val := new(big.Int).Mul(d.gasPrice, big.NewInt(10*500000)) // 10次 每次50w _10val := new(big.Int).Mul(d.gasPrice, big.NewInt(12*500000)) // 10次 每次50w
_20val := new(big.Int).Mul(d.gasPrice, big.NewInt(50*500000)) // 20次 每次50w _20val := new(big.Int).Mul(d.gasPrice, big.NewInt(24*500000)) // 20次 每次50w
currentBalance, err := d.ethClient.BalanceAt(context.Background(), address, nil) currentBalance, err := d.ethClient.BalanceAt(context.Background(), address, nil)
if err != nil { if err != nil {
......
...@@ -68,10 +68,10 @@ func (m *Monitor) ProcessOne(task *model.ExecTask) { ...@@ -68,10 +68,10 @@ func (m *Monitor) ProcessOne(task *model.ExecTask) {
"app_key": task.AppKey, "app_key": task.AppKey,
"model_ids": task.ModelIdsArray, "model_ids": task.ModelIdsArray,
}).Info("execute task") }).Info("execute task")
val10, _ := big.NewInt(10).SetString("10000000000000000000", 10)
val := big.NewInt(0).Mul(big.NewInt(1000000000000000000), big.NewInt(int64(m.conf.Chain.ModelPrice)))
// txHash, err := m.d.ExecuteTask(m.privateKey, task.Id, task.UserId, task.AppKey, task.ModelIdsArray, big.NewInt(int64(m.conf.Chain.ModelPrice))) // txHash, err := m.d.ExecuteTask(m.privateKey, task.Id, task.UserId, task.AppKey, task.ModelIdsArray, big.NewInt(int64(m.conf.Chain.ModelPrice)))
txHash, err := m.d.ExecuteTask(m.privateKey, task.Id, task.UserId, task.AppKey, task.ModelIdsArray, val10) txHash, err := m.d.ExecuteTask(m.privateKey, task.Id, task.UserId, task.AppKey, task.ModelIdsArray, val)
if err != nil { if err != nil {
log.WithFields(log.Fields{ log.WithFields(log.Fields{
"id": task.Id, "id": task.Id,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment