-
Notifications
You must be signed in to change notification settings - Fork 3
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
refactor: Extract registry types in to own crate #453
Conversation
uint = { version = "0.9.3", default-features = false } | ||
indexer_rule_type = { features = ["nearsdk"], path = "../../indexer/indexer_rule_type" } | ||
registry-types = { path = "../types", features = ["nearsdk"] } |
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.
are we using the nearsdk
feature?
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.
Yes - it forces the crate to use near-sdk
types so that it is compatible with the registry contract
Can we add some details in the main readme about this |
The types are used internally, I'm not sure adding something would provide much benefit? Did you have something specific in mind? |
This PR extract the types exposed by the registry contract in to its own reusable crate:
registry_types
. This was done to avoid the duplication across our different service which; fetch the JSON, and then construct the Rust types.registry_types
crateThe registry types were already partially shared between Coordinator and the registry, but I've expanded on this to include all types rather than just a subset. I've created a new crate, rather than using the existing
./indexer/indexer_rule_type
crate as some packages needed to be upgraded, which caused conflicts across theindexer/
cargo workspace - which seemed unnecessary to fix given that it is being deprecated.Registry contract updates
near-sdk
version4.1.1
is no longer compilable because it depends on a non-existent crate, hence the upgrade to5.0.0-alpha.1
. Since I was already making changes here, I decided to remove the migration related code as it is no longer needed.Consuming
registry_types
With the shared types in place, I've updated
block-streamer/
to use them, removing the existing types which it duplicates. I also went ahead and removed all types which were unused (left over from Alertexer).indexer_rule_type
depends onnear-sdk
version4.1.1
(the broken one), and since it's no longer shared, I removed that dependency so that it can compile again.Relates to #421