Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions cmd/zetatool/cctx/inbound.go
Original file line number Diff line number Diff line change
Expand Up @@ -237,20 +237,22 @@ func (c *TrackingDetails) evmInboundBallotIdentifier(ctx *context.Context) error
}
msg = zetatoolchains.GasVoteV1(tx, sender, receipt.BlockNumber.Uint64(), inboundChain.ChainId, zetaChainID)
}
case compareAddress(tx.To().Hex(), chainParams.GatewayAddress):
default:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know this is not related to the change, but can we do to := tx.To().Hex() before the switch and then use it inside of the compareAddress calls?

{
gatewayAddr := ethcommon.HexToAddress(chainParams.GatewayAddress)
gateway, err := gatewayevm.NewGatewayEVM(gatewayAddr, evmClient)
if err != nil {
return fmt.Errorf("failed to get gateway contract: %w", err)
}
foundLog := false
for _, log := range receipt.Logs {
if log == nil || log.Address != gatewayAddr {
continue
}
eventDeposit, err := gateway.ParseDeposited(*log)
if err == nil {
msg = zetatoolchains.DepositInboundVoteV2(eventDeposit, inboundChain.ChainId, zetaChainID)
foundLog = true
break
}
eventDepositAndCall, err := gateway.ParseDepositedAndCalled(*log)
Expand All @@ -260,23 +262,21 @@ func (c *TrackingDetails) evmInboundBallotIdentifier(ctx *context.Context) error
inboundChain.ChainId,
zetaChainID,
)
foundLog = true
break
}
eventCall, err := gateway.ParseCalled(*log)
if err == nil {
msg = zetatoolchains.CallInboundVoteV2(eventCall, inboundChain.ChainId, zetaChainID)
foundLog = true
break
}
}
if !foundLog {
return fmt.Errorf("no valid gateway event found for tx %s", inboundHash)
}
}
default:
return fmt.Errorf(
"irrelevant transaction , not sent to any known address txHash: %s to address %s",
inboundHash,
tx.To(),
)
}

c.CCTXIdentifier = msg.Digest()
c.updateInboundConfirmation(isConfirmed)
return nil
Expand Down
4 changes: 2 additions & 2 deletions cmd/zetatool/cctx/inbound_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ func Test_InboundBallotIdentifier(t *testing.T) {
},
{
name: chains.SolanaMainnet.Name,
inboundHash: "5oj38HmTH4k2NSsqHK9oRrLjpPNBkm17dNXHFsaT6cTuJQRPWTCGqsPpRumPEbpL2B6Wuv51M69WoJwM24864PjB",
inboundHash: "63mNGRSCUq2dYjnFGDdDQzUMyFdnpupQrbezSDStReoeRAfd32ekXRoJ4Eszq4fC3XL3xSQnSqyDBJYQQAoiYtc6",
inboundChainID: chains.SolanaMainnet.ChainId,
expectedBallotIdentifier: "0xfb5f2adc2a23c301d3231613284d937f6f45cc7b1139011abbc8486de7fcbd5f",
expectedBallotIdentifier: "0x465d6d48aa027bb633b26df727bea13baa1269025b95017aa0f5826a4acd8dc8",
expectError: false,
},
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/zetatool/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func MainnetConfig() *Config {
SolanaRPC: "https://api.mainnet-beta.solana.com",
BaseRPC: "https://base-mainnet.public.blastapi.io",
BscRPC: "https://bsc-mainnet.public.blastapi.io",
PolygonRPC: "https://polygon-bor-rpc.publicnode.com",
PolygonRPC: "https://polygon-rpc.com/",
}
}

Expand Down