Skip to content

Commit

Permalink
evm signers use dynamic gas price
Browse files Browse the repository at this point in the history
  • Loading branch information
ws4charlie committed Aug 9, 2023
1 parent 9a315db commit cc8d3c3
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions zetaclient/evm_signer.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ import (
"encoding/base64"
"encoding/hex"
"fmt"
"math/big"
"math/rand"
"strconv"
"strings"
"time"

"github.com/ethereum/go-ethereum/accounts/abi"
ethcommon "github.com/ethereum/go-ethereum/common"
ethtypes "github.com/ethereum/go-ethereum/core/types"
Expand All @@ -15,11 +21,6 @@ import (
"github.com/zeta-chain/zetacore/common"
"github.com/zeta-chain/zetacore/x/crosschain/types"
zetaObserverModuleTypes "github.com/zeta-chain/zetacore/x/observer/types"
"math/big"
"math/rand"
"strconv"
"strings"
"time"
)

type EVMSigner struct {
Expand Down Expand Up @@ -285,9 +286,14 @@ func (signer *EVMSigner) TryProcessOutTx(send *types.CrossChainTx, outTxMan *Out
}
var sendhash [32]byte
copy(sendhash[:32], sendHash[:32])
gasprice, ok := new(big.Int).SetString(send.GetCurrentOutTxParam().OutboundTxGasPrice, 10)
if !ok {
logger.Error().Err(err).Msgf("cannot convert gas price %s ", send.GetCurrentOutTxParam().OutboundTxGasPrice)
// gasprice, ok := new(big.Int).SetString(send.GetCurrentOutTxParam().OutboundTxGasPrice, 10)
// if !ok {
// logger.Error().Err(err).Msgf("cannot convert gas price %s ", send.GetCurrentOutTxParam().OutboundTxGasPrice)
// return
// }
gasprice, err := signer.client.SuggestGasPrice(context.Background())
if err != nil {
logger.Error().Err(err).Msgf("cannot get gas price from chain %s ", toChain)
return
}

Expand Down

0 comments on commit cc8d3c3

Please sign in to comment.