Skip to content

Commit

Permalink
PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
skosito committed Jun 19, 2024
1 parent 86c1f5c commit ae38f3b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion x/crosschain/keeper/cctx_orchestrator_validate_inbound.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func (k Keeper) ValidateInbound(
return nil, err
}

inCctxIndex, ok := ctx.Value("inCctxIndex").(string)
inCctxIndex, ok := ctx.Value(InCCTXIndexKey).(string)
if ok {
cctx.InboundParams.ObservedHash = inCctxIndex

Check warning on line 45 in x/crosschain/keeper/cctx_orchestrator_validate_inbound.go

View check run for this annotation

Codecov / codecov/patch

x/crosschain/keeper/cctx_orchestrator_validate_inbound.go#L45

Added line #L45 was not covered by tests
}
Expand Down
2 changes: 1 addition & 1 deletion x/crosschain/keeper/cctx_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
zetaObserverTypes "github.com/zeta-chain/zetacore/x/observer/types"
)

// SetObserverOutboundInfo sets the CCTX outbound nonce to the next nonce, and updates the nonce of blockchain state.
// SetObserverOutboundInfo sets the CCTX outbound nonce to the next available nonce for the TSS address, and updates the nonce of blockchain state.
// It also updates the PendingNonces that is used to track the unfulfilled outbound txs.
func (k Keeper) SetObserverOutboundInfo(ctx sdk.Context, receiveChainID int64, cctx *types.CrossChainTx) error {
chain := k.GetObserverKeeper().GetSupportedChainFromChainID(ctx, receiveChainID)
Expand Down
4 changes: 3 additions & 1 deletion x/crosschain/keeper/evm_deposit.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ import (
fungibletypes "github.com/zeta-chain/zetacore/x/fungible/types"
)

const InCCTXIndexKey = "inCctxIndex"

// HandleEVMDeposit handles a deposit from an inbound tx
// returns (isContractReverted, err)
// (true, non-nil) means CallEVM() reverted
Expand Down Expand Up @@ -102,7 +104,7 @@ func (k Keeper) HandleEVMDeposit(ctx sdk.Context, cctx *types.CrossChainTx) (boo
if !evmTxResponse.Failed() && contractCall {
logs := evmtypes.LogsToEthereum(evmTxResponse.Logs)
if len(logs) > 0 {
ctx = ctx.WithValue("inCctxIndex", cctx.Index)
ctx = ctx.WithValue(InCCTXIndexKey, cctx.Index)
txOrigin := cctx.InboundParams.TxOrigin
if txOrigin == "" {
txOrigin = inboundSender
Expand Down

0 comments on commit ae38f3b

Please sign in to comment.