diff --git a/docs/cli/zetacored/zetacored_tx_crosschain_inbound-voter.md b/docs/cli/zetacored/zetacored_tx_crosschain_inbound-voter.md index 2e419e9158..cfa72e72c6 100644 --- a/docs/cli/zetacored/zetacored_tx_crosschain_inbound-voter.md +++ b/docs/cli/zetacored/zetacored_tx_crosschain_inbound-voter.md @@ -3,7 +3,7 @@ Broadcast message sendVoter ``` -zetacored tx crosschain inbound-voter [sender] [senderChainID] [txOrigin] [receiver] [receiverChainID] [amount] [message] [inTxHash] [inBlockHeight] [coinType] [asset] [flags] +zetacored tx crosschain inbound-voter [sender] [senderChainID] [txOrigin] [receiver] [receiverChainID] [amount] [message] [inTxHash] [inBlockHeight] [coinType] [asset] [eventIndex] [flags] ``` ### Options diff --git a/x/crosschain/client/cli/cli_cctx.go b/x/crosschain/client/cli/cli_cctx.go index 2418efd536..2eb22e06d7 100644 --- a/x/crosschain/client/cli/cli_cctx.go +++ b/x/crosschain/client/cli/cli_cctx.go @@ -113,9 +113,10 @@ func CmdShowSend() *cobra.Command { func CmdCCTXInboundVoter() *cobra.Command { cmd := &cobra.Command{ - Use: "inbound-voter [sender] [senderChainID] [txOrigin] [receiver] [receiverChainID] [amount] [message] [inTxHash] [inBlockHeight] [coinType] [asset]", + Use: "inbound-voter [sender] [senderChainID] [txOrigin] [receiver] [receiverChainID] [amount] [message" + + "] [inTxHash] [inBlockHeight] [coinType] [asset] [eventIndex]", Short: "Broadcast message sendVoter", - Args: cobra.ExactArgs(11), + Args: cobra.ExactArgs(12), RunE: func(cmd *cobra.Command, args []string) error { argsSender := args[0] argsSenderChain, err := strconv.ParseInt(args[1], 10, 64) @@ -147,6 +148,11 @@ func CmdCCTXInboundVoter() *cobra.Command { argsAsset := args[10] + argsEventIndex, err := strconv.ParseInt(args[11], 10, 64) + if err != nil { + return err + } + clientCtx, err := client.GetClientTxContext(cmd) if err != nil { return err @@ -166,7 +172,7 @@ func CmdCCTXInboundVoter() *cobra.Command { 250_000, argsCoinType, argsAsset, - 0, + uint(argsEventIndex), ) if err := msg.ValidateBasic(); err != nil { return err diff --git a/x/crosschain/client/integrationtests/cli_helpers.go b/x/crosschain/client/integrationtests/cli_helpers.go index a1c536626f..eee042daf5 100644 --- a/x/crosschain/client/integrationtests/cli_helpers.go +++ b/x/crosschain/client/integrationtests/cli_helpers.go @@ -169,6 +169,7 @@ func BuildSignedInboundVote(t testing.TB, val *network.Validator, denom string, "100", "Zeta", "", + "0", } txArgs := []string{ fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address), diff --git a/x/crosschain/keeper/evm_hooks.go b/x/crosschain/keeper/evm_hooks.go index ebae270dc5..a3f4dc5eee 100644 --- a/x/crosschain/keeper/evm_hooks.go +++ b/x/crosschain/keeper/evm_hooks.go @@ -147,10 +147,10 @@ func (k Keeper) ProcessZRC20WithdrawalEvent(ctx sdk.Context, event *zrc20.ZRC20W "", event.Raw.TxHash.String(), event.Raw.BlockNumber, - gasLimit.Uint64()+uint64(event.Raw.Index), + gasLimit.Uint64(), foreignCoin.CoinType, foreignCoin.Asset, - 0, + event.Raw.Index, ) sendHash := msg.Digest() @@ -221,10 +221,10 @@ func (k Keeper) ProcessZetaSentEvent(ctx sdk.Context, event *connectorzevm.ZetaC "", event.Raw.TxHash.String(), event.Raw.BlockNumber, - 90000+uint64(event.Raw.Index), + 90000, common.CoinType_Zeta, "", - 0, + event.Raw.Index, ) sendHash := msg.Digest() diff --git a/zetaclient/bitcoin_client.go b/zetaclient/bitcoin_client.go index 3584382021..2304a7b9ac 100644 --- a/zetaclient/bitcoin_client.go +++ b/zetaclient/bitcoin_client.go @@ -587,6 +587,7 @@ func (ob *BitcoinChainClient) GetInboundVoteMessageFromBtcEvent(inTx *BTCInTxEvn common.CoinType_Gas, "", ob.zetaClient.GetKeys().GetOperatorAddress().String(), + 0, ) } diff --git a/zetaclient/tx.go b/zetaclient/tx.go index 307d8e1681..9006e402da 100644 --- a/zetaclient/tx.go +++ b/zetaclient/tx.go @@ -46,6 +46,7 @@ func GetInBoundVoteMessage( coinType common.CoinType, asset string, signerAddress string, + eventIndex uint, ) *types.MsgVoteOnObservedInboundTx { msg := types.NewMsgVoteOnObservedInboundTx( signerAddress, @@ -61,7 +62,7 @@ func GetInBoundVoteMessage( gasLimit, coinType, asset, - 0, + eventIndex, ) return msg } diff --git a/zetaclient/utils.go b/zetaclient/utils.go index 389732f684..98b5d51787 100644 --- a/zetaclient/utils.go +++ b/zetaclient/utils.go @@ -125,6 +125,7 @@ func (ob *EVMChainClient) GetInboundVoteMsgForDepositedEvent(event *erc20custody common.CoinType_ERC20, event.Asset.String(), ob.zetaClient.GetKeys().GetOperatorAddress().String(), + event.Raw.Index, ), nil } @@ -160,6 +161,7 @@ func (ob *EVMChainClient) GetInboundVoteMsgForZetaSentEvent(event *zetaconnector common.CoinType_Zeta, "", ob.zetaClient.GetKeys().GetOperatorAddress().String(), + event.Raw.Index, ), nil } @@ -185,5 +187,6 @@ func (ob *EVMChainClient) GetInboundVoteMsgForTokenSentToTSS(txhash ethcommon.Ha common.CoinType_Gas, "", ob.zetaClient.GetKeys().GetOperatorAddress().String(), + 0, // not a smart contract call ) }