-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: use keccak chain ID #62
Conversation
public static findByHash( | ||
hashedChainId: Hex, | ||
chainIds: Caip2ChainId[], | ||
): Caip2ChainId | undefined { | ||
return chainIds.find( | ||
(id) => keccak256(toHex(id)).toLowerCase() === hashedChainId.toLowerCase(), | ||
); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's not a general solution, but since you use the constant EBO_SUPPORTED_CHAIN_IDS
, isn't it possible to have a map (hash => Caip2ChainId) ? it's more efficient
@@ -1,6 +1,7 @@ | |||
import { EboActorsManager, EboProcessor, ProtocolProvider } from "@ebo-agent/automated-dispute"; | |||
import { BlockNumberService, Caip2ChainId } from "@ebo-agent/blocknumber"; | |||
import { Logger } from "@ebo-agent/shared"; | |||
import { DiscordNotifier } from "@ebo-agent/automated-dispute/dist/services/discordNotifier.js"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you mean to import from dist?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice catch!
🤖 Linear
Closes GRT-212, GRT-89
Description
RequestCreated
event that comes with the chain ID hash, we need to find which no-hashed chain ID is the correct one by comparing all chain ID hashes with the one received via event.shared
package