Skip to content

Commit

Permalink
skip cronos v1.4.0 msg register for block 0
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentysc committed Dec 3, 2024
1 parent f53deea commit d329110
Showing 1 changed file with 77 additions and 74 deletions.
151 changes: 77 additions & 74 deletions usecase/parser/register.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,79 +108,82 @@ func RegisterBreakingVersionParsers(manager *utils.CosmosParserManager) {
/*
Cronos v1.4.0
*/
manager.RegisterParser("/ethermint.evm.v1.MsgEthereumTx", manager.GetCronosV1_4_0BlockHeight(), V1_4_0_cronos_msg.ParseMsgEthereumTx)

// cosmos bank
manager.RegisterParser("/cosmos.bank.v1beta1.MsgSend", manager.GetCronosV1_4_0BlockHeight(), V1_4_0_cronos_msg.ParseMsgEventsToLog(ParseMsgSend))
manager.RegisterParser("/cosmos.bank.v1beta1.MsgMultiSend", manager.GetCronosV1_4_0BlockHeight(), V1_4_0_cronos_msg.ParseMsgEventsToLog(ParseMsgMultiSend))
manager.RegisterParser("/cosmos.bank.v1beta1.MsgSetSendEnabled", manager.GetCronosV1_4_0BlockHeight(), V1_4_0_cronos_msg.ParseMsgEventsToLog(ParseMsgSetSendEnabled))

// cosmos distribution
manager.RegisterParser("/cosmos.distribution.v1beta1.MsgSetWithdrawAddress", manager.GetCronosV1_4_0BlockHeight(), V1_4_0_cronos_msg.ParseMsgEventsToLog(ParseMsgSetWithdrawAddress))
manager.RegisterParser("/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward", manager.GetCronosV1_4_0BlockHeight(), V1_4_0_cronos_msg.ParseMsgEventsToLog(ParseMsgWithdrawDelegatorReward))
manager.RegisterParser("/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission", manager.GetCronosV1_4_0BlockHeight(), V1_4_0_cronos_msg.ParseMsgEventsToLog(ParseMsgWithdrawValidatorCommission))
manager.RegisterParser("/cosmos.distribution.v1beta1.MsgFundCommunityPool", manager.GetCronosV1_4_0BlockHeight(), V1_4_0_cronos_msg.ParseMsgEventsToLog(ParseMsgFundCommunityPool))

// cosmos gov
manager.RegisterParser("/cosmos.gov.v1beta1.MsgSubmitProposal", manager.GetCronosV1_4_0BlockHeight(), V1_4_0_cronos_msg.ParseMsgEventsToLog(ParseMsgSubmitProposal))
manager.RegisterParser("/cosmos.gov.v1beta1.MsgVote", manager.GetCronosV1_4_0BlockHeight(), V1_4_0_cronos_msg.ParseMsgEventsToLog(ParseMsgVote))
manager.RegisterParser("/cosmos.gov.v1beta1.MsgDeposit", manager.GetCronosV1_4_0BlockHeight(), V1_4_0_cronos_msg.ParseMsgEventsToLog(ParseMsgDeposit))

// cosmos gov v1
manager.RegisterParser("/cosmos.gov.v1.MsgDeposit", manager.GetCronosV1_4_0BlockHeight(), V1_4_0_cronos_msg.ParseMsgEventsToLog(cosmos_gov_v1.ParseMsgDeposit))
manager.RegisterParser("/cosmos.gov.v1.MsgSubmitProposal", manager.GetCronosV1_4_0BlockHeight(), V1_4_0_cronos_msg.ParseMsgEventsToLog(cosmos_gov_v1.ParseMsgSubmitProposal))
manager.RegisterParser("/cosmos.gov.v1.MsgVote", manager.GetCronosV1_4_0BlockHeight(), V1_4_0_cronos_msg.ParseMsgEventsToLog(cosmos_gov_v1.ParseMsgVote))
manager.RegisterParser("/cosmos.gov.v1.MsgVoteWeighted", manager.GetCronosV1_4_0BlockHeight(), V1_4_0_cronos_msg.ParseMsgEventsToLog(cosmos_gov_v1.ParseMsgVoteWeighted))

// cosmos staking
manager.RegisterParser("/cosmos.staking.v1beta1.MsgDelegate", manager.GetCronosV1_4_0BlockHeight(), V1_4_0_cronos_msg.ParseMsgEventsToLog(ParseMsgDelegate))
manager.RegisterParser("/cosmos.staking.v1beta1.MsgUndelegate", manager.GetCronosV1_4_0BlockHeight(), V1_4_0_cronos_msg.ParseMsgEventsToLog(ParseMsgUndelegate))
manager.RegisterParser("/cosmos.staking.v1beta1.MsgBeginRedelegate", manager.GetCronosV1_4_0BlockHeight(), V1_4_0_cronos_msg.ParseMsgEventsToLog(ParseMsgBeginRedelegate))
manager.RegisterParser("/cosmos.staking.v1beta1.MsgCreateValidator", manager.GetCronosV1_4_0BlockHeight(), V1_4_0_cronos_msg.ParseMsgEventsToLog(ParseMsgCreateValidator))
manager.RegisterParser("/cosmos.staking.v1beta1.MsgEditValidator", manager.GetCronosV1_4_0BlockHeight(), V1_4_0_cronos_msg.ParseMsgEventsToLog(ParseMsgEditValidator))

// cosmos slashing
manager.RegisterParser("/cosmos.slashing.v1beta1.MsgUnjail", manager.GetCronosV1_4_0BlockHeight(), V1_4_0_cronos_msg.ParseMsgEventsToLog(ParseMsgUnjail))

// cronos icaauth
manager.RegisterParser("/icaauth.v1.MsgRegisterAccount", manager.GetCronosV1_4_0BlockHeight(), V1_4_0_cronos_msg.ParseMsgEventsToLog(icaauth.ParseMsgRegisterAccount))
manager.RegisterParser("/icaauth.v1.MsgSubmitTx", manager.GetCronosV1_4_0BlockHeight(), V1_4_0_cronos_msg.ParseMsgEventsToLog(icaauth.ParseMsgSubmitTx))

// ibc core client
manager.RegisterParser("/ibc.core.client.v1.MsgCreateClient", manager.GetCronosV1_4_0BlockHeight(), V1_4_0_cronos_msg.ParseMsgEventsToLog(ibc.ParseMsgCreateClient))
manager.RegisterParser("/ibc.core.client.v1.MsgUpdateClient", manager.GetCronosV1_4_0BlockHeight(), V1_4_0_cronos_msg.ParseMsgEventsToLog(ibc.ParseMsgUpdateClient))

// ibc core connection
manager.RegisterParser("/ibc.core.connection.v1.MsgConnectionOpenInit", manager.GetCronosV1_4_0BlockHeight(), V1_4_0_cronos_msg.ParseMsgEventsToLog(ibc.ParseMsgConnectionOpenInit))
manager.RegisterParser("/ibc.core.connection.v1.MsgConnectionOpenTry", manager.GetCronosV1_4_0BlockHeight(), V1_4_0_cronos_msg.ParseMsgEventsToLog(ibc.ParseMsgConnectionOpenTry))
manager.RegisterParser("/ibc.core.connection.v1.MsgConnectionOpenAck", manager.GetCronosV1_4_0BlockHeight(), V1_4_0_cronos_msg.ParseMsgEventsToLog(ibc.ParseMsgConnectionOpenAck))
manager.RegisterParser("/ibc.core.connection.v1.MsgConnectionOpenConfirm", manager.GetCronosV1_4_0BlockHeight(), V1_4_0_cronos_msg.ParseMsgEventsToLog(ibc.ParseMsgConnectionOpenConfirm))

// ibc core channel
manager.RegisterParser("/ibc.core.channel.v1.MsgChannelOpenInit", manager.GetCronosV1_4_0BlockHeight(), V1_4_0_cronos_msg.ParseMsgEventsToLog(ibc.ParseMsgChannelOpenInit))
manager.RegisterParser("/ibc.core.channel.v1.MsgChannelOpenTry", manager.GetCronosV1_4_0BlockHeight(), V1_4_0_cronos_msg.ParseMsgEventsToLog(ibc.ParseMsgChannelOpenTry))
manager.RegisterParser("/ibc.core.channel.v1.MsgChannelOpenAck", manager.GetCronosV1_4_0BlockHeight(), V1_4_0_cronos_msg.ParseMsgEventsToLog(ibc.ParseMsgChannelOpenAck))
manager.RegisterParser("/ibc.core.channel.v1.MsgChannelOpenConfirm", manager.GetCronosV1_4_0BlockHeight(), V1_4_0_cronos_msg.ParseMsgEventsToLog(ibc.ParseMsgChannelOpenConfirm))
manager.RegisterParser("/ibc.core.channel.v1.MsgRecvPacket", manager.GetCronosV1_4_0BlockHeight(), V1_4_0_cronos_msg.ParseMsgEventsToLog(V0_42_7_ibcmsg.ParseMsgRecvPacket))
manager.RegisterParser("/ibc.core.channel.v1.MsgAcknowledgement", manager.GetCronosV1_4_0BlockHeight(), V1_4_0_cronos_msg.ParseMsgEventsToLog(ibc.ParseMsgAcknowledgement))
manager.RegisterParser("/ibc.core.channel.v1.MsgTimeout", manager.GetCronosV1_4_0BlockHeight(), V1_4_0_cronos_msg.ParseMsgEventsToLog(ibc.ParseMsgTimeout))
manager.RegisterParser("/ibc.core.channel.v1.MsgTimeoutOnClose", manager.GetCronosV1_4_0BlockHeight(), V1_4_0_cronos_msg.ParseMsgEventsToLog(ibc.ParseMsgTimeoutOnClose))
manager.RegisterParser("/ibc.core.channel.v1.MsgChannelCloseInit", manager.GetCronosV1_4_0BlockHeight(), V1_4_0_cronos_msg.ParseMsgEventsToLog(ibc.ParseMsgChannelCloseInit))
manager.RegisterParser("/ibc.core.channel.v1.MsgChannelCloseConfirm", manager.GetCronosV1_4_0BlockHeight(), V1_4_0_cronos_msg.ParseMsgEventsToLog(ibc.ParseMsgChannelCloseConfirm))

// ibc applications transfer
manager.RegisterParser("/ibc.applications.transfer.v1.MsgTransfer", manager.GetCronosV1_4_0BlockHeight(), V1_4_0_cronos_msg.ParseMsgEventsToLog(ibc.ParseMsgTransfer))

// cosmos authz
manager.RegisterParser("/cosmos.authz.v1beta1.MsgGrant", manager.GetCronosV1_4_0BlockHeight(), V1_4_0_cronos_msg.ParseMsgEventsToLog(ParseMsgGrant))
manager.RegisterParser("/cosmos.authz.v1beta1.MsgRevoke", manager.GetCronosV1_4_0BlockHeight(), V1_4_0_cronos_msg.ParseMsgEventsToLog(ParseMsgRevoke))
// FIXME: https://github.com/crypto-com/chain-indexing/issues/673
//manager.RegisterParser("/cosmos.authz.v1beta1.MsgExec", manager.GetCronosV1_4_0BlockHeight(), ParseMsgExec))

// cosmos feegrant
manager.RegisterParser("/cosmos.feegrant.v1beta1.MsgGrantAllowance", manager.GetCronosV1_4_0BlockHeight(), V1_4_0_cronos_msg.ParseMsgEventsToLog(ParseMsgGrantAllowance))
manager.RegisterParser("/cosmos.feegrant.v1beta1.MsgRevokeAllowance", manager.GetCronosV1_4_0BlockHeight(), V1_4_0_cronos_msg.ParseMsgEventsToLog(ParseMsgRevokeAllowance))

// cosmos vesting
manager.RegisterParser("/cosmos.vesting.v1beta1.MsgCreateVestingAccount", manager.GetCronosV1_4_0BlockHeight(), V1_4_0_cronos_msg.ParseMsgEventsToLog(ParseMsgCreateVestingAccount))
if manager.GetCronosV1_4_0BlockHeight() > 0 {
manager.RegisterParser("/ethermint.evm.v1.MsgEthereumTx", manager.GetCronosV1_4_0BlockHeight(), V1_4_0_cronos_msg.ParseMsgEthereumTx)

// cosmos bank
manager.RegisterParser("/cosmos.bank.v1beta1.MsgSend", manager.GetCronosV1_4_0BlockHeight(), V1_4_0_cronos_msg.ParseMsgEventsToLog(ParseMsgSend))
manager.RegisterParser("/cosmos.bank.v1beta1.MsgMultiSend", manager.GetCronosV1_4_0BlockHeight(), V1_4_0_cronos_msg.ParseMsgEventsToLog(ParseMsgMultiSend))
manager.RegisterParser("/cosmos.bank.v1beta1.MsgSetSendEnabled", manager.GetCronosV1_4_0BlockHeight(), V1_4_0_cronos_msg.ParseMsgEventsToLog(ParseMsgSetSendEnabled))

// cosmos distribution
manager.RegisterParser("/cosmos.distribution.v1beta1.MsgSetWithdrawAddress", manager.GetCronosV1_4_0BlockHeight(), V1_4_0_cronos_msg.ParseMsgEventsToLog(ParseMsgSetWithdrawAddress))
manager.RegisterParser("/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward", manager.GetCronosV1_4_0BlockHeight(), V1_4_0_cronos_msg.ParseMsgEventsToLog(ParseMsgWithdrawDelegatorReward))
manager.RegisterParser("/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission", manager.GetCronosV1_4_0BlockHeight(), V1_4_0_cronos_msg.ParseMsgEventsToLog(ParseMsgWithdrawValidatorCommission))
manager.RegisterParser("/cosmos.distribution.v1beta1.MsgFundCommunityPool", manager.GetCronosV1_4_0BlockHeight(), V1_4_0_cronos_msg.ParseMsgEventsToLog(ParseMsgFundCommunityPool))

// cosmos gov
manager.RegisterParser("/cosmos.gov.v1beta1.MsgSubmitProposal", manager.GetCronosV1_4_0BlockHeight(), V1_4_0_cronos_msg.ParseMsgEventsToLog(ParseMsgSubmitProposal))
manager.RegisterParser("/cosmos.gov.v1beta1.MsgVote", manager.GetCronosV1_4_0BlockHeight(), V1_4_0_cronos_msg.ParseMsgEventsToLog(ParseMsgVote))
manager.RegisterParser("/cosmos.gov.v1beta1.MsgDeposit", manager.GetCronosV1_4_0BlockHeight(), V1_4_0_cronos_msg.ParseMsgEventsToLog(ParseMsgDeposit))

// cosmos gov v1
manager.RegisterParser("/cosmos.gov.v1.MsgDeposit", manager.GetCronosV1_4_0BlockHeight(), V1_4_0_cronos_msg.ParseMsgEventsToLog(cosmos_gov_v1.ParseMsgDeposit))
manager.RegisterParser("/cosmos.gov.v1.MsgSubmitProposal", manager.GetCronosV1_4_0BlockHeight(), V1_4_0_cronos_msg.ParseMsgEventsToLog(cosmos_gov_v1.ParseMsgSubmitProposal))
manager.RegisterParser("/cosmos.gov.v1.MsgVote", manager.GetCronosV1_4_0BlockHeight(), V1_4_0_cronos_msg.ParseMsgEventsToLog(cosmos_gov_v1.ParseMsgVote))
manager.RegisterParser("/cosmos.gov.v1.MsgVoteWeighted", manager.GetCronosV1_4_0BlockHeight(), V1_4_0_cronos_msg.ParseMsgEventsToLog(cosmos_gov_v1.ParseMsgVoteWeighted))

// cosmos staking
manager.RegisterParser("/cosmos.staking.v1beta1.MsgDelegate", manager.GetCronosV1_4_0BlockHeight(), V1_4_0_cronos_msg.ParseMsgEventsToLog(ParseMsgDelegate))
manager.RegisterParser("/cosmos.staking.v1beta1.MsgUndelegate", manager.GetCronosV1_4_0BlockHeight(), V1_4_0_cronos_msg.ParseMsgEventsToLog(ParseMsgUndelegate))
manager.RegisterParser("/cosmos.staking.v1beta1.MsgBeginRedelegate", manager.GetCronosV1_4_0BlockHeight(), V1_4_0_cronos_msg.ParseMsgEventsToLog(ParseMsgBeginRedelegate))
manager.RegisterParser("/cosmos.staking.v1beta1.MsgCreateValidator", manager.GetCronosV1_4_0BlockHeight(), V1_4_0_cronos_msg.ParseMsgEventsToLog(ParseMsgCreateValidator))
manager.RegisterParser("/cosmos.staking.v1beta1.MsgEditValidator", manager.GetCronosV1_4_0BlockHeight(), V1_4_0_cronos_msg.ParseMsgEventsToLog(ParseMsgEditValidator))

// cosmos slashing
manager.RegisterParser("/cosmos.slashing.v1beta1.MsgUnjail", manager.GetCronosV1_4_0BlockHeight(), V1_4_0_cronos_msg.ParseMsgEventsToLog(ParseMsgUnjail))

// cronos icaauth
manager.RegisterParser("/icaauth.v1.MsgRegisterAccount", manager.GetCronosV1_4_0BlockHeight(), V1_4_0_cronos_msg.ParseMsgEventsToLog(icaauth.ParseMsgRegisterAccount))
manager.RegisterParser("/icaauth.v1.MsgSubmitTx", manager.GetCronosV1_4_0BlockHeight(), V1_4_0_cronos_msg.ParseMsgEventsToLog(icaauth.ParseMsgSubmitTx))

// ibc core client
manager.RegisterParser("/ibc.core.client.v1.MsgCreateClient", manager.GetCronosV1_4_0BlockHeight(), V1_4_0_cronos_msg.ParseMsgEventsToLog(ibc.ParseMsgCreateClient))
manager.RegisterParser("/ibc.core.client.v1.MsgUpdateClient", manager.GetCronosV1_4_0BlockHeight(), V1_4_0_cronos_msg.ParseMsgEventsToLog(ibc.ParseMsgUpdateClient))

// ibc core connection
manager.RegisterParser("/ibc.core.connection.v1.MsgConnectionOpenInit", manager.GetCronosV1_4_0BlockHeight(), V1_4_0_cronos_msg.ParseMsgEventsToLog(ibc.ParseMsgConnectionOpenInit))
manager.RegisterParser("/ibc.core.connection.v1.MsgConnectionOpenTry", manager.GetCronosV1_4_0BlockHeight(), V1_4_0_cronos_msg.ParseMsgEventsToLog(ibc.ParseMsgConnectionOpenTry))
manager.RegisterParser("/ibc.core.connection.v1.MsgConnectionOpenAck", manager.GetCronosV1_4_0BlockHeight(), V1_4_0_cronos_msg.ParseMsgEventsToLog(ibc.ParseMsgConnectionOpenAck))
manager.RegisterParser("/ibc.core.connection.v1.MsgConnectionOpenConfirm", manager.GetCronosV1_4_0BlockHeight(), V1_4_0_cronos_msg.ParseMsgEventsToLog(ibc.ParseMsgConnectionOpenConfirm))

// ibc core channel
manager.RegisterParser("/ibc.core.channel.v1.MsgChannelOpenInit", manager.GetCronosV1_4_0BlockHeight(), V1_4_0_cronos_msg.ParseMsgEventsToLog(ibc.ParseMsgChannelOpenInit))
manager.RegisterParser("/ibc.core.channel.v1.MsgChannelOpenTry", manager.GetCronosV1_4_0BlockHeight(), V1_4_0_cronos_msg.ParseMsgEventsToLog(ibc.ParseMsgChannelOpenTry))
manager.RegisterParser("/ibc.core.channel.v1.MsgChannelOpenAck", manager.GetCronosV1_4_0BlockHeight(), V1_4_0_cronos_msg.ParseMsgEventsToLog(ibc.ParseMsgChannelOpenAck))
manager.RegisterParser("/ibc.core.channel.v1.MsgChannelOpenConfirm", manager.GetCronosV1_4_0BlockHeight(), V1_4_0_cronos_msg.ParseMsgEventsToLog(ibc.ParseMsgChannelOpenConfirm))
manager.RegisterParser("/ibc.core.channel.v1.MsgRecvPacket", manager.GetCronosV1_4_0BlockHeight(), V1_4_0_cronos_msg.ParseMsgEventsToLog(V0_42_7_ibcmsg.ParseMsgRecvPacket))
manager.RegisterParser("/ibc.core.channel.v1.MsgAcknowledgement", manager.GetCronosV1_4_0BlockHeight(), V1_4_0_cronos_msg.ParseMsgEventsToLog(ibc.ParseMsgAcknowledgement))
manager.RegisterParser("/ibc.core.channel.v1.MsgTimeout", manager.GetCronosV1_4_0BlockHeight(), V1_4_0_cronos_msg.ParseMsgEventsToLog(ibc.ParseMsgTimeout))
manager.RegisterParser("/ibc.core.channel.v1.MsgTimeoutOnClose", manager.GetCronosV1_4_0BlockHeight(), V1_4_0_cronos_msg.ParseMsgEventsToLog(ibc.ParseMsgTimeoutOnClose))
manager.RegisterParser("/ibc.core.channel.v1.MsgChannelCloseInit", manager.GetCronosV1_4_0BlockHeight(), V1_4_0_cronos_msg.ParseMsgEventsToLog(ibc.ParseMsgChannelCloseInit))
manager.RegisterParser("/ibc.core.channel.v1.MsgChannelCloseConfirm", manager.GetCronosV1_4_0BlockHeight(), V1_4_0_cronos_msg.ParseMsgEventsToLog(ibc.ParseMsgChannelCloseConfirm))

// ibc applications transfer
manager.RegisterParser("/ibc.applications.transfer.v1.MsgTransfer", manager.GetCronosV1_4_0BlockHeight(), V1_4_0_cronos_msg.ParseMsgEventsToLog(ibc.ParseMsgTransfer))

// cosmos authz
manager.RegisterParser("/cosmos.authz.v1beta1.MsgGrant", manager.GetCronosV1_4_0BlockHeight(), V1_4_0_cronos_msg.ParseMsgEventsToLog(ParseMsgGrant))
manager.RegisterParser("/cosmos.authz.v1beta1.MsgRevoke", manager.GetCronosV1_4_0BlockHeight(), V1_4_0_cronos_msg.ParseMsgEventsToLog(ParseMsgRevoke))
// FIXME: https://github.com/crypto-com/chain-indexing/issues/673
//manager.RegisterParser("/cosmos.authz.v1beta1.MsgExec", manager.GetCronosV1_4_0BlockHeight(), ParseMsgExec))

// cosmos feegrant
manager.RegisterParser("/cosmos.feegrant.v1beta1.MsgGrantAllowance", manager.GetCronosV1_4_0BlockHeight(), V1_4_0_cronos_msg.ParseMsgEventsToLog(ParseMsgGrantAllowance))
manager.RegisterParser("/cosmos.feegrant.v1beta1.MsgRevokeAllowance", manager.GetCronosV1_4_0BlockHeight(), V1_4_0_cronos_msg.ParseMsgEventsToLog(ParseMsgRevokeAllowance))

// cosmos vesting
manager.RegisterParser("/cosmos.vesting.v1beta1.MsgCreateVestingAccount", manager.GetCronosV1_4_0BlockHeight(), V1_4_0_cronos_msg.ParseMsgEventsToLog(ParseMsgCreateVestingAccount))
}
}

0 comments on commit d329110

Please sign in to comment.