Skip to content

Commit

Permalink
remvove long lines
Browse files Browse the repository at this point in the history
  • Loading branch information
lumtis committed Oct 4, 2023
1 parent ab5d8f1 commit 4a27f6f
Showing 1 changed file with 45 additions and 6 deletions.
51 changes: 45 additions & 6 deletions zetaclient/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ import (
"cosmossdk.io/math"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/x/authz"
"github.com/zeta-chain/zetacore/zetaclient/config"
"gitlab.com/thorchain/tss/go-tss/blame"

"github.com/zeta-chain/zetacore/common"
"github.com/zeta-chain/zetacore/x/crosschain/types"
observerTypes "github.com/zeta-chain/zetacore/x/observer/types"
"github.com/zeta-chain/zetacore/zetaclient/config"
"gitlab.com/thorchain/tss/go-tss/blame"
)

const (
Expand Down Expand Up @@ -60,7 +60,14 @@ func (b *ZetaCoreBridge) PostGasPrice(chain common.Chain, gasPrice uint64, suppl
return "", fmt.Errorf("post gasprice failed after %d retries", DefaultRetryInterval)
}

func (b *ZetaCoreBridge) AddTxHashToOutTxTracker(chainID int64, nonce uint64, txHash string, proof *common.Proof, blockHash string, txIndex int64) (string, error) {
func (b *ZetaCoreBridge) AddTxHashToOutTxTracker(
chainID int64,
nonce uint64,
txHash string,
proof *common.Proof,
blockHash string,
txIndex int64,
) (string, error) {
signerAddress := b.keys.GetOperatorAddress().String()
msg := types.NewMsgAddToOutTxTracker(signerAddress, chainID, nonce, txHash, proof, blockHash, txIndex)

Expand All @@ -76,9 +83,37 @@ func (b *ZetaCoreBridge) AddTxHashToOutTxTracker(chainID int64, nonce uint64, tx
return zetaTxHash, nil
}

func (b *ZetaCoreBridge) PostSend(sender string, senderChain int64, txOrigin string, receiver string, receiverChain int64, amount math.Uint, message string, inTxHash string, inBlockHeight uint64, gasLimit uint64, coinType common.CoinType, zetaGasLimit uint64, asset string) (string, error) {
func (b *ZetaCoreBridge) PostSend(
sender string,
senderChain int64,
txOrigin string,
receiver string,
receiverChain int64,
amount math.Uint,
message string,
inTxHash string,
inBlockHeight uint64,
gasLimit uint64,
coinType common.CoinType,
zetaGasLimit uint64,
asset string,
) (string, error) {
signerAddress := b.keys.GetOperatorAddress().String()
msg := types.NewMsgVoteOnObservedInboundTx(signerAddress, sender, senderChain, txOrigin, receiver, receiverChain, amount, message, inTxHash, inBlockHeight, gasLimit, coinType, asset)
msg := types.NewMsgVoteOnObservedInboundTx(
signerAddress,
sender,
senderChain,
txOrigin,
receiver,
receiverChain,
amount,
message,
inTxHash,
inBlockHeight,
gasLimit,
coinType,
asset,
)

if err := msg.ValidateBasic(); err != nil {
return "", fmt.Errorf("VoteOnObservedInboundTx invalid msg | %s", err.Error())
Expand Down Expand Up @@ -113,7 +148,11 @@ func (b *ZetaCoreBridge) PostReceiveConfirmation(
) (string, error) {
lastReport, found := b.lastOutTxReportTime[outTxHash]
if found && time.Since(lastReport) < 10*time.Minute {
return "", fmt.Errorf("PostReceiveConfirmation: outTxHash %s already reported in last 10min; last report %s", outTxHash, lastReport)
return "", fmt.Errorf(
"PostReceiveConfirmation: outTxHash %s already reported in last 10min; last report %s",
outTxHash,
lastReport,
)
}

signerAddress := b.keys.GetOperatorAddress().String()
Expand Down

0 comments on commit 4a27f6f

Please sign in to comment.