-
Notifications
You must be signed in to change notification settings - Fork 5
ChainStore module #138
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
base: main
Are you sure you want to change the base?
ChainStore module #138
Conversation
ac5689b
to
2c21d6b
Compare
- Doesn't serialise byte arrays correctly yet
- blocks/{hash_or_number} endpoint added - blocks/slot/{slot_number} endpoint added - blocks/epoch/{epoch_number}/slot/{slot_number} endpoint added - add missing hash field to block info output
- also stub out addresses endpoint
- used to match for non-SPO issuers - builds, but probably doesn't work yet
- also add some macros to help make these types easily
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.
Great work - comments are primarily about code location
pallas-addresses = "0.33.0" | ||
pallas-crypto = "0.33.0" | ||
pallas-primitives = "0.33.0" | ||
pallas-traverse = "0.33.0" |
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.
Only just noticed these were already workspace dependencies on Pallas... Can we avoid this? I was hoping if we didn't expose Pallas in any common/ interfaces we could protect modules from this dependency unless they absolutely need it.
RolledBack, // Volatile, restarted after rollback | ||
} | ||
|
||
macro_rules! declare_byte_array_type { |
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.
Think this should be split out, as discussed generally
|
||
macro_rules! declare_byte_array_type_with_bech32 { | ||
($name:ident, $size:expr, $hrp:expr) => { | ||
declare_byte_array_type!($name, $size); |
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.
Yay, inheritance in Rust ;-)
} | ||
|
||
/// Handle `/blocks/latest`, `/blocks/{hash_or_number}` | ||
pub async fn handle_blocks_latest_hash_number_blockfrost( |
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.
Given this is in a rest_blockfrost module, do we need all these _blockfrost suffixes?
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.
I don't think we do, but I was maintaining consistency with the other functions in the crate
- rest_query_state is essentially query_state that returns RESTResponse, and handles the common error cases
WIP