diff --git a/docs/cli/zetacored/cli.md b/docs/cli/zetacored/cli.md index 36440f2704..a8719cf83f 100644 --- a/docs/cli/zetacored/cli.md +++ b/docs/cli/zetacored/cli.md @@ -9441,7 +9441,7 @@ zetacored tx crosschain vote-gas-price [chain] [price] [priorityFee] [blockNumbe Broadcast message to vote an inbound ``` -zetacored tx crosschain vote-inbound [sender] [senderChainID] [txOrigin] [receiver] [receiverChainID] [amount] [message] [inboundHash] [inBlockHeight] [coinType] [asset] [eventIndex] [protocolContractVersion] [isArbitraryCall] [flags] +zetacored tx crosschain vote-inbound [sender] [senderChainID] [txOrigin] [receiver] [receiverChainID] [amount] [message] [inboundHash] [inBlockHeight] [coinType] [asset] [eventIndex] [protocolContractVersion] [flags] ``` ### Options diff --git a/docs/openapi/openapi.swagger.yaml b/docs/openapi/openapi.swagger.yaml index a8c0a2516e..8af21304be 100644 --- a/docs/openapi/openapi.swagger.yaml +++ b/docs/openapi/openapi.swagger.yaml @@ -58446,6 +58446,8 @@ definitions: $ref: '#/definitions/crosschainCctxStatus' status_message: type: string + error_message: + type: string lastUpdate_timestamp: type: string format: int64 diff --git a/go.mod b/go.mod index 7625fc2047..8842e1f2d7 100644 --- a/go.mod +++ b/go.mod @@ -337,6 +337,7 @@ require ( github.com/bnb-chain/tss-lib v1.5.0 github.com/showa-93/go-mask v0.6.2 github.com/tonkeeper/tongo v1.9.3 + gotest.tools v2.2.0+incompatible ) require ( diff --git a/proto/zetachain/zetacore/crosschain/cross_chain_tx.proto b/proto/zetachain/zetacore/crosschain/cross_chain_tx.proto index 4baa375c65..dd59a44c04 100644 --- a/proto/zetachain/zetacore/crosschain/cross_chain_tx.proto +++ b/proto/zetachain/zetacore/crosschain/cross_chain_tx.proto @@ -95,6 +95,7 @@ message OutboundParams { message Status { CctxStatus status = 1; string status_message = 2; + string error_message = 6; int64 lastUpdate_timestamp = 3; bool isAbortRefunded = 4; // when the CCTX was created. only populated on new transactions. @@ -135,5 +136,4 @@ message CrossChainTx { repeated OutboundParams outbound_params = 10; ProtocolContractVersion protocol_contract_version = 11; RevertOptions revert_options = 12 [ (gogoproto.nullable) = false ]; - string error = 13; } diff --git a/testutil/sample/crosschain.go b/testutil/sample/crosschain.go index 059fd2bf9c..8f09271e23 100644 --- a/testutil/sample/crosschain.go +++ b/testutil/sample/crosschain.go @@ -213,7 +213,6 @@ func CrossChainTx(t *testing.T, index string) *types.CrossChainTx { OutboundParams: []*types.OutboundParams{OutboundParams(r), OutboundParams(r)}, ProtocolContractVersion: types.ProtocolContractVersion_V1, RevertOptions: types.NewEmptyRevertOptions(), - Error: "", } } diff --git a/typescript/zetachain/zetacore/crosschain/cross_chain_tx_pb.d.ts b/typescript/zetachain/zetacore/crosschain/cross_chain_tx_pb.d.ts index 1ffa04eaca..0b0f67c762 100644 --- a/typescript/zetachain/zetacore/crosschain/cross_chain_tx_pb.d.ts +++ b/typescript/zetachain/zetacore/crosschain/cross_chain_tx_pb.d.ts @@ -359,6 +359,11 @@ export declare class Status extends Message { */ statusMessage: string; + /** + * @generated from field: string error_message = 6; + */ + errorMessage: string; + /** * @generated from field: int64 lastUpdate_timestamp = 3; */ diff --git a/x/crosschain/keeper/cctx_gateway_observers.go b/x/crosschain/keeper/cctx_gateway_observers.go index e4f92b3293..30e414f504 100644 --- a/x/crosschain/keeper/cctx_gateway_observers.go +++ b/x/crosschain/keeper/cctx_gateway_observers.go @@ -75,7 +75,7 @@ func (c CCTXGatewayObservers) InitiateOutbound( }() if err != nil { // do not commit anything here as the CCTX should be aborted - config.CCTX.SetAbort(true, err.Error()) + config.CCTX.SetAbort("", err.Error()) return types.CctxStatus_Aborted, err } commit() diff --git a/x/crosschain/keeper/cctx_gateway_zevm.go b/x/crosschain/keeper/cctx_gateway_zevm.go index d977b0bcb9..4afa112fc6 100644 --- a/x/crosschain/keeper/cctx_gateway_zevm.go +++ b/x/crosschain/keeper/cctx_gateway_zevm.go @@ -28,7 +28,7 @@ func (c CCTXGatewayZEVM) InitiateOutbound( if err != nil && !isContractReverted { // exceptional case; internal error; should abort CCTX - config.CCTX.SetAbort(true, err.Error()) + config.CCTX.SetAbort("", err.Error()) return types.CctxStatus_Aborted, err } diff --git a/x/crosschain/keeper/cctx_orchestrator_validate_outbound.go b/x/crosschain/keeper/cctx_orchestrator_validate_outbound.go index 53ccc35ef1..573de2ba26 100644 --- a/x/crosschain/keeper/cctx_orchestrator_validate_outbound.go +++ b/x/crosschain/keeper/cctx_orchestrator_validate_outbound.go @@ -53,7 +53,7 @@ func (k Keeper) ValidateOutboundZEVM( cctx.InboundParams.Amount, ) if err != nil { - cctx.SetAbort(true, fmt.Sprintf("%s : %s", depositErr, err.Error())) + cctx.SetAbort("", fmt.Sprintf("deposit error %s, got error: %s", depositErr, err.Error())) return types.CctxStatus_Aborted } @@ -122,7 +122,7 @@ func (k Keeper) processFailedOutboundObservers(ctx sdk.Context, cctx *types.Cros if cctx.InboundParams.CoinType == coin.CoinType_Cmd { // if the cctx is of coin type cmd or the sender chain is zeta chain, then we do not revert, the cctx is aborted cctx.GetCurrentOutboundParam().TxFinalizationStatus = types.TxFinalizationStatus_Executed - cctx.SetAbort(true, "Outbound failed: cmd cctx reverted") + cctx.SetAbort("", "outbound failed, cmd cctx reverted") } else if chains.IsZetaChain(cctx.InboundParams.SenderChainId, k.GetAuthorityKeeper().GetAdditionalChainList(ctx)) { switch cctx.InboundParams.CoinType { // Try revert if the coin-type is ZETA @@ -137,7 +137,7 @@ func (k Keeper) processFailedOutboundObservers(ctx sdk.Context, cctx *types.Cros default: { cctx.GetCurrentOutboundParam().TxFinalizationStatus = types.TxFinalizationStatus_Executed - cctx.SetAbort(true, "Outbound failed for non-ZETA cctx") + cctx.SetAbort("", "outbound failed for non-ZETA cctx") } } } else { @@ -195,10 +195,10 @@ func (k Keeper) processFailedOutboundOnExternalChain( return err } // Not setting the finalization status here, the required changes have been made while creating the revert tx - cctx.SetPendingRevert(true, revertMsg) + cctx.SetPendingRevert("", revertMsg) case types.CctxStatus_PendingRevert: cctx.GetCurrentOutboundParam().TxFinalizationStatus = types.TxFinalizationStatus_Executed - cctx.SetAbort(true, "Outbound failed: revert failed; abort TX") + cctx.SetAbort("", "outbound and revert failed") } return nil } @@ -225,9 +225,9 @@ func (k Keeper) processSuccessfulOutbound( oldStatus := cctx.CctxStatus.Status switch oldStatus { case types.CctxStatus_PendingRevert: - cctx.SetReverted(false, "Outbound succeeded: revert executed") + cctx.SetReverted("", "revert executed") case types.CctxStatus_PendingOutbound: - cctx.SetOutboundMined(false, "Outbound succeeded: mined") + cctx.SetOutboundMined("", "") default: return } @@ -256,7 +256,7 @@ func (k Keeper) processFailedZETAOutboundOnZEVM(ctx sdk.Context, cctx *types.Cro } // Trying to revert the transaction this would get set to a finalized status in the same block as this does not need a TSS singing - cctx.SetPendingRevert(true, "Outbound failed: trying to revert") + cctx.SetPendingRevert("", "outbound failed") data, err := base64.StdEncoding.DecodeString(cctx.RelayedMessage) if err != nil { return fmt.Errorf("failed decoding relayed message: %s", err.Error()) @@ -290,7 +290,7 @@ func (k Keeper) processFailedZETAOutboundOnZEVM(ctx sdk.Context, cctx *types.Cro return fmt.Errorf("failed ZETARevertAndCallContract: %s", err.Error()) } - cctx.SetReverted(true, "Outbound failed: revert executed") + cctx.SetReverted("", "outbound failed") if len(ctx.TxBytes()) > 0 { // add event for tendermint transaction hash format hash := tmbytes.HexBytes(tmtypes.Tx(ctx.TxBytes()).Hash()) @@ -336,7 +336,7 @@ func (k Keeper) processFailedOutboundV2(ctx sdk.Context, cctx *types.CrossChainT } // update status - cctx.SetPendingRevert(true, "Outbound failed: trying revert") + cctx.SetPendingRevert("", "outbound failed") // process the revert on ZEVM if err := k.fungibleKeeper.ProcessV2RevertDeposit( @@ -354,7 +354,7 @@ func (k Keeper) processFailedOutboundV2(ctx sdk.Context, cctx *types.CrossChainT } // tx is reverted - cctx.SetReverted(true, "Outbound failed: revert executed") + cctx.SetReverted("", "outbound failed") // add event for tendermint transaction hash format if len(ctx.TxBytes()) > 0 { @@ -367,7 +367,7 @@ func (k Keeper) processFailedOutboundV2(ctx sdk.Context, cctx *types.CrossChainT cctx.GetCurrentOutboundParam().TxFinalizationStatus = types.TxFinalizationStatus_Executed case types.CctxStatus_PendingRevert: cctx.GetCurrentOutboundParam().TxFinalizationStatus = types.TxFinalizationStatus_Executed - cctx.SetAbort(true, "Outbound failed: revert failed; abort TX") + cctx.SetAbort("", "outbound and revert failed") } return nil } diff --git a/x/crosschain/keeper/initiate_outbound.go b/x/crosschain/keeper/initiate_outbound.go index 9de817ff75..c2f87d7630 100644 --- a/x/crosschain/keeper/initiate_outbound.go +++ b/x/crosschain/keeper/initiate_outbound.go @@ -38,6 +38,6 @@ func (k Keeper) InitiateOutbound(ctx sdk.Context, config InitiateOutboundConfig) ) } - config.CCTX.SetPendingOutbound(false, "") + config.CCTX.SetPendingOutbound("", "") return cctxGateway.InitiateOutbound(ctx, config) } diff --git a/x/crosschain/keeper/msg_server_vote_inbound_tx_test.go b/x/crosschain/keeper/msg_server_vote_inbound_tx_test.go index e824a01707..66031760ee 100644 --- a/x/crosschain/keeper/msg_server_vote_inbound_tx_test.go +++ b/x/crosschain/keeper/msg_server_vote_inbound_tx_test.go @@ -265,7 +265,7 @@ func TestKeeper_VoteInbound(t *testing.T) { }) } -func TestStatus_ChangeStatus(t *testing.T) { +func TestStatus_UpdateCctxStatus(t *testing.T) { tt := []struct { Name string Status types.Status @@ -302,7 +302,7 @@ func TestStatus_ChangeStatus(t *testing.T) { for _, test := range tt { test := test t.Run(test.Name, func(t *testing.T) { - test.Status.ChangeStatus(test.NonErrStatus, test.Msg) + test.Status.UpdateCctxStatus(test.NonErrStatus, false, test.Msg, "") if test.IsErr { require.Equal(t, test.ErrStatus, test.Status.Status) } else { diff --git a/x/crosschain/keeper/msg_server_vote_outbound_tx.go b/x/crosschain/keeper/msg_server_vote_outbound_tx.go index c114fd5404..4bb65a3c8f 100644 --- a/x/crosschain/keeper/msg_server_vote_outbound_tx.go +++ b/x/crosschain/keeper/msg_server_vote_outbound_tx.go @@ -185,7 +185,7 @@ SaveFailedOutbound saves a failed outbound transaction.It does the following thi */ func (k Keeper) SaveFailedOutbound(ctx sdk.Context, cctx *types.CrossChainTx, errMessage string, tssPubkey string) { - cctx.SetAbort(true, errMessage) + cctx.SetAbort("", errMessage) ctx.Logger().Error(errMessage) k.SaveOutbound(ctx, cctx, tssPubkey) } diff --git a/x/crosschain/types/cctx.go b/x/crosschain/types/cctx.go index fc64000121..62bfee0382 100644 --- a/x/crosschain/types/cctx.go +++ b/x/crosschain/types/cctx.go @@ -170,42 +170,29 @@ func (m *CrossChainTx) AddOutbound( return nil } -func (m *CrossChainTx) ChangeStatus(newStatus CctxStatus, isError bool, msg string) { - switch { - case isError && msg == "": - m.CctxStatus.ChangeStatus(newStatus, "") - m.Error = "unexpected error" - case isError && msg != "": - m.CctxStatus.ChangeStatus(newStatus, "") - m.Error = msg - case !isError: - m.CctxStatus.ChangeStatus(newStatus, msg) - } -} - // SetAbort sets the CCTX status to Aborted with the given error message. -func (m *CrossChainTx) SetAbort(isError bool, msg string) { - m.ChangeStatus(CctxStatus_Aborted, isError, msg) +func (m CrossChainTx) SetAbort(statusMsg, errorMsg string) { + m.CctxStatus.UpdateCctxStatus(CctxStatus_Aborted, true, statusMsg, errorMsg) } // SetPendingRevert sets the CCTX status to PendingRevert with the given error message. -func (m *CrossChainTx) SetPendingRevert(isError bool, msg string) { - m.ChangeStatus(CctxStatus_PendingRevert, isError, msg) +func (m CrossChainTx) SetPendingRevert(statusMsg, errorMsg string) { + m.CctxStatus.UpdateCctxStatus(CctxStatus_PendingRevert, true, statusMsg, errorMsg) } // SetPendingOutbound sets the CCTX status to PendingOutbound with the given error message. -func (m *CrossChainTx) SetPendingOutbound(isError bool, msg string) { - m.ChangeStatus(CctxStatus_PendingOutbound, isError, msg) +func (m CrossChainTx) SetPendingOutbound(statusMsg, errorMsg string) { + m.CctxStatus.UpdateCctxStatus(CctxStatus_PendingOutbound, false, statusMsg, errorMsg) } // SetOutboundMined sets the CCTX status to OutboundMined with the given error message. -func (m *CrossChainTx) SetOutboundMined(isError bool, msg string) { - m.ChangeStatus(CctxStatus_OutboundMined, isError, msg) +func (m CrossChainTx) SetOutboundMined(statusMsg, errorMsg string) { + m.CctxStatus.UpdateCctxStatus(CctxStatus_OutboundMined, false, statusMsg, errorMsg) } // SetReverted sets the CCTX status to Reverted with the given error message. -func (m *CrossChainTx) SetReverted(isError bool, msg string) { - m.ChangeStatus(CctxStatus_Reverted, isError, msg) +func (m CrossChainTx) SetReverted(statusMsg, errorMsg string) { + m.CctxStatus.UpdateCctxStatus(CctxStatus_Reverted, true, statusMsg, errorMsg) } func (m CrossChainTx) GetCCTXIndexBytes() ([32]byte, error) { @@ -286,7 +273,6 @@ func NewCCTX(ctx sdk.Context, msg MsgVoteInbound, tssPubkey string) (CrossChainT OutboundParams: []*OutboundParams{outboundParams}, ProtocolContractVersion: msg.ProtocolContractVersion, RevertOptions: msg.RevertOptions, - Error: "", } // TODO: remove this validate call diff --git a/x/crosschain/types/cctx_test.go b/x/crosschain/types/cctx_test.go index d3c5745d29..862d062110 100644 --- a/x/crosschain/types/cctx_test.go +++ b/x/crosschain/types/cctx_test.go @@ -150,83 +150,45 @@ func Test_SetRevertOutboundValues(t *testing.T) { func TestCrossChainTx_SetAbort(t *testing.T) { cctx := sample.CrossChainTx(t, "test") - cctx.SetAbort(false, "test") + cctx.CctxStatus.Status = types.CctxStatus_PendingOutbound + cctx.SetAbort("test", "test") require.Equal(t, types.CctxStatus_Aborted, cctx.CctxStatus.Status) require.Contains(t, cctx.CctxStatus.StatusMessage, "test") -} - -func TestCrossChainTx_SetAbortWithError(t *testing.T) { - cctx := sample.CrossChainTx(t, "test") - cctx.SetAbort(true, "test") - require.Equal(t, types.CctxStatus_Aborted, cctx.CctxStatus.Status) - require.NotContains(t, cctx.CctxStatus.StatusMessage, "test") - require.Equal(t, "test", cctx.Error) + require.Contains(t, cctx.CctxStatus.ErrorMessage, "test") } func TestCrossChainTx_SetPendingRevert(t *testing.T) { cctx := sample.CrossChainTx(t, "test") cctx.CctxStatus.Status = types.CctxStatus_PendingOutbound - cctx.SetPendingRevert(false, "test") + cctx.SetPendingRevert("test", "test") require.Equal(t, types.CctxStatus_PendingRevert, cctx.CctxStatus.Status) require.Contains(t, cctx.CctxStatus.StatusMessage, "test") -} - -func TestCrossChainTx_SetPendingWithError(t *testing.T) { - cctx := sample.CrossChainTx(t, "test") - cctx.CctxStatus.Status = types.CctxStatus_PendingOutbound - cctx.SetPendingRevert(true, "test") - require.Equal(t, types.CctxStatus_PendingRevert, cctx.CctxStatus.Status) - require.NotContains(t, cctx.CctxStatus.StatusMessage, "test") - require.Equal(t, "test", cctx.Error) + require.Contains(t, cctx.CctxStatus.ErrorMessage, "test") } func TestCrossChainTx_SetPendingOutbound(t *testing.T) { cctx := sample.CrossChainTx(t, "test") cctx.CctxStatus.Status = types.CctxStatus_PendingInbound - cctx.SetPendingOutbound(false, "test") + cctx.SetPendingOutbound("test", "test") require.Equal(t, types.CctxStatus_PendingOutbound, cctx.CctxStatus.Status) require.Contains(t, cctx.CctxStatus.StatusMessage, "test") -} - -func TestCrossChainTx_SetPendingOutboundWithError(t *testing.T) { - cctx := sample.CrossChainTx(t, "test") - cctx.CctxStatus.Status = types.CctxStatus_PendingInbound - cctx.SetPendingOutbound(true, "test") - require.Equal(t, types.CctxStatus_PendingOutbound, cctx.CctxStatus.Status) - require.NotContains(t, cctx.CctxStatus.StatusMessage, "test") - require.Equal(t, "test", cctx.Error) + require.NotContains(t, cctx.CctxStatus.ErrorMessage, "test") } func TestCrossChainTx_SetOutboundMined(t *testing.T) { cctx := sample.CrossChainTx(t, "test") cctx.CctxStatus.Status = types.CctxStatus_PendingOutbound - cctx.SetOutboundMined(false, "test") + cctx.SetOutboundMined("test", "test") require.Equal(t, types.CctxStatus_OutboundMined, cctx.CctxStatus.Status) require.Contains(t, cctx.CctxStatus.StatusMessage, "test") -} - -func TestCrossChainTx_SetOutboundMinedWithError(t *testing.T) { - cctx := sample.CrossChainTx(t, "test") - cctx.CctxStatus.Status = types.CctxStatus_PendingOutbound - cctx.SetOutboundMined(true, "test") - require.Equal(t, types.CctxStatus_OutboundMined, cctx.CctxStatus.Status) - require.NotContains(t, cctx.CctxStatus.StatusMessage, "test") - require.Contains(t, cctx.Error, "test") + require.NotContains(t, cctx.CctxStatus.ErrorMessage, "test") } func TestCrossChainTx_SetReverted(t *testing.T) { cctx := sample.CrossChainTx(t, "test") cctx.CctxStatus.Status = types.CctxStatus_PendingRevert - cctx.SetReverted(false, "test") + cctx.SetReverted("test", "test") require.Equal(t, types.CctxStatus_Reverted, cctx.CctxStatus.Status) require.Contains(t, cctx.CctxStatus.StatusMessage, "test") -} - -func TestCrossChainTx_SetRevertedWithError(t *testing.T) { - cctx := sample.CrossChainTx(t, "test") - cctx.CctxStatus.Status = types.CctxStatus_PendingRevert - cctx.SetReverted(true, "test") - require.Equal(t, types.CctxStatus_Reverted, cctx.CctxStatus.Status) - require.NotContains(t, cctx.CctxStatus.StatusMessage, "test") - require.Contains(t, cctx.Error, "test") + require.Contains(t, cctx.CctxStatus.ErrorMessage, "test") } diff --git a/x/crosschain/types/cross_chain_tx.pb.go b/x/crosschain/types/cross_chain_tx.pb.go index 76f9e9ed53..ade3cf51e9 100644 --- a/x/crosschain/types/cross_chain_tx.pb.go +++ b/x/crosschain/types/cross_chain_tx.pb.go @@ -490,6 +490,7 @@ func (m *OutboundParams) GetCallOptions() *CallOptions { type Status struct { Status CctxStatus `protobuf:"varint,1,opt,name=status,proto3,enum=zetachain.zetacore.crosschain.CctxStatus" json:"status,omitempty"` StatusMessage string `protobuf:"bytes,2,opt,name=status_message,json=statusMessage,proto3" json:"status_message,omitempty"` + ErrorMessage string `protobuf:"bytes,6,opt,name=error_message,json=errorMessage,proto3" json:"error_message,omitempty"` LastUpdateTimestamp int64 `protobuf:"varint,3,opt,name=lastUpdate_timestamp,json=lastUpdateTimestamp,proto3" json:"lastUpdate_timestamp,omitempty"` IsAbortRefunded bool `protobuf:"varint,4,opt,name=isAbortRefunded,proto3" json:"isAbortRefunded,omitempty"` // when the CCTX was created. only populated on new transactions. @@ -543,6 +544,13 @@ func (m *Status) GetStatusMessage() string { return "" } +func (m *Status) GetErrorMessage() string { + if m != nil { + return m.ErrorMessage + } + return "" +} + func (m *Status) GetLastUpdateTimestamp() int64 { if m != nil { return m.LastUpdateTimestamp @@ -644,7 +652,6 @@ type CrossChainTx struct { OutboundParams []*OutboundParams `protobuf:"bytes,10,rep,name=outbound_params,json=outboundParams,proto3" json:"outbound_params,omitempty"` ProtocolContractVersion ProtocolContractVersion `protobuf:"varint,11,opt,name=protocol_contract_version,json=protocolContractVersion,proto3,enum=zetachain.zetacore.crosschain.ProtocolContractVersion" json:"protocol_contract_version,omitempty"` RevertOptions RevertOptions `protobuf:"bytes,12,opt,name=revert_options,json=revertOptions,proto3" json:"revert_options"` - Error string `protobuf:"bytes,13,opt,name=error,proto3" json:"error,omitempty"` } func (m *CrossChainTx) Reset() { *m = CrossChainTx{} } @@ -736,13 +743,6 @@ func (m *CrossChainTx) GetRevertOptions() RevertOptions { return RevertOptions{} } -func (m *CrossChainTx) GetError() string { - if m != nil { - return m.Error - } - return "" -} - func init() { proto.RegisterEnum("zetachain.zetacore.crosschain.CctxStatus", CctxStatus_name, CctxStatus_value) proto.RegisterEnum("zetachain.zetacore.crosschain.TxFinalizationStatus", TxFinalizationStatus_name, TxFinalizationStatus_value) @@ -761,92 +761,93 @@ func init() { } var fileDescriptor_d4c1966807fb5cb2 = []byte{ - // 1360 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x57, 0xcd, 0x6e, 0x1b, 0xb7, - 0x13, 0xd7, 0xda, 0x92, 0x2c, 0x8d, 0x3e, 0xbc, 0xa6, 0x15, 0x67, 0xe3, 0x3f, 0xa2, 0xf8, 0xaf, - 0xd6, 0x89, 0xe2, 0xd6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8, 0x05, 0x57, 0x8e, 0x69, 0x8c, 0x7b, 0xf4, 0x39, 0x89, 0x02, 0x59, 0x12, 0x8b, 0x0c, 0x0a, - 0x79, 0x79, 0x62, 0x7c, 0x46, 0x04, 0x36, 0xb0, 0x14, 0x56, 0xc4, 0x28, 0x30, 0x16, 0x2c, 0x28, - 0x8b, 0x03, 0x2e, 0xb0, 0x18, 0x72, 0xaf, 0xa0, 0xaa, 0x7c, 0xb7, 0x71, 0x61, 0x17, 0x35, 0x0e, - 0x47, 0xbb, 0x67, 0x7c, 0x1f, 0x2b, 0x57, 0xbf, 0x22, 0xce, 0xd1, 0xd6, 0xbe, 0x83, 0xb2, 0x0c, - 0xbc, 0x15, 0x86, 0xb2, 0x5e, 0x34, 0xee, 0xa0, 0x00, 0x96, 0x71, 0x9b, 0x25, 0xc2, 0xa6, 0x6b, - 0x0e, 0xc2, 0xf9, 0xb0, 0x83, 0x58, 0x32, 0x58, 0x2a, 0x88, 0x42, 0xaa, 0x1d, 0x41, 0x61, 0x07, - 0xf7, 0x7a, 0xfb, 0x03, 0x99, 0x06, 0x97, 0x2d, 0xd6, 0xc1, 0x3c, 0xe8, 0xd1, 0x3e, 0xd5, 0x51, - 0xd2, 0x7e, 0xae, 0x83, 0xf9, 0xd7, 0x52, 0x46, 0x1b, 0xb0, 0x44, 0x79, 0x80, 0x93, 0x36, 0x15, - 0x09, 0x4e, 0xc6, 0x41, 0x88, 0x7b, 0x3d, 0xd5, 0xa9, 0x39, 0x7f, 0x91, 0xf2, 0x2d, 0xab, 0x97, - 0x78, 0xb5, 0xd7, 0x59, 0x28, 0xef, 0x0f, 0xc5, 0xd9, 0xf6, 0x5f, 0x85, 0x5c, 0x42, 0x42, 0x42, - 0x4f, 0x27, 0x04, 0x98, 0xc8, 0xe8, 0x36, 0xb8, 0x76, 0xad, 0x49, 0xb0, 0x67, 0x39, 0xb0, 0x68, - 0xf5, 0x96, 0x05, 0x33, 0x8d, 0x3e, 0xff, 0x61, 0x8d, 0x3e, 0x6d, 0xe9, 0xf4, 0xbf, 0x6b, 0x69, - 0x49, 0x49, 0xce, 0x83, 0x98, 0xc5, 0x21, 0x51, 0xac, 0x49, 0xfb, 0x39, 0xc1, 0xf9, 0x23, 0x29, - 0xcf, 0x16, 0x33, 0xfb, 0x4e, 0x31, 0x8d, 0x71, 0x90, 0xd0, 0x90, 0x18, 0x22, 0x48, 0xe3, 0x81, - 0x94, 0x51, 0x1d, 0x5c, 0x63, 0x64, 0x09, 0x15, 0xe3, 0xe0, 0x98, 0x10, 0xef, 0xaa, 0xda, 0x53, - 0xd6, 0x7b, 0x94, 0x7a, 0x97, 0x10, 0x84, 0x20, 0xad, 0xa8, 0x94, 0x53, 0x56, 0xb5, 0x7e, 0x1f, - 0x22, 0x5c, 0xc4, 0x32, 0xb8, 0x90, 0x65, 0xd7, 0x40, 0xa6, 0x19, 0x0c, 0x39, 0x89, 0xbc, 0x8a, - 0xda, 0xb9, 0xd0, 0xc1, 0xfc, 0x09, 0x27, 0x11, 0xfa, 0x06, 0x96, 0xc9, 0xf1, 0x31, 0x09, 0x05, - 0x3d, 0x25, 0xc1, 0xf4, 0xe3, 0xae, 0xa8, 0x12, 0x37, 0x4c, 0x89, 0x6f, 0xbe, 0x47, 0x89, 0xf7, - 0x64, 0xaf, 0x4e, 0xa0, 0xee, 0xdb, 0xaa, 0x34, 0xde, 0xc5, 0xd7, 0x95, 0x5d, 0x51, 0x59, 0xcc, - 0xec, 0xd7, 0x25, 0xbe, 0x0e, 0x20, 0x0f, 0x67, 0x30, 0x6c, 0x9f, 0x90, 0xb1, 0x62, 0x6b, 0xde, - 0x97, 0xc7, 0x75, 0xa0, 0x14, 0x17, 0x10, 0xbb, 0xf8, 0x1f, 0x13, 0x1b, 0x3d, 0x84, 0xa2, 0x24, - 0x4b, 0xc0, 0x34, 0xcd, 0x3c, 0x6f, 0xcd, 0xa9, 0x17, 0x5a, 0x1b, 0x97, 0x04, 0x38, 0x43, 0x4c, - 0xbf, 0x10, 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0x35, 0xf5, 0x6c, 0xf3, 0x0c, 0xbf, 0x64, 0xb9, 0x37, - 0xf5, 0xbf, 0x8a, 0x98, 0x45, 0xa4, 0x39, 0x3a, 0xfb, 0xe7, 0x45, 0x51, 0xad, 0x9d, 0x55, 0xc7, - 0x79, 0xf7, 0xaf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x69, 0x53, 0x70, 0x6b, 0xea, 0x0c, 0x00, 0x00, + // 1361 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x57, 0xcf, 0x6e, 0x1b, 0xb7, + 0x13, 0xf6, 0xda, 0xb2, 0x2c, 0x8d, 0xfe, 0x78, 0x4d, 0x2b, 0xce, 0xc6, 0x3f, 0x44, 0xf1, 0x4f, + 0xad, 0x13, 0xc5, 0xad, 0x25, 0x44, 0x01, 0x8a, 0xa2, 0x37, 0xdb, 0x88, 0x13, 0xb7, 0x4d, 0x6c, + 0x6c, 0x1c, 0x03, 0xc9, 0xa1, 0x5b, 0x6a, 0x97, 0x96, 0x08, 0xaf, 0x96, 0xea, 0x92, 0x32, 0xa4, + 0xa0, 0xb7, 0x9e, 0x0b, 0xf4, 0x15, 0x0a, 0xf4, 0xd0, 0x63, 0x1f, 0x23, 0xc7, 0x1c, 0x8b, 0x1e, + 0x82, 0x20, 0x79, 0x83, 0x3e, 0x41, 0xc1, 0x7f, 0x92, 0x15, 0xb8, 0x76, 0x9a, 0xf6, 0x24, 0xf2, + 0x1b, 0xf2, 0x9b, 0xd9, 0xe1, 0x7c, 0x43, 0x0a, 0x5a, 0xcf, 0x89, 0xc0, 0x61, 0x17, 0xd3, 0xa4, + 0xa9, 0x46, 0x2c, 0x25, 0xcd, 0x30, 0x65, 0x9c, 0x6b, 0x4c, 0x0d, 0x03, 0x35, 0x0e, 0xc4, 0xb0, + 0xd1, 0x4f, 0x99, 0x60, 0xe8, 0xfa, 0x78, 0x4f, 0xc3, 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0xb0, 0xa5, 0x1f, 0x3d, 0x6e, 0x76, 0x35, 0xf3, 0xeb, 0x2f, 0x55, 0x67, 0xe3, 0x2b, 0xa8, + 0x9c, 0xd7, 0xba, 0x91, 0x0b, 0xc5, 0x47, 0x4c, 0xec, 0xda, 0x27, 0xa0, 0x3b, 0x83, 0x4a, 0x90, + 0x9f, 0x4c, 0x1d, 0xc9, 0x7c, 0x6f, 0x48, 0xc2, 0x81, 0x24, 0x9b, 0x35, 0x64, 0x4d, 0xb8, 0xfa, + 0x37, 0x99, 0x45, 0x59, 0x98, 0x3d, 0xba, 0xe3, 0xce, 0xa8, 0xdf, 0x96, 0xeb, 0xe8, 0x0d, 0xdb, + 0xf7, 0x5f, 0xbc, 0xa9, 0x3a, 0x2f, 0xdf, 0x54, 0x9d, 0xd7, 0x6f, 0xaa, 0xce, 0x4f, 0x6f, 0xab, + 0x33, 0x2f, 0xdf, 0x56, 0x67, 0x7e, 0x7f, 0x5b, 0x9d, 0x79, 0xb6, 0x79, 0x46, 0x49, 0x32, 0xb1, + 0x9b, 0xfa, 0x4f, 0x46, 0xc2, 0x22, 0xd2, 0x1c, 0x9e, 0xfd, 0x2f, 0xa3, 0x44, 0xd5, 0xce, 0xaa, + 0x83, 0xbb, 0xfb, 0x57, 0x00, 0x00, 0x00, 0xff, 0xff, 0x84, 0x70, 0x56, 0x74, 0xf9, 0x0c, 0x00, + 0x00, } func (m *InboundParams) Marshal() (dAtA []byte, err error) { @@ -1180,6 +1181,13 @@ func (m *Status) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.ErrorMessage) > 0 { + i -= len(m.ErrorMessage) + copy(dAtA[i:], m.ErrorMessage) + i = encodeVarintCrossChainTx(dAtA, i, uint64(len(m.ErrorMessage))) + i-- + dAtA[i] = 0x32 + } if m.CreatedTimestamp != 0 { i = encodeVarintCrossChainTx(dAtA, i, uint64(m.CreatedTimestamp)) i-- @@ -1299,13 +1307,6 @@ func (m *CrossChainTx) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if len(m.Error) > 0 { - i -= len(m.Error) - copy(dAtA[i:], m.Error) - i = encodeVarintCrossChainTx(dAtA, i, uint64(len(m.Error))) - i-- - dAtA[i] = 0x6a - } { size, err := m.RevertOptions.MarshalToSizedBuffer(dAtA[:i]) if err != nil { @@ -1563,6 +1564,10 @@ func (m *Status) Size() (n int) { if m.CreatedTimestamp != 0 { n += 1 + sovCrossChainTx(uint64(m.CreatedTimestamp)) } + l = len(m.ErrorMessage) + if l > 0 { + n += 1 + l + sovCrossChainTx(uint64(l)) + } return n } @@ -1631,10 +1636,6 @@ func (m *CrossChainTx) Size() (n int) { } l = m.RevertOptions.Size() n += 1 + l + sovCrossChainTx(uint64(l)) - l = len(m.Error) - if l > 0 { - n += 1 + l + sovCrossChainTx(uint64(l)) - } return n } @@ -2792,6 +2793,38 @@ func (m *Status) Unmarshal(dAtA []byte) error { break } } + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ErrorMessage", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCrossChainTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthCrossChainTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthCrossChainTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ErrorMessage = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipCrossChainTx(dAtA[iNdEx:]) @@ -3332,38 +3365,6 @@ func (m *CrossChainTx) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 13: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Error", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCrossChainTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthCrossChainTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthCrossChainTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Error = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipCrossChainTx(dAtA[iNdEx:]) diff --git a/x/crosschain/types/status.go b/x/crosschain/types/status.go index cdaf5b0aae..0e54c847d0 100644 --- a/x/crosschain/types/status.go +++ b/x/crosschain/types/status.go @@ -9,28 +9,40 @@ func (m *Status) AbortRefunded() { m.StatusMessage = "CCTX aborted and Refunded" } -// ChangeStatus changes the status of the cross chain transaction -// empty msg does not overwrite old status message -func (m *Status) ChangeStatus(newStatus CctxStatus, msg string) { - if len(msg) > 0 { - if m.StatusMessage != "" { - m.StatusMessage = fmt.Sprintf("%s : %s", m.StatusMessage, msg) - } else { - m.StatusMessage = msg - } +// UpdateCctxStatus transitions the Status. +// In case of an error, ErrorMessage is updated. +// In case of no error, StatusMessage is updated. +func (m *Status) UpdateCctxStatus(newStatus CctxStatus, isError bool, statusMsg, errorMsg string) { + m.ChangeStatus(newStatus, statusMsg) + + if isError && errorMsg != "" { + m.ErrorMessage = errorMsg + } else if isError && errorMsg == "" { + m.ErrorMessage = "unknown error" } +} + +// ChangeStatus changes the status of the cross chain transaction. +func (m *Status) ChangeStatus(newStatus CctxStatus, statusMsg string) { if !m.ValidateTransition(newStatus) { m.StatusMessage = fmt.Sprintf( - "Failed to transition : OldStatus %s , NewStatus %s , MSG : %s :", + "Failed to transition status from %s to %s", m.Status.String(), newStatus.String(), - msg, ) + m.Status = CctxStatus_Aborted return } + + if statusMsg == "" { + m.StatusMessage = fmt.Sprintf("Status changed from %s to %s", m.Status.String(), newStatus.String()) + } else { + m.StatusMessage = statusMsg + } + m.Status = newStatus -} //nolint:typecheck +} func (m *Status) ValidateTransition(newStatus CctxStatus) bool { stateTransitionMap := stateTransitionMap() diff --git a/x/crosschain/types/status_test.go b/x/crosschain/types/status_test.go index 88013a41a9..97f2bcef4c 100644 --- a/x/crosschain/types/status_test.go +++ b/x/crosschain/types/status_test.go @@ -4,8 +4,8 @@ import ( "fmt" "testing" - "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "gotest.tools/assert" "github.com/zeta-chain/node/x/crosschain/types" ) @@ -149,8 +149,13 @@ func TestStatus_ChangeStatus(t *testing.T) { s := types.Status{Status: types.CctxStatus_PendingInbound} s.ChangeStatus(types.CctxStatus_PendingOutbound, "") + fmt.Printf("%+v\n", s) assert.Equal(t, s.Status, types.CctxStatus_PendingOutbound) - assert.Equal(t, s.StatusMessage, "") + assert.Equal(t, s.StatusMessage, fmt.Sprintf( + "Status changed from %s to %s", + types.CctxStatus_PendingInbound.String(), + types.CctxStatus_PendingOutbound.String()), + ) }) t.Run("should change status to aborted and msg if transition is invalid", func(t *testing.T) { @@ -161,10 +166,9 @@ func TestStatus_ChangeStatus(t *testing.T) { assert.Equal( t, fmt.Sprintf( - "Failed to transition : OldStatus %s , NewStatus %s , MSG : %s :", + "Failed to transition status from %s to %s", types.CctxStatus_PendingOutbound.String(), types.CctxStatus_PendingInbound.String(), - "msg", ), s.StatusMessage, )