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

update

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