Skip to content

Commit 9ba13e3

Browse files
chore: reuse the constants for leaf type (#1361)
## 🔄 Changes Summary Reuse already present constants for leaf types and remove redundant ones. ## ⚠️ Breaking Changes N/A ## 📋 Config Updates N/A ## ✅ Testing - 🤖 **Automatic**: [Optional: Enumerate E2E tests] - 🖱️ **Manual**: [Optional: Steps to verify] ## 🐞 Issues - Closes #[issue-number] ## 🔗 Related PRs - [Optional: Enumerate related pull requests] ## 📝 Notes - [Optional: design decisions, tradeoffs, or TODOs]
1 parent b59f024 commit 9ba13e3

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

bridgesync/downloader.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,6 @@ var (
6464
// bridgeMessage(uint32 destinationNetwork,address destinationAddress,
6565
// bool forceUpdateGlobalExitRoot,bytes metadata)
6666
BridgeMessageMethodID = common.Hex2Bytes("240ff378")
67-
bridgeLeafTypeAsset = uint8(0)
68-
bridgeLeafTypeMessage = uint8(1)
6967
)
7068

7169
const (
@@ -133,9 +131,9 @@ func buildBridgeEventHandler(
133131
// Extract call data and root call for txn_sender
134132
foundCall, rootCall, err := extractCallData(client, bridgeAddr, l.TxHash, logger, func(c Call) (bool, error) {
135133
switch bridgeEvent.LeafType {
136-
case bridgeLeafTypeAsset:
134+
case bridgesynctypes.LeafTypeAsset.Uint8():
137135
return bytes.HasPrefix(c.Input, BridgeAssetMethodID), nil
138-
case bridgeLeafTypeMessage:
136+
case bridgesynctypes.LeafTypeMessage.Uint8():
139137
return bytes.HasPrefix(c.Input, BridgeMessageMethodID), nil
140138
}
141139
return false, nil

0 commit comments

Comments
 (0)