Skip to content

Commit

Permalink
logging tx relayer transactions
Browse files Browse the repository at this point in the history
  • Loading branch information
hexoscott committed Mar 14, 2024
1 parent 1262c24 commit 86fc792
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions txrelayer/txrelayer.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"github.com/umbracle/ethgo"
"github.com/umbracle/ethgo/jsonrpc"
"github.com/umbracle/ethgo/wallet"
"github.com/0xPolygon/polygon-edge/helper/hex"
)

const (
Expand Down Expand Up @@ -127,6 +128,7 @@ func (t *TxRelayerImpl) sendTransactionLocked(txn *ethgo.Transaction, key ethgo.
}

txn.GasPrice = gasPrice + (gasPrice * gasPricePercent / 100)
fmt.Println("[txRelayer] set gas price", txn.GasPrice)
}

if txn.Gas == 0 {
Expand All @@ -136,6 +138,7 @@ func (t *TxRelayerImpl) sendTransactionLocked(txn *ethgo.Transaction, key ethgo.
}

txn.Gas = gasLimit + (gasLimit * gasLimitPercent / 100)
fmt.Println("[txRelayer] set gas", txn.Gas)
}

chainID, err := t.client.Eth().ChainID()
Expand All @@ -159,6 +162,9 @@ func (t *TxRelayerImpl) sendTransactionLocked(txn *ethgo.Transaction, key ethgo.
txn.From, txn.Gas, txn.GasPrice, txn.Nonce)))
}

asHex := "0x" + hex.EncodeToString(data)
fmt.Println("[txRelayer] raw data", asHex)

return t.client.Eth().SendRawTransaction(data)
}

Expand Down

0 comments on commit 86fc792

Please sign in to comment.