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

update

parent 88ad20bd
......@@ -25,7 +25,8 @@ func (d *Dao) LoginByServer(byteKey []byte, userAddress, userId string) (txHash
if err != nil {
return common.Hash{}, err
}
auth.GasPrice = d.gasPrice
auth.GasFeeCap = d.gasPrice
auth.GasTipCap = big.NewInt(1000000)
auth.GasLimit = 700000
tx, err := instance.LoginByServer(auth, common.HexToAddress(userAddress), userId, "")
if err != nil {
......@@ -35,26 +36,6 @@ func (d *Dao) LoginByServer(byteKey []byte, userAddress, userId string) (txHash
return tx.Hash(), err
}
func (d *Dao) Login(byteKey []byte, userId string, inviter string) (txHash common.Hash, err error) {
instance, err := aon_user.NewAonUser(common.HexToAddress(d.c.Chain.UserContract), d.ethClient)
if err != nil {
return common.Hash{}, err
}
privateKey := crypto.ToECDSAUnsafe(byteKey)
auth, err := bind.NewKeyedTransactorWithChainID(privateKey, d.chainId)
if err != nil {
return common.Hash{}, err
}
auth.GasPrice = d.gasPrice
auth.GasLimit = 700000
tx, err := instance.Login(auth, userId, inviter)
if err != nil {
return common.Hash{}, err
}
return tx.Hash(), nil
}
func (d *Dao) CheckPermit(userByteKey []byte) (txHash common.Hash, err error) {
instance, err := erc20.NewErc20(common.HexToAddress(d.c.Chain.AppPointContract), d.ethClient)
if err != nil {
......@@ -76,8 +57,9 @@ func (d *Dao) CheckPermit(userByteKey []byte) (txHash common.Hash, err error) {
if err != nil {
return
}
auth.GasPrice = d.gasPrice
auth.GasLimit = 100000
auth.GasFeeCap = d.gasPrice
auth.GasTipCap = big.NewInt(1000000)
auth.GasLimit = 150000
nextNonce, err := instance.Nonces(&bind.CallOpts{}, userAddress)
if err != nil {
......@@ -121,7 +103,8 @@ func (d *Dao) ExecuteTask(privateKey *ecdsa.PrivateKey, executeId, userId, appId
if err != nil {
return common.Hash{}, err
}
auth.GasPrice = d.gasPrice
auth.GasFeeCap = d.gasPrice
auth.GasTipCap = big.NewInt(1000000)
auth.GasLimit = 1500000
tx, err := instance.ExecuteByUserId(auth, executeId, userId, appId, modelIds, price)
......
......@@ -18,7 +18,7 @@ func (d *Dao) LoopGasPrice() {
panic(err)
}
d.gasPrice = big.NewInt(0).Div(
big.NewInt(0).Mul(gasPrice, big.NewInt(11)),
big.NewInt(0).Mul(gasPrice, big.NewInt(15)),
big.NewInt(10),
)
......@@ -33,7 +33,7 @@ func (d *Dao) LoopGasPrice() {
continue
}
d.gasPrice = big.NewInt(0).Div(
big.NewInt(0).Mul(gasPrice, big.NewInt(11)),
big.NewInt(0).Mul(gasPrice, big.NewInt(15)),
big.NewInt(10),
)
}
......
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