From d16f239b4754f45c583538aec2cceda65a309951 Mon Sep 17 00:00:00 2001 From: Tanmay Date: Wed, 17 Apr 2024 02:11:40 -0400 Subject: [PATCH] add logs --- x/crosschain/keeper/cctx.go | 20 ++++---------------- x/observer/keeper/nonce_to_cctx.go | 3 --- 2 files changed, 4 insertions(+), 19 deletions(-) diff --git a/x/crosschain/keeper/cctx.go b/x/crosschain/keeper/cctx.go index 17396d53bf..653a7a0e37 100644 --- a/x/crosschain/keeper/cctx.go +++ b/x/crosschain/keeper/cctx.go @@ -30,9 +30,6 @@ func (k Keeper) SetCctxAndNonceToCctxAndInTxHashToCctx(ctx sdk.Context, cctx typ Tss: tss.TssPubkey, }) } - if cctx.InboundTxParams.CoinType == coin.CoinType_Zeta && cctx.CctxStatus.Status != types.CctxStatus_OutboundMined { - ctx.Logger().Error(fmt.Sprintf("SetNonceToCctx: cctx: %s", cctx.Index)) - } k.SetCrossChainTx(ctx, cctx) if cctx.InboundTxParams.CoinType == coin.CoinType_Zeta && cctx.CctxStatus.Status != types.CctxStatus_OutboundMined { @@ -55,19 +52,10 @@ func (k Keeper) SetCctxAndNonceToCctxAndInTxHashToCctx(ctx sdk.Context, cctx typ if cctx.InboundTxParams.CoinType == coin.CoinType_Zeta && cctx.CctxStatus.Status != types.CctxStatus_OutboundMined { ctx.Logger().Error(fmt.Sprintf("SetInTxHashToCctx: cctx: %s", cctx.Index)) } - //if cctx.InboundTxParams.CoinType == coin.CoinType_Zeta && cctx.CctxStatus.Status != types.CctxStatus_OutboundMined { - // ctx.Logger().Error(fmt.Sprintf("found tss: cctx: %s", cctx.Index)) - // ctx.Logger().Error(fmt.Sprintf("found tss: tss: %s", tss.TssPubkey)) - // ctx.Logger().Error(fmt.Sprintf("Nonce: %d", cctx.GetCurrentOutTxParam().OutboundTxTssNonce)) - // ctx.Logger().Error(fmt.Sprintf("ChainId: %d", cctx.GetCurrentOutTxParam().ReceiverChainId)) - //} - // - //if cctx.CctxStatus.Status == types.CctxStatus_Aborted && cctx.InboundTxParams.CoinType == coin.CoinType_Zeta { - // k.AddZetaAbortedAmount(ctx, GetAbortedAmount(cctx)) - //} - //if cctx.InboundTxParams.CoinType == coin.CoinType_Zeta && cctx.CctxStatus.Status != types.CctxStatus_OutboundMined { - // ctx.Logger().Error(fmt.Sprintf("SaveInbound completed: cctx: %s", cctx.Index)) - //} + + if cctx.CctxStatus.Status == types.CctxStatus_Aborted && cctx.InboundTxParams.CoinType == coin.CoinType_Zeta { + k.AddZetaAbortedAmount(ctx, GetAbortedAmount(cctx)) + } } // SetCrossChainTx set a specific send in the store from its index diff --git a/x/observer/keeper/nonce_to_cctx.go b/x/observer/keeper/nonce_to_cctx.go index 1144355388..6ecedd22ea 100644 --- a/x/observer/keeper/nonce_to_cctx.go +++ b/x/observer/keeper/nonce_to_cctx.go @@ -17,12 +17,9 @@ func (k Keeper) RemoveNonceToCctx(ctx sdk.Context, nonceToCctx types.NonceToCctx } func (k Keeper) SetNonceToCctx(ctx sdk.Context, nonceToCctx types.NonceToCctx) { - ctx.Logger().Error(fmt.Sprintf("set nonce to cctx start: %s", nonceToCctx.Tss)) store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.NonceToCctxKeyPrefix)) - ctx.Logger().Error(fmt.Sprintf("set nonce to cctx before marshal: %s", fmt.Sprintf("%s-%d-%d", nonceToCctx.Tss, nonceToCctx.ChainId, nonceToCctx.Nonce))) b := k.cdc.MustMarshal(&nonceToCctx) store.Set(types.KeyPrefix(fmt.Sprintf("%s-%d-%d", nonceToCctx.Tss, nonceToCctx.ChainId, nonceToCctx.Nonce)), b) - ctx.Logger().Error(fmt.Sprintf("set nonce to cctx complete: %s", fmt.Sprintf("%s-%d-%d", nonceToCctx.Tss, nonceToCctx.ChainId, nonceToCctx.Nonce))) } func (k Keeper) GetNonceToCctx(ctx sdk.Context, tss string, chainID int64, nonce int64) (val types.NonceToCctx, found bool) {